[xwiki-users] LivetableResults filter query
I have a Subwiki where I have created a Live Table called Active Tasks and I have been trying to filter the results based on two properties status and assignee. As defined in the TaskManagerClass, status is a database list and assignee is a list of users (local subwiki users). I have defined the live table like so: #set ($columnsProperties = { 'number': {"type":"number","size":10}, 'doc.title': {"type":"text","size":20,"link":"view"}, 'project': {"type":"list","size":10}, 'status': {"type":"list","size":10}, 'severity': {"type":"list","size":10}, 'reporter': {"type":"text","size":10,"html":true}, 'assignee': {"type":"text","size":10,"html":true}, 'duedate': {"type":"text","size":10}, '_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"]} }) #set ($options = { 'className': 'TaskManager.TaskManagerClass', 'resultPage': 'TaskManagerCode.MyActiveTasksLiveTableResults', 'translationPrefix': 'taskmanager.livetable.', 'tagCloud': true, 'rowCount': 15, 'maxPages': 10, 'selectedColumn': 'number', 'defaultOrder': 'asc' }) #set ($columns = ['number', 'doc.title', 'project', 'status', 'severity', 'reporter', 'assignee', 'duedate', '_actions']) #livetable('myActiveTasks' $columns $columnsProperties $options) In the resultPage I have the following code: {{include document="XWiki.LiveTableResultsMacros" /}} {{velocity wiki="false"}} #gridresultwithfilter("$!request.classname" $request.collist.split(",")", StringProperty as statusprop ", " and obj.id=statusprop.id.id and statusprop.id.name='status' and statusprop.value not in ('Done')" ) {{/velocity}} This successfully displays the live table and filters it showing all tasks that have a status other than "Done". I cannot however successfully get the results to also filter based on the currently logged in user. In the TaskManagerClass sheet I have set the assignee property automatically using $context.user when a new entry is made. I have tried to filter the table at the definition using the extraparams option like so: ' extraParams' : '&assignee=$context.User ', however when this is added the table does not display any entries. Upon further investigation I found that when I display what is in the $context.user, it shows as " XWiki.test " (test being the name of the user I created for testing). The strange thing is that when I change the extraParams option to be ' extraParams' : '&assignee=test ' then it works. This means that when I set the default property in the List of Users with the same function ($context.user), that it set it as test as opposed to XWiki.test. I also tried using $context.localUser in the extraParams however that also displays as XWiki.test. Does this have to do with how the "List of Users" control on the class form is storing the value from $context.user? How can I filter this live table on the currently logged in user. I have tried to add another object to my where clause in the gridreslutwithfilter() call, however I was unsuccessful. If anyone can help me out with that query or with using the extraParams I would greatly appreciate it. Regards, Kelly ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] [ANN] XWiki 5.2.3 released
The XWiki development team is proud to announce the availability of XWiki 5.2.3. This is a bugfix release fixing a security issue allowing unregistered users some access under some circumstances. We recommend anyone using XWiki 5.0+ to upgrade to it, especially if your wiki is a public wiki. You can download it here: http://www.xwiki.org/xwiki/bin/view/Main/Download Make sure to review the release notes: http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki523 Thanks -The XWiki dev team ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Problems with Facebook like Button
Hi Richard, Indeed, the { character needs to be escaped. check section 2.4.3 of the spec at http://www.ietf.org/rfc/rfc2396.txt, specifically: -- Other characters are excluded because gateways and other transport agents are known to sometimes modify such characters, or they are used as delimiters. unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`" Data corresponding to excluded characters must be escaped in order to be properly represented within a URI. -- Thanks -Vincent On 22 Jan 2014 at 14:28:42, Richard Hierlmeier (rhierlme...@googlemail.com(mailto:rhierlme...@googlemail.com)) wrote: > > Hi Vincent, > > I get the following exception: > > java.net.URISyntaxException: Illegal character in query at index 160: > http://???/bin/ref_map/Main/WebHome?fb_action_ids=22334241213413241&fb_action_types=og.likes&fb_source=feed_opengraph&action_object_map={%22334241213413241%22%3A211180592403908}&action_type_map={%22334241213413241%22%3A%22og.likes%22}&action_ref_map=[] > at java.net.URI$Parser.fail(URI.java:2829) > at java.net.URI$Parser.checkChars(URI.java:3002) > at java.net.URI$Parser.parseHierarchical(URI.java:3092) > at java.net.URI$Parser.parse(URI.java:3034) > at > > It's the { character after action_type_map. > > Do I have a character encoding problem? > > The XWiki instance is running in tomcat behind a Apache http instance. > It is connection via mod_proxy and ajp. Here is my Apache configuration: > > ProxyPreserveHost On > ProxyPass / ajp://localhost:9080/ > ProxyPassReverse / http://???/ > > Here ist the ajp connector configuration from server.conf > > > maxThreads="20" URIEncoding="UTF-8"/> > > > Thank you > > Richard > > > Am 22.01.2014 13:54, schrieb Vincent Massol: > > Hi Richard, > > > > On 21 Jan 2014, at 21:07, Richard Hierlmeier wrote: > > > >> > >> I have a Facebook like Button on my xwiki instance. When clicking on the > >> button in facebook the following link is created: > >> > >> http:///bin/view/Main/Sample?fb_action_ids=22334241213413241&fb_action_types=og.likes&fb_source=feed_opengraph&action_object_map={%22334241213413241%22%3A211180592403908}&action_type_map={%22334241213413241%22%3A%22og.likes%22}&action_ref_map=[] > >> > >> However XWiki can not handle this link correctly. When clicking on it I > >> get the following error message (it's in german language): > >> > >>> Hinweis > >>> > >>> Während der Verarbeitung Ihrer Anfrage trat ein Problem auf. Bitte > >>> verständigen Sie den Webmaster, falls der Fehler erneut auftritt. > >> > >> How can I solve this problem? > > > > I don’t see any reason why XWiki would care about anything put after the ? > > unless it contains a parameter that xwiki uses (like “rev”). > > > > What error do you get in the xwiki logs? > > > > Thanks > > -Vincent > > > > ___ > > 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 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Problems with Facebook like Button
Hi Vincent, I get the following exception: java.net.URISyntaxException: Illegal character in query at index 160: http://???/bin/ref_map/Main/WebHome?fb_action_ids=22334241213413241&fb_action_types=og.likes&fb_source=feed_opengraph&action_object_map={%22334241213413241%22%3A211180592403908}&action_type_map={%22334241213413241%22%3A%22og.likes%22}&action_ref_map=[] at java.net.URI$Parser.fail(URI.java:2829) at java.net.URI$Parser.checkChars(URI.java:3002) at java.net.URI$Parser.parseHierarchical(URI.java:3092) at java.net.URI$Parser.parse(URI.java:3034) at It's the { character after action_type_map. Do I have a character encoding problem? The XWiki instance is running in tomcat behind a Apache http instance. It is connection via mod_proxy and ajp. Here is my Apache configuration: ProxyPreserveHost On ProxyPass / ajp://localhost:9080/ ProxyPassReverse / http://???/ Here ist the ajp connector configuration from server.conf maxThreads="20" URIEncoding="UTF-8"/> Thank you Richard Am 22.01.2014 13:54, schrieb Vincent Massol: Hi Richard, On 21 Jan 2014, at 21:07, Richard Hierlmeier wrote: I have a Facebook like Button on my xwiki instance. When clicking on the button in facebook the following link is created: http:///bin/view/Main/Sample?fb_action_ids=22334241213413241&fb_action_types=og.likes&fb_source=feed_opengraph&action_object_map={%22334241213413241%22%3A211180592403908}&action_type_map={%22334241213413241%22%3A%22og.likes%22}&action_ref_map=[] However XWiki can not handle this link correctly. When clicking on it I get the following error message (it's in german language): Hinweis Während der Verarbeitung Ihrer Anfrage trat ein Problem auf. Bitte verständigen Sie den Webmaster, falls der Fehler erneut auftritt. How can I solve this problem? I don’t see any reason why XWiki would care about anything put after the ? unless it contains a parameter that xwiki uses (like “rev”). What error do you get in the xwiki logs? Thanks -Vincent ___ 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] Problems with Facebook like Button
Hi Richard, On 21 Jan 2014, at 21:07, Richard Hierlmeier wrote: > > I have a Facebook like Button on my xwiki instance. When clicking on the > button in facebook the following link is created: > > http:///bin/view/Main/Sample?fb_action_ids=22334241213413241&fb_action_types=og.likes&fb_source=feed_opengraph&action_object_map={%22334241213413241%22%3A211180592403908}&action_type_map={%22334241213413241%22%3A%22og.likes%22}&action_ref_map=[] > > However XWiki can not handle this link correctly. When clicking on it I get > the following error message (it's in german language): > > > Hinweis > > > > Während der Verarbeitung Ihrer Anfrage trat ein Problem auf. Bitte > > verständigen Sie den Webmaster, falls der Fehler erneut auftritt. > > How can I solve this problem? I don’t see any reason why XWiki would care about anything put after the ? unless it contains a parameter that xwiki uses (like “rev”). What error do you get in the xwiki logs? Thanks -Vincent ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Search stops working in LiveTable with custom JSON results page after few characters entered
On Mon, Jan 13, 2014 at 10:29 PM, Valdis Vītoliņš wrote: > As LiveTable is document oriented and cant show several objects attached > to the document, I have created customized JSON page > following to guide in > http://platform.xwiki.org/xwiki/bin/view/DevGuide/LiveTable > > It even works for document name and space. > > But for other fields filtering stops working after 1-2 characters are > entered. I suspect it is somehow related to AJAX requests which send > partial data, because it works with get request > /xwiki/bin/view/NMPDtools/ParticipantsJSONlivetable?firstname=Uldis If it works fine when you access this URL separately, then I'd check the requests that are made by the live table. Maybe it uses a different URL. You can do this with most of the browser developer tools. Hope this helps, Marius > > Any suggestions? > Thanks! > > = LiveTable page = > {{velocity}} > #set($columns = [ "doc.name", > "doc.space" ,"firstname" ,"lastname" ,"personid" ,"certid" ]) > #set($columnsProperties = { > "doc.name" : { "type" : "text", "link" : "view", "size" : "10", > "filterable" : true, "sortable": true, "displayName" : "Kurss" }, > "firstname" : { "type" : "text", "size" : 10, "filterable" : true, > "sortable": true }, > "lastname" : { "type" : "text", "size" : 10, "filterable" : true, > "sortable": true }, > "personid" : { "type" : "text", "size" : 10, "filterable" : true, > "sortable": true }, > "certid" : { "type" : "text", "size" : 10, "filterable" : true, > "sortable": true }, > "doc.space" : { "type" : "text", "size" : "10", "filterable" : > true, "sortable": true, "displayName" : "Organizācija" } > }) > > #set($options = { > "className":"NMPDtools.ParticipantClass", > "translationPrefix" : "livetable.", > "tagCloud" : true, > "rowCount": 15, > "maxPages" : 10, > "selectedColumn" : "doc.title", > "defaultOrder" : "asc", > "resultPage":"NMPDtools.ParticipantsJSONlivetable" > }) > > #livetable("participant" $columns $columnsProperties $options) > {{/velocity}} > > = JSON results page = > > {{velocity filter="html" wiki="false"}} > #if($xcontext.action == 'get' && "$!{request.outputSyntax}" == 'plain') > $response.setContentType('application/json') > #end > ## Offset = item # at which to start displaying data > #set($offset = $util.parseInt($request.get('offset'))) > ## offset starts from 0 in velocity and 1 in javascript > #set($offset = $offset - 1) > #if($offset < 0) > #set($offset = 0) > #end > ## Limit = # of items to display > #set($limit = $util.parseInt($request.get('limit'))) > ## Sort direction > #set($order = "$!request.sort") > #if($order != '') > #set($orderDirection = "$!{request.get('dir').toLowerCase()}") > #if("$!orderDirection" != '' && "$!orderDirection" != 'asc') >#set($orderDirection = 'desc') > #end > #end > ## > #set($doc_space=$request.getParameter('doc.space')) > #set($doc_name=$request.getParameter('doc.name')) > #set($firstname=$request.getParameter('firstname')) > #set($lastname=$request.getParameter('lastname')) > #set($personid=$request.getParameter('personid')) > #set($certid=$request.getParameter('certid')) > ## > #set($hql="select doc.fullName, personid.id.value from XWikiDocument > doc, BaseObject as obj, StringProperty firstname, StringProperty > lastname, StringProperty personid where doc.fullName=obj.name and > obj.className='NMPDtools.ParticipantClass' and obj.id=firstname.id.id > and firstname.id.name='firstname' and obj.id=lastname.id.id and > lastname.id.name='lastname' and obj.id=personid.id.id and > personid.id.name='personid'") > ## > #if($doc_name && $doc_name!='') > #set($hql="$hql and doc.name like '${doc_name}%'") > #end > #if($doc_space && $doc_space!='') > #set($hql="$hql and doc.space like '${doc_space}%'") > #end > #if($firstname && $firstname!='') > #set($hql="$hql and firstname.id.value like '${firstname}%'") > #end > #if($lastname && $lastname!='') > #set($hql="$hql and lastname.id.value like '${lastname}%'") > #end > #if($personid && $personid!='') > #set($hql="$hql and personid.id.value like '${personid}%'") > #end > ## > ##$hql > #set($results = > $services.query.hql($hql).setLimit($limit).setOffset($offset).execute()) > { > "totalrows":$results.size(), > "matchingtags": {}, > "tags" : [], > "returnedrows": $limit, > "offset": $offset, > "reqNo": $numbertool.integer($request.reqNo), > "rows": [ > #foreach($item in $results) > #set($partdoc=$xwiki.getDocument($item[0])) > #if($partdoc.hasAccessLevel('view')) > #set($partobj= > $partdoc.getObject('NMPDtools.ParticipantClass','personid',$item[1])) > $!d {"doc_viewable" : true, > "doc_name":"$partdoc.name", > "doc_url":"$xwiki.getURL($item[0])", > "doc_space":"$partdoc.space", > "firstname":"$partobj.firstname", > "lastname":"$partobj.lastname", > "personid":"$partobj.personid", > "certid":"$partobj.certid" > } > #if(!$d)#set($d=',')#end > #end > #end > ] > } > {{/velocity}} > > > > ___ > users mailing list > us
Re: [xwiki-users] Class sheet for mixing unstructured and structured content
If you only want to display the content then a sheet like this should do the trick: {{velocity}} #set ($object = $doc.getObject('Space.YourClass')) #if ($object) ## Display object properties here (i.e. what you have right now) ... ## Display the document content. {{include reference="$doc.documentReference" /}} #else This is a sheet for Space.YourClass #end {{/velocity}} If you also want to edit the document content from Inline Form edit mode then you have two options: (1) generate a text area and load the right editor (Wiki/WYSIWYG) when $xcontext.action == 'edit' or (2) follow what AppWithinMinutes does when you add the "Content" field to the sheet/class (i.e. use computed field with custom display). In case you haven't done it yet, you should read http://extensions.xwiki.org/xwiki/bin/view/Extension/Sheet+Module . Hope this helps, Marius On Sun, Jan 12, 2014 at 11:19 PM, Nicolas Jouanin wrote: > Hi, > > I’m experiencing custom class and object creation. I’ve read xwiki > developer’s documentation to create a class and a sheet, with default > content. Now I create some Test document and an attached object (of type the > class I created) . The document content corresponds to the sheet content. > Now if I add some content to Test page using the wysiwyg editor, this content > is not displayed. Only the sheet content is displayed. Is there a may to mix, > on page, the content of the class sheet applied to object, and the Page > content ? > > Regards, > ___ > 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