TOC macro

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

TOC macro

pinkerp
Is there a way to specify a particular page within the TOC macro.  I
want to use the TOC in one page, generating it for a secondary page - so
my TOC and my content end up being separate pages.

 

 

Paul Pinkerton

KnowledgeNow Project Lead

[hidden email] <mailto:[hidden email]>

 

Association of Community Legal Clinics of Ontario

416-847-1418 or 1-866-965-1416x 5177

www.aclco.org <http://www.aclco.org>  

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

Re: TOC macro

vmassol
Administrator
Hi Paul,

On Aug 15, 2013, at 10:48 PM, Paul Pinkerton (ACLCO) <[hidden email]> wrote:

> Is there a way to specify a particular page within the TOC macro.  I
> want to use the TOC in one page, generating it for a secondary page - so
> my TOC and my content end up being separate pages.

Not exactly sure what you mean.

If you have the following content:

"
{{toc/}}

{{include reference="page2"/}}
"

Then it'll work fine since the include macro has a higher priority than the TOC macro (which has a very low priority so that it executes last).

See also http://jira.xwiki.org/browse/XRENDERING-240

Thanks
-Vincent

> Paul Pinkerton
>
> KnowledgeNow Project Lead
>
> [hidden email] <mailto:[hidden email]>
>
>
>
> Association of Community Legal Clinics of Ontario
>
> 416-847-1418 or 1-866-965-1416x 5177
>
> www.aclco.org <http://www.aclco.org>  

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

Re: TOC macro

Hamster
Vincent,

I believe he means this:

He has got two pages, page A and page B.
Page B has all the content (text, pictures, headers, etc.)
He wants to add a TOC to page A, which will show the TOC of page B (not page A).
Reply | Threaded
Open this post in threaded view
|

Re: TOC macro

Hamster
Vincent,

Where is the (original) TOC macro located? I can't find it... :-(
Reply | Threaded
Open this post in threaded view
|

Re: TOC macro

vmassol
Administrator

On Aug 30, 2013, at 7:58 AM, Hamster <[hidden email]> wrote:

> Vincent,
>
> Where is the (original) TOC macro located? I can't find it... :-(

I have no idea what you call the "original" TOC macro…

Do you mean http://extensions.xwiki.org/xwiki/bin/view/Extension/TOC+Macro ?

Thanks
-Vincent

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

Re: TOC macro

Hamster
I guess that's the one...

In which space/page is the TOC macro stored?
Where can I edit the contens of the TOC macro?
Reply | Threaded
Open this post in threaded view
|

Re: TOC macro

vmassol
Administrator

On Aug 30, 2013, at 5:07 PM, Hamster <[hidden email]> wrote:

> I guess that's the one...
>
> In which space/page is the TOC macro stored?
> Where can I edit the contens of the TOC macro?

It's not a wiki macro, it's a macro in java… As you can see on http://extensions.xwiki.org/xwiki/bin/view/Extension/TOC+Macro the type is "JAR". For wiki macros the type is "XAR".

You can read to understand better macro development if you're interested:
http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingMacros

Thanks
-Vincent

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

Information Organization Challenge

Danilo Amaral de Oliveira
Hello People,

How are you?

I am creating a new wiki that will support 2 kind of documents - the default (empty page) and a ProcedureClass (procedure template).
Each space in the wiki will contain the two kinds of documents and I want to show them separately in the Webhome. Then if I enter in space A, the webhome will show two list of documents, the default and the Procedures.

My idea is to build 2 livetable in the webhome page in each space. The first livetable will contain the Default Documents and the second one will contain the procedures documents of that space.
I could build the livetable of the class document with the code below, BUT I couldn't think in a way to build a livetable to show only the "default documents(pages)" because I couldn't identify if the default document has a unique class like the procedure (ProcedimentoOperacionalClass).

Anyone has some suggestion?

{{velocity}}
#set ($columnsProperties = {
  'doc.title': {"type":"text","size":20,"link":"view"},
  'doc.author': {"type":"text","size":10,"link":"author"}
})

