Hi, To help I would need to know if the objective is to register user on the wiki or if the registration is for some other purpose. I suppose it is separate from the wiki registration. In this case you are pretty close to it.. The only thing that is wrong is the "saving" part. You have currently copied the way it is done for the wiki registration (which calls the createUser function which does the actual wiki page creation but also other things). The right way to do it for other data than user registration is to redirect the form to the "inline" or "save" action. If you redirect the form to the inline action you will get a form that users can fill in and that will then go to the "save" action. This is the way it works for blog articles in the default wiki. However this means two steps: one for choosing the wiki page name which will hold the information and the other for filing in the data itself. You can however directly send the data to the "save" page. The following code allows to direct to the "inline" action #includeTopic("XWiki.XWikiCommonJavascript") <form action="" id="newdoc"> <input type="hidden" name="parent" value="Main.WebHome" /> <input type="hidden" name="template" value="XWiki.RegistrationClassTemplate" /> <input type="hidden" name="sheet" value="1" /> <input type="hidden" name="webname" value="Main"/> <input type="text" name="name" value="name" size="18"/> <input type="button" value="Add this item" onclick='if (updateName(this.form.name)) { action="../../inline/" + this.form.webname.value + "/" + this.form.name.value; this.form.submit(); }' /> </form> Ludovic Ludovic Dubost a écrit :
Hi, I am completly new to xwiki. I would like to create a basic form to store registration (only last name info for the moment). Here is what I have already tried, but it does not work. I don't understand what I am supposed to do in order to store the new registration (should I create a Java class for this?) Any help would be appreciate - is there some demo available? thanks,
==================== XWiki.RegistrationClass: attribute name (String) ==================== XWiki.RegistrationClassSheet code: 1 Registration #set( $obj = $doc.getObject("XWiki.RegistrationClass", 0)) #set( $class = $obj.xWikiClass) <table border="0" cellspacing="0" cellpadding="2"> <tr> <td> *First Name:* </td> <td>$doc.display("first_name", $obj)</td> </tr> </table> ==================== XWiki.RegistrationClassTemplate: #includeForm("XWiki.RegistrationSheet") ==================== Main.Registration: 1 Registration #set ($register = $request.getParameter("register"))
#if ($register) Registration of *$request.getParameter("register_first_name")*
#set( $class = $xwiki.getDocument("XWiki.RegistrationClass").xWikiClass) #set( $reg = $class.newObject() ) #set($class.first_name = $request.getParameter("register_first_name"))
#if ($reg>0) Your registration has been correctly registered. Thanks. #else Sorry, an error occured during the registration process. #end
#else Please provide us with the following information:
<form id="register" name="register" action="" method="get"> <input type="hidden" name="template" value="XWiki.RegistrationTemplate" /> <input type="hidden" name="register" value="1"> #set( $class = $xwiki.getDocument("XWiki.RegistrationClass").xWikiClass) #set( $obj = $class.newObject() )
<table class="block" cellspacing="5px" border="0"> <tr> #set($prop = $class.first_name) <td>First Name</td> <td>$doc.displayEdit($prop, "register_", $obj)</td> </tr> </table> <input type="submit" value="Save My Registration"> </form> #end ====================
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
On Thursday 14 April 2005 18:53, Ludovic Dubost wrote:
To help I would need to know if the objective is to register user on the wiki or if the registration is for some other purpose. I suppose it is separate from the wiki registration.
yes the purpose is to save registration to a conference (a few info only)
In this case you are pretty close to it.. The only thing that is wrong is the "saving" part.
Thanks, I am going to test this. Another question: I need multi lingual app (english + vietnam). As current latest release does not support UTF-8 (?), I have tried the CVS version but cannot use then the multi langual mode: when I activate this feature in the wiki prefs and tried to edit a non english version page, I get a NullPointerException. Please advise. How stable is CVS? thanks for your help, Error number 0 in 11: Uncaught exception Wrapped Exception: null com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception Wrapped Exception: null at com.xpn.xwiki.web.ViewEditAction.execute(ViewEditAction.java:215) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Wrapped Exception: java.lang.NullPointerException at com.xpn.xwiki.doc.XWikiDocument.getLock(XWikiDocument.java:2012) at com.xpn.xwiki.XWikiService.renderEdit(XWikiService.java:757) at com.xpn.xwiki.web.ViewEditAction.execute(ViewEditAction.java:149) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http1 -- Mathieu Peltier ObjectWeb Consortium - INRIA E-mail: [email protected] JabberID: [email protected]
On Thursday 14 April 2005 18:53, Ludovic Dubost wrote:
To help I would need to know if the objective is to register user on the wiki or if the registration is for some other purpose. I suppose it is separate from the wiki registration.
In this case you are pretty close to it.. The only thing that is wrong is the "saving" part.
I cannot manage to make it work :-( btw, when I use the default form in the left menu to add a new in the blob, I get no form where to fill the news but only the field names (Title, Category, ...) with the following javascript error: Inline script thread Error: name: TypeError message: Statement on line 4: Expression evaluated to null or undefined and is not convertible to Object: document.forms.edit["XWiki.ArticleClass_0_title"] Backtrace: Line 4 of inline#1 script in http://localhost:8080/xwiki/bin/inline/Main/PageName?parent=Main.WebHome&tem... document.forms.edit["XWiki.ArticleClass_0_title"].value = title; -- Mathieu Peltier ObjectWeb Consortium - INRIA E-mail: [email protected] JabberID: [email protected]
participants (2)
-
Ludovic Dubost -
Mathieu Peltier