Re: [xwiki-users] TOC Macro question
Marius, I successfully reproduced the steps you followed on XEM 3.1 - $context.getEditorWysiwyg() is being correctly evaluated while in inline mode. However, when the textbox is displayed as part of the non-html table, it still does not render as WYSIWYG. When I follow your steps here, viewing the page as normal just prints the text $context.getEditorWysiwyg() on the page. However, when I switch to inline mode, this changes to: Sandbox.TestClass_0_description On the test Sandbox page, the text box then displays correctly as WYSIWYG. However, when I try this same thing on the page with the table, it doesn't work. When in Inline mode, $context.getEditorWysiwyg() still displays: Sandbox.TestClass_0_description,Sandbox.TestClass_1_description,Sandbox.TestClass_2_description etc... However, the box being displayed in the table still appears as plain text. Try the following code on the same Sandbox page with the TestClass. {{velocity}} $xwiki.jsfx.use(js/xwiki/table/tablefilterNsort.js) $xwiki.ssfx.use(js/xwiki/table/table.css) {{html}} table id=Table1 class=grid sortable doOddEven tr class=sortHeaderthHeader/th/tr trtd$doc.display('description')/td/tr {{/html}} (% class=grid sortable doOddEven id=Table2 %)(% class=sortHeader %)|=Header|$doc.display('description') {{toc /}} $context.getEditorWysiwyg(){{/velocity}} For me, this produces two tables. The top table displays a WYSIWG box (two, actually, which is strange). The bottom table displays a PlainText box. Additionally, when there's wiki syntax in the content of the TextBox, it is not being picked up by the TOC macro. So, it appears that this is somehow related to the table? aaron On Thu, Nov 10, 2011 at 11:39 PM, Marius Dumitru Florea mariusdumitru.flo...@xwiki.com wrote: Hi Aaron, I did the following test with XWiki Enterprise 3.2 and it worked: 1. I created a class Sandbox.TestClass with just one field of type TextArea, setting the Editor property to Wysiwyg (from class edit mode). 2. I added an object of type Sandbox.TestClass to the same page and put some text in the text area (from object edit mode). 3. I set the content of the Sandbox.TestClass page to (from wiki edit mode) --8-- {{velocity}} $doc.display('description') $context.getEditorWysiwyg() {{/velocity}} --8-- 4. I edited Sandbox.TestClass in Inline form edit mode (/xwiki/bin/edit/Sandbox/TestClass?editor=inline). The WYSIWYG editor was loaded and below it I could see Sandbox.TestClass_0_description. As you can see I didn't use the HTML macro, just the Velocity one. I don't understand why it works in your case with the HTML macro and not without it. Are you sure you're using the Inline form edit mode? Note that $doc.display method call outputs the same thing, a plain HTML text area, no matter what editor you set in the class field definition or in your user preferences. The difference comes from the fact that when the editor is set to Wysiwyg the field identifier (e.g. Sandbox.TestClass_0_description) is added (by $doc.display) to a list that can be retrieved with $context.getEditorWysiwyg(). The code that actually loads the WYSIWYG editor is in textarea_wysiwyg.vm template (included in editinline.vm template used by Inline form edit mode), which iterates the list returned by $context.getEditorWysiwyg() and replaces the specified fields with the WYSIWYG editor. If in your case $context.getEditorWysiwyg() is not evaluated (you put it inside the Velocity macro right? and after all $doc.display calls) then it's not surprising that no WYSIWYG editor is loaded. Hope this helps, Marius On Tue, Nov 8, 2011 at 2:26 PM, Ashtar Communications ashtarcommunicati...@gmail.com wrote: Thomas, Putting the line: $context.getEditorWysiwyg() in my sheet just results in that text being displayed on the page. Do I need to do something else to have that picked up by velocity? I'm sure I'm missing some obvious syntax ...it's late...:) The WYSIWYGText property has the default editor set to WYSIWYG, the PlainText property has it set to the plain text editor (obviously). Using the HTML macro, the WYSIWYG editor appears for that property - using wiki syntax, both show up as the Plain Text editor. The code I am using is below: {{velocity}} ##Includes for mktree$xwiki.jsfx.use('js/mktree/mktree.js')$xwiki.ssfx.use('js/mktree/mktree.css', true) ##Includes for table sort$xwiki.jsfx.use(js/xwiki/table/tablefilterNsort.js)$xwiki.ssfx.use(js/xwiki/table/table.css) ##Include for Entry Class CSS$xwiki.ssfx.use('css/entryclass.css', true) #set($objs = $doc.getObjects('Admin.EntryClass')) #set($action = $xcontext.getAction()) (% class=grid sortable doOddEven id=Entry Table %) (% class=sortHeader %)|=#|=Entry|=Entry Date #foreach($entry in $objs) |$doc.display(SortOrder, $entry)|((( (% class=mktree name=tree %) * ((( (% class=title %) =$doc.display(Title, $entry)= ))) ** ((( #if($action != view)
Re: [xwiki-users] autologin without password
You could login with a trivial password such as 'password' which is hardcoded into your end. I could help you more if you knew how your stuff will talk to XWiki. For example will it speak http like the web browser or webdav or rest? Caleb On 11/11/2011 03:54 PM, Legeinfo wrote: Hi! It is possible to login in xwiki as a user without password? I want to link from a software in my Hospital to xwiki. The only variable a have is the real-name and user-name. I think about a login via velocity script with a special admin user/password as a bridge component. Hospital system -- xwiki username foo foo admin open xwiki--- pasword -- View this message in context: http://xwiki.475771.n2.nabble.com/autologin-without-password-tp6986733p6986733.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] autologin without password
You cannot use an empty password as this is blocked in the authentication system. But as Caleb says you can use any password as long as it is set for that user. Then you can pass the username and password in the URL like the login form would Ludovic 2011/11/11 Legeinfo v...@legeinfo.net Hi! It is possible to login in xwiki as a user without password? I want to link from a software in my Hospital to xwiki. The only variable a have is the real-name and user-name. I think about a login via velocity script with a special admin user/password as a bridge component. Hospital system -- xwiki username foo foo admin open xwiki--- pasword -- View this message in context: http://xwiki.475771.n2.nabble.com/autologin-without-password-tp6986733p6986733.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] autologin without password
Thank you for replying! I can start a windows batch with %username% as a variable. I think about http://xwiki?username=fooRealname=Volker Lap... Xwiki should lookup the user. If not existing? Make a new user. If existing login. But the problem is that i have do not have a password, or only a trivial password. How to protect this kind of login process? I was thinking about a admin login (http or rest) and doing the login process for this user without password. Volker -- View this message in context: http://xwiki.475771.n2.nabble.com/autologin-without-password-tp6986733p6988722.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] autologin without password
If you're using batch files to communicate with the wiki, you can create a user by sending a request to: http://xwiki/bin/register/XWiki/Register?register_first_name=Johnregister_last_name=Smithxwikiname=jsmithregister_password=trivialregister2_password=trivialregister_email=x...@y.zz the only 3 required fields are register_password, register2_password, and xwikiname (the name of the user document, must only contain a-z, A-Z, 0-9, and _ characters) note that you will need to disable CSRF prevention tokens in the xwiki.properties file for this to work but given you are looking to register without any password, CSRF attack protection is probably not something you are looking for. then to save a page as your new user, this would be the wget command, you will need to change that for whatever http client you use. wget --user=jsmith --password=trivial http://xwiki/bin/save/Main/WebHome?basicauth=1content=HelloWorld! You can just look at the source and mimic any request you would like to with your script, you can also install firebug to watch the requests happen in real time so you can mimic them easier. Caleb On 11/12/2011 04:26 PM, Legeinfo wrote: Thank you for replying! I can start a windows batch with %username% as a variable. I think about http://xwiki?username=fooRealname=Volker Lap... Xwiki should lookup the user. If not existing? Make a new user. If existing login. But the problem is that i have do not have a password, or only a trivial password. How to protect this kind of login process? I was thinking about a admin login (http or rest) and doing the login process for this user without password. Volker -- View this message in context: http://xwiki.475771.n2.nabble.com/autologin-without-password-tp6986733p6988722.html Sent from the XWiki- Users mailing list archive at Nabble.com. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users