#set ($options = {
  'className': 'XWiki.ProcedimentoOperacionalClass',
  'resultPage': 'XWiki.LiveTableResults',
  'rowCount': 15,
  'maxPages': 10,  
  'selectedColumn': 'doc.title',
  'defaultOrder': 'asc',
  'extraParams' : '&space=Reles'
})
#set ($columns = ['doc.title', 'doc.author'])
#livetable('bug' $columns $columnsProperties $options)
{{/velocity}}

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

Re: Information Organization Challenge

vmassol
Administrator
H Danilo,

If I understand correctly you wish to have a livetable with some documents except for some which have a given xobject.

See http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro#HFilterorganizationsbydomain

Thanks
-Vincent

On Aug 31, 2013, at 12:03 AM, Danilo Amaral de Oliveira <[hidden email]> wrote:

> Hello People,
>
> How are you?
>
> I am creating a new wiki that will support 2 kind of documents - the default (empty page) and a ProcedureClass (procedure template).
> Each space in the wiki will contain the two kinds of documents and I want to show them separately in the Webhome. Then if I enter in space A, the webhome will show two list of documents, the default and the Procedures.
>
> My idea is to build 2 livetable in the webhome page in each space. The first livetable will contain the Default Documents and the second one will contain the procedures documents of that space.
> I could build the livetable of the class document with the code below, BUT I couldn't think in a way to build a livetable to show only the "default documents(pages)" because I couldn't identify if the default document has a unique class like the procedure (ProcedimentoOperacionalClass).
>
> Anyone has some suggestion?
>
> {{velocity}}
> #set ($columnsProperties = {
>  'doc.title': {"type":"text","size":20,"link":"view"},
>  'doc.author': {"type":"text","size":10,"link":"author"}
> })
>
> #set ($options = {
>  'className': 'XWiki.ProcedimentoOperacionalClass',
>  'resultPage': 'XWiki.LiveTableResults',
>  'rowCount': 15,
>  'maxPages': 10,  
>  'selectedColumn': 'doc.title',
>  'defaultOrder': 'asc',
>  'extraParams' : '&space=Reles'
> })
> #set ($columns = ['doc.title', 'doc.author'])
> #livetable('bug' $columns $columnsProperties $options)
> {{/velocity}}
>
> Thank you,
> Danilo
> _______________________________________________
> 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
|

RES: Information Organization Challenge

Danilo Amaral de Oliveira
Exactly Vincent.

I want to show the table with the documents of a specific space except the documents based on the "ProcedimentoOperacionalClass"
I wrote the following code below but the search is returning 0 results.:

Livetable page:
{{velocity}}
#set($collist = ["doc.name","doc.date", "doc.author"])
#set($colprops = {
                  "doc.name" : { "type" : "text" , "size" : 30, "link" : "view"},
                  "doc.date" : { "type" : "date" },
                  "doc.author" : { "type" : "text", "link" : "author"}
                  })
#set($options = {
                "resultPage":"Reles.gridFilterJSON",
                 "translationPrefix" : "xe.index.",
                 "rowCount": 15 })
#livetable("alldocs" $collist $colprops $options)

#set($showLeftPanels = 0)
#set($showRightPanels = 0)
{{/velocity}}

JSONpage:
{{include document="XWiki.LiveTableResultsMacros" /}}

{{velocity wiki="false"}}
#gridresultwithfilter($request.classname $request.collist.split(",") "", "  and doc.space='Reles' and doc.name <> 'WebHome' and doc.name <> 'WebPreferences' and doc.className <> 'ProcedimentoOperacionalClass'")
{{/velocity}}

In the fact, I don't know exactly how to get the class of a specific document to compare the value.
Is Anyone know how to get the class of a specific object?

Thank you.
Danilo

