Livetable

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Livetable

Frantisek Kall
Hi,

I created new data type (class, sheet, template document) and I created  several documents of this type. Then I created document with livetable macro to list documents in table format. All is working well,  but first row in table is template document.
How can I filter template document from table?

Any help appreciated

Regards

Frantisek
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Jerome Velociter
Hello Frantisek,

What version of XWiki are you using ?

Also, what is the exact name of your template document ?
In at least recent (2.1+) versions of XWiki, the JSON sources filters on
document with name ${className}Template ; so if your class is
MySpace.MyClass, then MySpace.MyClassTemplate should not appear in
livetable results.

See
http://svn.xwiki.org/svnroot/xwiki/enterprise/trunk/wiki/src/main/resources/XWiki/LiveTableResultsMacros.xml
:

#if("$!className" != "")
  #set(${...Sql = ", [snip] and doc.fullName <> '${className}Template'
[snip]")
...

Hope this helps,

Regards,
Jerome.



>
> Hi,
>
> I created new data type (class, sheet, template document) and I created
> several documents of this type. Then I created document with livetable
> macro
> to list documents in table format. All is working well,  but first row in
> table is template document.
> How can I filter template document from table?
>
> Any help appreciated
>
> Regards
>
> Frantisek
> --
> View this message in context:
> http://n2.nabble.com/Livetable-tp4744002p4744002.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>


_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Frantisek Kall
Hello Jerome,

thanks for answer.

Now we have 2.2.M1 version running. The name of class is XWiki.SLMClass and template name is  XWiki.SLMTemplate.
We will upgrade to 2.2.2 soon, then I will try livetable again and I will write you if problem persist.

Regards

Frantisek
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Frantisek Kall
In reply to this post by Jerome Velociter
Hello Jerome

We upgraded XWiki to version 2.2.2. I didn't change anything but now I have opposite problem, no one  document is in livetable.

I have "TestClass" in "TestSpace", template is "TestTemplate" in TestSpace.

Class properties for TestClass  
ID (ID: Number)
Servis Name (Name: String)
Servis Description (Description: TextArea)
Servis Manager (Manager: Static List)

Script for livetable:
 
{{velocity}}
#set($columns = ["ID", "Name", "Description", "Manager"])
#set($columnsProperties = {
                   "ID" : { "type" : "number" },
                   "Name" : { "type" : "text"},
                   "Description" : { "type" : "text" },
                   "Manager" : { "type" : "list"}
})
#set($options = {
                  "className":"TestSpace.TestClass",
                  "rowCount": 15
                  })
#livetable("Catalog" $columns $columnsProperties $options)
{{/velocity}}

I created two TestClass type documents in TestSpace (I can see them in TestSpace.TestClass page), but page with livetable script has only header row.
Same script in 2.1.M1 version created table with header + rows with documents and Template document too.

Any idea what I do wrong?


Regards

Frantisek
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

jerem
There is an issue in 2.2 when sorting on a non-string property (see
http://jira.xwiki.org/jira/browse/XWIKI-4973).
As you don't specify a sort column, I think it sorts on first column wich is
a Number, and so livetable is empty ...

Waiting for 2.2.3 release, you can try this workaround : add
"class":"TestSpace.TestClass" for each column in $columnsProperties

Hope this helps,
Jeremie

2010/3/18 Frantisek Kall <[hidden email]>

>
> Hello Jerome
>
> We upgraded XWiki to version 2.2.2. I didn't change anything but now I have
> opposite problem, no one  document is in livetable.
>
> I have "TestClass" in "TestSpace", template is "TestTemplate" in TestSpace.
>
> Class properties for TestClass
> ID (ID: Number)
> Servis Name (Name: String)
> Servis Description (Description: TextArea)
> Servis Manager (Manager: Static List)
>
> Script for livetable:
>
> {{velocity}}
> #set($columns = ["ID", "Name", "Description", "Manager"])
> #set($columnsProperties = {
>                   "ID" : { "type" : "number" },
>                   "Name" : { "type" : "text"},
>                   "Description" : { "type" : "text" },
>                   "Manager" : { "type" : "list"}
> })
> #set($options = {
>                  "className":"TestSpace.TestClass",
>                  "rowCount": 15
>                  })
> #livetable("Catalog" $columns $columnsProperties $options)
> {{/velocity}}
>
> I created two TestClass type documents in TestSpace (I can see them in
> TestSpace.TestClass page), but page with livetable script has only header
> row.
> Same script in 2.1.M1 version created table with header + rows with
> documents and Template document too.
>
> Any idea what I do wrong?
>
>
> Regards
>
> Frantisek
> --
> View this message in context:
> http://n2.nabble.com/Livetable-tp4744002p4756208.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Frantisek Kall
Hello Jeremie

Thanks for help.
I tried you advice me, but it still doesn't work. Livetable is always empty.
I also noticed that livetable used in "Document Index (Xwiki.Tableview)" is also empty.
It looks as some 2.2.2 version problem (or xwiki setting in our wiki).
 
