[xwiki-users] [GSOC] XWiki has been selected as a Google Summer of Code 2017 mentor organization !

2017-02-28 Thread Thomas Mortagne
Hi XWikiers,

Good news, this year again XWiki has been selected as mentor organization !

The next step is for mentors to register to
https://summerofcode.withgoogle.com/ as ask to be mentor for XWiki
project (admins can also send invitations). Also don't hesitate to add
more proposals on
http://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/ (there is only
proposals from two mentors right now), more details or co-mentor
existing proposals.

Some students already started to communicate with the community which
is great so continue and read
http://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/Guidelines to
have a better idea of how to get more chance to be selected by XWiki
mentors.

Good GSOC 2017 !
-- 
Thomas Mortagne


Re: [xwiki-users] New page name from app fields

2017-02-28 Thread D R
Hi Marius,

the refactoring approach sounds great but there seems to be something I do
wrong because the renaming doesn't work. Maybe I misunderstood the term
"current document" but I'm not sure.

I created "Test App.Code.Test App NameManager" with the following content:

```
{{velocity}}
#set ($renameRequest =
$services.refactoring.createRenameRequest($doc.fullName, 'Now RENAMED'))
#set ($discard = $renameRequest.setAutoRedirect(false))
$services.refactoring.rename($renameRequest)).join()
{{/velocity}}

```

Then I put your DIV at the end of my app sheet:

```
{{velocity}}
{{html wiki="true"}}
#set ($discard = $doc.use('Test App.Code.Test AppClass'))
(% class="xform" %)
(((
   [FORM CONTENT]
)))


  


{{/html}}
{{/velocity}}

```

Then I opened up one of the application entries, edited it and hit "Save
and view" but the name didn't change.

Could you please tell me what I did wrong.

Thanks in advance,
Dennis

2017-02-28 11:38 GMT+01:00 Marius Dumitru Florea <
mariusdumitru.flo...@xwiki.com>:

> Hi Dennis,
>
> A relatively simple solution is the following:
>
> (1) modify the application sheet to include the following HTML at the end:
>
> 
>   
> 
>
> The result is that whenever you create a new application entry or when you
> edit an existing application entry, after you click "Save and view" you
> will be taken to the view mode with ?sheet=Path.To.NameManager in the URL
> query string, which means the Path.To.NameManager sheet will be applied to
> the saved document.
>
> (2) Create the Path.To.NameManager page that determines the right name for
> the current document (based on its fields) and renames the current document
> if needed ( using the refactoring API
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Refactoring+Module ),
> finally redirecting to the view mode of the renamed document.
>
> The problem with this solution is that it doesn't work if you use Save &
> Continue and then Cancel (I think, to be checked).
>
> Another option, more complex, is to write an event listener that catches
> the document save event and renames the document if needed based on its
> fields. The bad part with this is that the user is still not redirected
> when using Save & Continue.
>
> Hope this helps,
> Marius
>
> On Mon, Feb 27, 2017 at 3:52 PM, D R  wrote:
>
> > Hi,
> >
> > In an XWiki Application I created I want to make sure documents created
> > within it get named in a specific pattern from the fields filled inside
> > them.
> >
> > Currently I use a custom button to redirect the user to a new document
> with
> > a dummy name so he doesn't need to fill the name (that should get
> > overwritten anyway on saving) but only the relevant fields.
> >
> > Something like
> > #set ( $createDocLink = $xwiki.getURL($document, 'inline',
> > "template=${escapetool.url($urlTemplate)}=${
> > escapetool.url($urlParent)}=${escapetool.url($urlTitle)}")
> > )
> >
> > This leads to a new document as defined in the application sheet with the
> > name 'New document'.
> >
> > Now I want the user to fill 3 fields ('freetext1', 'freetext2',
> > 'dropdown1'), click 'Save & View' or a custom button. Then the document
> > should be saved as ' -  ()' and the user
> > should be redirected to that page in view mode.
> >
> > I've tried different approaches including a temporary creation page with
> > the 3 fields as HTML input fields (can't use the applications dropdown),
> > event listeners (the redirect after saving doesn't work) ...
> >
> > Additionally the same must be done when a page is edited (one of the 3
> > fields is changed).
> >
> > Please help me find a sane approach before I bite the table.
> >
> > Regs, Dennis
> >
>


Re: [xwiki-users] New page name from app fields

2017-02-28 Thread Marius Dumitru Florea
Hi Dennis,

A relatively simple solution is the following:

(1) modify the application sheet to include the following HTML at the end:


  


The result is that whenever you create a new application entry or when you
edit an existing application entry, after you click "Save and view" you
will be taken to the view mode with ?sheet=Path.To.NameManager in the URL
query string, which means the Path.To.NameManager sheet will be applied to
the saved document.

(2) Create the Path.To.NameManager page that determines the right name for
the current document (based on its fields) and renames the current document
if needed ( using the refactoring API
http://extensions.xwiki.org/xwiki/bin/view/Extension/Refactoring+Module ),
finally redirecting to the view mode of the renamed document.

The problem with this solution is that it doesn't work if you use Save &
Continue and then Cancel (I think, to be checked).

Another option, more complex, is to write an event listener that catches
the document save event and renames the document if needed based on its
fields. The bad part with this is that the user is still not redirected
when using Save & Continue.

Hope this helps,
Marius

On Mon, Feb 27, 2017 at 3:52 PM, D R  wrote:

> Hi,
>
> In an XWiki Application I created I want to make sure documents created
> within it get named in a specific pattern from the fields filled inside
> them.
>
> Currently I use a custom button to redirect the user to a new document with
> a dummy name so he doesn't need to fill the name (that should get
> overwritten anyway on saving) but only the relevant fields.
>
> Something like
> #set ( $createDocLink = $xwiki.getURL($document, 'inline',
> "template=${escapetool.url($urlTemplate)}=${
> escapetool.url($urlParent)}=${escapetool.url($urlTitle)}")
> )
>
> This leads to a new document as defined in the application sheet with the
> name 'New document'.
>
> Now I want the user to fill 3 fields ('freetext1', 'freetext2',
> 'dropdown1'), click 'Save & View' or a custom button. Then the document
> should be saved as ' -  ()' and the user
> should be redirected to that page in view mode.
>
> I've tried different approaches including a temporary creation page with
> the 3 fields as HTML input fields (can't use the applications dropdown),
> event listeners (the redirect after saving doesn't work) ...
>
> Additionally the same must be done when a page is edited (one of the 3
> fields is changed).
>
> Please help me find a sane approach before I bite the table.
>
> Regs, Dennis
>


Re: [xwiki-users] How to see velocity property in xwiki page

2017-02-28 Thread Vincent Massol
Hi,

> On 28 Feb 2017, at 09:25, aleksey-s  wrote:
> 
> Hi, 
> 
> I read documentation about apache velocity but still don't know how I can
> see my current value of parser.pool.size  property ? (I want to print value
> on my xwiki page)

I’ve created this page for you:
http://snippets.xwiki.org/xwiki/bin/view/Extension/Velocity+Parser+Pool+Size/

Thanks
-Vincent

> 
> 
> 
> --
> View this message in context: 
> http://xwiki.475771.n2.nabble.com/How-to-see-velocity-property-in-xwiki-page-tp7602873.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.



[xwiki-users] Nice display title

2017-02-28 Thread Gerritjan Koekkoek
It has always been normal that if a page did not have the attribute 'title' (it 
was left empty)

it would use a smart way to see if in the text there was a header of level 1,2 
or 3 at the top. And then display that as the title...


Now I've migrated pages to a XWiki 8.4.4 and this does not work any more?


What can cause this change in behavior ? Is it a known issue when migrating 
pages from 6.4 to ???

Is the nested pages a possible cause?


I tried to put the h2 title in the title attribute as well, but still the 
pagename is shown as title?


Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website
Facebook
email





[xwiki-users] How to see velocity property in xwiki page

2017-02-28 Thread aleksey-s
Hi, 

I read documentation about apache velocity but still don't know how I can
see my current value of parser.pool.size  property ? (I want to print value
on my xwiki page)



--
View this message in context: 
http://xwiki.475771.n2.nabble.com/How-to-see-velocity-property-in-xwiki-page-tp7602873.html
Sent from the XWiki- Users mailing list archive at Nabble.com.