-----Mensagem original-----
De: [hidden email] [mailto:[hidden email]] Em nome de Vincent Massol
Enviada em: sábado, 31 de agosto de 2013 06:12
Para: XWiki Users
Assunto: Re: [xwiki-users] Information Organization Challenge

H Danilo,

If I understand correctly you wish to have a livetable with some documents except for some which have a given xobject.

See http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro#HFilterorganizationsbydomain

Thanks
-Vincent

On Aug 31, 2013, at 12:03 AM, Danilo Amaral de Oliveira <[hidden email]> wrote:

> Hello People,
>
> How are you?
>
> I am creating a new wiki that will support 2 kind of documents - the default (empty page) and a ProcedureClass (procedure template).
> Each space in the wiki will contain the two kinds of documents and I want to show them separately in the Webhome. Then if I enter in space A, the webhome will show two list of documents, the default and the Procedures.
>
> My idea is to build 2 livetable in the webhome page in each space. The first livetable will contain the Default Documents and the second one will contain the procedures documents of that space.
> I could build the livetable of the class document with the code below, BUT I couldn't think in a way to build a livetable to show only the "default documents(pages)" because I couldn't identify if the default document has a unique class like the procedure (ProcedimentoOperacionalClass).
>
> Anyone has some suggestion?
>
> {{velocity}}
> #set ($columnsProperties = {
>  'doc.title': {"type":"text","size":20,"link":"view"},
>  'doc.author': {"type":"text","size":10,"link":"author"}
> })
>
> #set ($options = {
>  'className': 'XWiki.ProcedimentoOperacionalClass',
>  'resultPage': 'XWiki.LiveTableResults',
>  'rowCount': 15,
>  'maxPages': 10,
>  'selectedColumn': 'doc.title',
>  'defaultOrder': 'asc',
>  'extraParams' : '&space=Reles'
> })
> #set ($columns = ['doc.title', 'doc.author']) #livetable('bug'
> $columns $columnsProperties $options) {{/velocity}}
>
> Thank you,
> Danilo
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users

_______________________________________________
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: RES: Information Organization Challenge

Marius Dumitru Florea
On Mon, Sep 2, 2013 at 5:32 PM, Danilo Amaral de Oliveira
<[hidden email]> wrote:

> Exactly Vincent.
>
> I want to show the table with the documents of a specific space except the documents based on the "ProcedimentoOperacionalClass"
> I wrote the following code below but the search is returning 0 results.:
>
> Livetable page:
> {{velocity}}
> #set($collist = ["doc.name","doc.date", "doc.author"])
> #set($colprops = {
>                   "doc.name" : { "type" : "text" , "size" : 30, "link" : "view"},
>                   "doc.date" : { "type" : "date" },
>                   "doc.author" : { "type" : "text", "link" : "author"}
>                   })
> #set($options = {
>                 "resultPage":"Reles.gridFilterJSON",
>                  "translationPrefix" : "xe.index.",
>                  "rowCount": 15 })
> #livetable("alldocs" $collist $colprops $options)
>
> #set($showLeftPanels = 0)
> #set($showRightPanels = 0)
> {{/velocity}}
>
> JSONpage:
> {{include document="XWiki.LiveTableResultsMacros" /}}
>
> {{velocity wiki="false"}}

> #gridresultwithfilter($request.classname $request.collist.split(",") "", "  and doc.space='Reles' and doc.name <> 'WebHome' and doc.name <> 'WebPreferences' and doc.className <> 'ProcedimentoOperacionalClass'")

replace doc.className <> 'ProcedimentoOperacionalClass' with:

doc.fullName not in (select doc.fullName from XWikiDocument doc,
BaseObject as obj where doc.fullName = obj.name and obj.className =
'SpaceName.ProcedimentoOperacionalClass')

and replace "SpaceName" with the space were
ProcedimentoOperacionalClass is located.

> {{/velocity}}
>

> In the fact, I don't know exactly how to get the class of a specific document to compare the value.
> Is Anyone know how to get the class of a specific object?