I also tested some XWIKI ENTERPRISE 2.2.2.27483 versions (I searched them on internet by Google)
I found that some has same problem (http://aswjrevesby.org/xwiki/bin/view/Main/AllDocs?view=index)  - document index livetable  is empty, but other (http://www.imanquest.org/xwiki/bin/view/XWiki/Tableview) are OK.

Can anybody confirm that?

Frantisek
   
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Sergiu Dumitriu-2
On 03/18/2010 08:57 PM, Frantisek Kall wrote:

>
> Hello Jeremie
>
> Thanks for help.
> I tried you advice me, but it still doesn't work. Livetable is always empty.
> I also noticed that livetable used in "Document Index (Xwiki.Tableview)" is
> also empty.
> It looks as some 2.2.2 version problem (or xwiki setting in our wiki).
>
> I also tested some XWIKI ENTERPRISE 2.2.2.27483 versions (I searched them on
> internet by Google)
> I found that some has same problem
> (http://aswjrevesby.org/xwiki/bin/view/Main/AllDocs?view=index)  - document
> index livetable  is empty, but other
> (http://www.imanquest.org/xwiki/bin/view/XWiki/Tableview) are OK.
>
> Can anybody confirm that?

Could you try the new 2.2.3 version and see if it works here? Don't
forget to import the new livetable documents, most importantly
XWiki.LiveTableResultsMacros

--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Roman Muntyanu
In reply to this post by Frantisek Kall
Hi,

 I had the same problem (index page empty after upgrade) several days ago.
 The upgrade was from XWiki Enterprise 2.1.2 to 2.2.2. It turned out that we forgot to upgrade the system documents in addition to war upgrade. So in my case re-importing pages from xwiki-enterprise-wiki-2.2.2.xar file solved the problem.

 Some useful links:
    * Upgrading XWiki Documents
    * Download page where you can find corresponding *.xar file (I believe you'd have to upgrade to v2.2.3 now)

 Hope this helps.

  Regards,
Roman
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Frantisek Kall
Hi Roman, hi Sergiu

thanks for your help.

As Roman wrote, our problem was with system documents.
First we upgraded from 2.1.M1 to 2.2.2  (we upgraded only core, not documents from default xar) - livetable didn't work well, index page was empty, also page with livetable for "TestClass" was empty.
Then we upgraded from 2.2.2 to 2.2.3 - same result.
Then I imported documents from default xar for version 2.2.3 (I imported all documents but -  XWiki.XWikiPreferences,  XWiki.WebPreferences, XWiki.XWikiAllGroup, XWiki.XWikiAdminGroup)

Problem with empty index page was solved. Index page work well, but with livetable for "TestClass" I had same problem I have had before. There was still row for template document in livetable.

Class name is "TestClass", template is "TestTemplate" (it is default name for template).
When you are creating class with name Test suffix Class is added, but not for template.

Filter in LiveTableResultsMacros is ... doc.fullName<>'${className}Template ...

When I renamed "TestTemplate" to "TestClassTemplate" livetable started work well,  template document in livetable for TestClass is filtered.

I assume it is an issue, should I raise Jira issue for  it?

Also if there is a column for TextArea type property in a livetable, table is empty, but maybe it is a feature not issue.

Regards,

Frantisek
 
Reply | Threaded
Open this post in threaded view
|

Re: Livetable

Sergiu Dumitriu-2
On 03/24/2010 03:07 PM, Frantisek Kall wrote:

>
> Hi Roman, hi Sergiu
>
> thanks for your help.
>
> As Roman wrote, our problem was with system documents.
> First we upgraded from 2.1.M1 to 2.2.2  (we upgraded only core, not
> documents from default xar) - livetable didn't work well, index page was
> empty, also page with livetable for "TestClass" was empty.
> Then we upgraded from 2.2.2 to 2.2.3 - same result.
> Then I imported documents from default xar for version 2.2.3 (I imported all
> documents but -  XWiki.XWikiPreferences,  XWiki.WebPreferences,
> XWiki.XWikiAllGroup, XWiki.XWikiAdminGroup)

You should take care of XWiki.Admin, since you imported it (change the
password).

> Problem with empty index page was solved. Index page work well, but with
> livetable for "TestClass" I had same problem I have had before. There was
> still row for template document in livetable.
>
> Class name is "TestClass", template is "TestTemplate" (it is default name
> for template).
> When you are creating class with name Test suffix Class is added, but not
> for template.
>
> Filter in LiveTableResultsMacros is ... doc.fullName<>'${className}Template
> ...
>
> When I renamed "TestTemplate" to "TestClassTemplate" livetable started work
> well,  template document in livetable for TestClass is filtered.
>
> I assume it is an issue, should I raise Jira issue for  it?

Yes, please.

> Also if there is a column for TextArea type property in a livetable, table
> is empty, but maybe it is a feature not issue.

This should have been fixed...

--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users