[xwiki-users] Create document from many template

roberto colferai roberto.colferai at assimoco.it
Thu Mar 5 09:41:18 CET 2009




Sergiu Dumitriu-2 wrote:
> 
> roberto colferai wrote:
>> 
>> 
>> Sergiu Dumitriu-2 wrote:
>>> roberto colferai wrote:
>>>> cut > 
>>> We're planning to do something like this in the future by default, but 
>>> not very soon.
>>>
>>> A way to implement this now is to:
>>> - create the templates as wiki documents
>>> - create a redirector page that accepts two URL parameters, document 
>>> name and template name, and does a redirect with: 
>>> $response.sendRedirect($xwiki.getURL($request.documentName, 'edit', 
>>> "template=${request.templateName}"))
>>> - create a panel with a text input field for the document name and a 
>>> select (drop down) list for choosing from the templates, which submits 
>>> these fields to the redirector page from above
>>>
>>> The above redirect works like this:
>>> - 'edit' will display the document in edit mode (works well for 
>>> unstructured wiki documents); you can use 'inline' for structured 
>>> (form-based) documents.
>>> - the "template=" parameter instructs the wiki to use another document 
>>> as a template for the edited document.
>>>
>> Sergiu, thank you for your answer and for your speed!
>> I have IT experienc from twenty years ago but only in mainframe host
>> system
>> (ibm-cobol-db2) and I have some difficult to understand completely how
>> you
>> tell.
>> I try to show you if I understand.
>> 1) create the templates making one wiki-page for every templates (es. pag
>> template1, template2 etc)
>> 2) create a redirect page that, I think, every users never see but works
>> "hide". How can I make it? How can I make a page that accepts two URL
>> parameters?
>> 3) create a panel (Is like create a page? I think no but I don't know
>> exatly
>> what is panel in this world). Is possibile make it with normal edit-mode
>> or
>> is an activity for developer? In this case what kind of skill I must
>> find?
>> Java programmer is enough?
> 
> In XWiki, "everything is a document". And in a document you can have 
> plain text, wiki formatting, HTML markup, and scripting. The default and 
> recommended scripting language is Velocity, a really small programming 
> language, backed up by the XWiki API, which provides access to the data 
> model, the current request/response, and to other important 
> functionalities. This forms the unstructured part of a document. On top 
> of it, wiki documents can contain a data type definition (like a blog 
> post, an access right rule, a comment, etc), and instances of different 
> such structured data. Combining structured and unstructured data with 
> scripts you can obtain in-wiki applications, like the ones you can find 
> on http://code.xwiki.org/xwiki/bin/view/Applications/
> 
> The templates will be regular wiki document, with the content reflecting 
> the predefined information you want to see in your documents. If you 
> want more advanced functionalities you can define data types and instead 
> of unstructured content you can make full-fledged applications, but this 
> is harder to master.
> 
> The redirect page is another wiki document that contains as text exactly 
> the line of code that I wrote above. Of course, this is the quick and 
> dirty version, without any error handling, like missing or malformed 
> arguments.
> 
> The panel is a structured document, you can easily create one by going 
> to the Panels space and fill in the name of the new panel in the little 
> form that's in there, and look (edit) at the other panels for examples.
> 
> There's no need for an advanced java programmer, as our goal is to make 
> application development as easy as possible (we're not quite there yet, 
> but close enough).
> 
> I know we lack detailed tutorials, but we're busy on the implementation 
> with little time for documentation. You can advance by:
> - looking at the other documents in the wiki, the examples on 
> http://code.xwiki.org/, the guides from 
> http://platform.xwiki.org/xwiki/bin/view/DevGuide/ and the tutorials 
> from http://platform.xwiki.org/xwiki/bin/view/DevGuide/Tutorials
> - looking at the Velocity documentation (velocity.apache.org) and our 
> javadoc for the API ( 
> http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/api/package-summary.html 
> )
> - posting questions on IRC or the users mailing list
> - getting payed support from www.xwiki.com (the best way to support 
> XWiki and its development)
> 
> 
> -- 
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> _______________________________________________
> users mailing list
> users at xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
> 
> 

Wow Sergiu, you're very helpful and friendly.
Thank you very much.
Now, I have some thing to study... :-)
Best Regards
Roberto


-----
ICT Area-responsable
Assimoco spa
Segrate, MI
Italy
-- 
View this message in context: http://n2.nabble.com/Create-document-from-many-template-tp2424398p2428145.html
Sent from the XWiki- Users mailing list archive at Nabble.com.



More information about the users mailing list