You're mixing things. A class is defined by a single document (e.g.
ProcedimentoOperacionalClass, ProcedureClass). You can view it as a
data type. And you can have 0 or more documents that have objects of
that type (i.e. instances of that class). More over documents can have
multiple objects of different types. So something like "doc.className
<> 'ProcedimentoOperacionalClass'" doesn't make sense unless you want
to exclude the document that defines the class, but I think you want
to exclude the documents that have objects of that type
(ProcedimentoOperacionalClass).

Hope this helps,
Marius

>
> Thank you.
> Danilo
>
> -----Mensagem original-----
> De: [hidden email] [mailto:[hidden email]] Em nome de Vincent Massol
> Enviada em: sábado, 31 de agosto de 2013 06:12
> Para: XWiki Users
> Assunto: Re: [xwiki-users] Information Organization Challenge
>
> H Danilo,
>
> If I understand correctly you wish to have a livetable with some documents except for some which have a given xobject.
>
> See http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro#HFilterorganizationsbydomain
>
> Thanks
> -Vincent
>
> On Aug 31, 2013, at 12:03 AM, Danilo Amaral de Oliveira <[hidden email]> wrote:
>
>> Hello People,
>>
>> How are you?
>>
>> I am creating a new wiki that will support 2 kind of documents - the default (empty page) and a ProcedureClass (procedure template).
>> Each space in the wiki will contain the two kinds of documents and I want to show them separately in the Webhome. Then if I enter in space A, the webhome will show two list of documents, the default and the Procedures.
>>
>> My idea is to build 2 livetable in the webhome page in each space. The first livetable will contain the Default Documents and the second one will contain the procedures documents of that space.
>> I could build the livetable of the class document with the code below, BUT I couldn't think in a way to build a livetable to show only the "default documents(pages)" because I couldn't identify if the default document has a unique class like the procedure (ProcedimentoOperacionalClass).
>>
>> Anyone has some suggestion?
>>
>> {{velocity}}
>> #set ($columnsProperties = {
>>  'doc.title': {"type":"text","size":20,"link":"view"},
>>  'doc.author': {"type":"text","size":10,"link":"author"}
>> })
>>
>> #set ($options = {
>>  'className': 'XWiki.ProcedimentoOperacionalClass',
>>  'resultPage': 'XWiki.LiveTableResults',
>>  'rowCount': 15,
>>  'maxPages': 10,
>>  'selectedColumn': 'doc.title',
>>  'defaultOrder': 'asc',
>>  'extraParams' : '&space=Reles'
>> })
>> #set ($columns = ['doc.title', 'doc.author']) #livetable('bug'
>> $columns $columnsProperties $options) {{/velocity}}
>>
>> Thank you,
>> Danilo
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> 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
|

RES: RES: Information Organization Challenge

Danilo Amaral de Oliveira
Great Marius!

You are right, I was mistaking the class concept.
To me, I was understanding that if I create an object based on a class template then the "classname property" of the object would be the "class name template".

Now it is working.
Thank you a lot, more one time.

Sincerely,
Danilo Oliveira

-----Mensagem original-----
De: [hidden email] [mailto:[hidden email]] Em nome de Marius Dumitru Florea
Enviada em: terça-feira, 3 de setembro de 2013 06:54
Para: XWiki Users
Assunto: Re: [xwiki-users] RES: Information Organization Challenge

On Mon, Sep 2, 2013 at 5:32 PM, Danilo Amaral de Oliveira <[hidden email]> wrote:

> Exactly Vincent.
>
> I want to show the table with the documents of a specific space except the documents based on the "ProcedimentoOperacionalClass"
> I wrote the following code below but the search is returning 0 results.:
>
> Livetable page:
> {{velocity}}
> #set($collist = ["doc.name","doc.date", "doc.author"]) #set($colprops
> = {
>                   "doc.name" : { "type" : "text" , "size" : 30, "link" : "view"},
>                   "doc.date" : { "type" : "date" },
>                   "doc.author" : { "type" : "text", "link" : "author"}
>                   })
> #set($options = {
>                 "resultPage":"Reles.gridFilterJSON",
>                  "translationPrefix" : "xe.index.",
>                  "rowCount": 15 })
> #livetable("alldocs" $collist $colprops $options)
>
> #set($showLeftPanels = 0)
> #set($showRightPanels = 0)
> {{/velocity}}
>
> JSONpage:
> {{include document="XWiki.LiveTableResultsMacros" /}}
>
> {{velocity wiki="false"}}

> #gridresultwithfilter($request.classname $request.collist.split(",")
> "", "  and doc.space='Reles' and doc.name <> 'WebHome' and doc.name <>
> 'WebPreferences' and doc.className <> 'ProcedimentoOperacionalClass'")

replace doc.className <> 'ProcedimentoOperacionalClass' with:

doc.fullName not in (select doc.fullName from XWikiDocument doc, BaseObject as obj where doc.fullName = obj.name and obj.className =
'SpaceName.ProcedimentoOperacionalClass')

and replace "SpaceName" with the space were ProcedimentoOperacionalClass is located.

> {{/velocity}}
>

> In the fact, I don't know exactly how to get the class of a specific document to compare the value.
> Is Anyone know how to get the class of a specific object?

You're mixing things. A class is defined by a single document (e.g.
ProcedimentoOperacionalClass, ProcedureClass). You can view it as a data type. And you can have 0 or more documents that have objects of that type (i.e. instances of that class). More over documents can have multiple objects of different types. So something like "doc.className <> 'ProcedimentoOperacionalClass'" doesn't make sense unless you want to exclude the document that defines the class, but I think you want to exclude the documents that have objects of that type (ProcedimentoOperacionalClass).

Hope this helps,
Marius

>
> Thank you.
> Danilo
>
> -----Mensagem original-----
> De: [hidden email] [mailto:[hidden email]] Em nome
> de Vincent Massol Enviada em: sábado, 31 de agosto de 2013 06:12
> Para: XWiki Users
> Assunto: Re: [xwiki-users] Information Organization Challenge
>
> H Danilo,
>
> If I understand correctly you wish to have a livetable with some documents except for some which have a given xobject.
>
> See
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro#H
> Filterorganizationsbydomain
>
> Thanks
> -Vincent
>
> On Aug 31, 2013, at 12:03 AM, Danilo Amaral de Oliveira <[hidden email]> wrote:
>
>> Hello People,
>>
>> How are you?
>>
>> I am creating a new wiki that will support 2 kind of documents - the default (empty page) and a ProcedureClass (procedure template).
>> Each space in the wiki will contain the two kinds of documents and I want to show them separately in the Webhome. Then if I enter in space A, the webhome will show two list of documents, the default and the Procedures.
>>
>> My idea is to build 2 livetable in the webhome page in each space. The first livetable will contain the Default Documents and the second one will contain the procedures documents of that space.
>> I could build the livetable of the class document with the code below, BUT I couldn't think in a way to build a livetable to show only the "default documents(pages)" because I couldn't identify if the default document has a unique class like the procedure (ProcedimentoOperacionalClass).
>>
>> Anyone has some suggestion?
>>
>> {{velocity}}
>> #set ($columnsProperties = {
>>  'doc.title': {"type":"text","size":20,"link":"view"},
>>  'doc.author': {"type":"text","size":10,"link":"author"}
>> })
>>
>> #set ($options = {
>>  'className': 'XWiki.ProcedimentoOperacionalClass',
>>  'resultPage': 'XWiki.LiveTableResults',
>>  'rowCount': 15,
>>  'maxPages': 10,
>>  'selectedColumn': 'doc.title',
>>  'defaultOrder': 'asc',
>>  'extraParams' : '&space=Reles'
>> })
>> #set ($columns = ['doc.title', 'doc.author']) #livetable('bug'
>> $columns $columnsProperties $options) {{/velocity}}
>>
>> Thank you,
>> Danilo
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users