Re: [xwiki-users] Stopping Xwiki-8.4.3/Tomcat-9.0 and integrating with systemctl

2017-03-01 Thread rez_spb
Hello,

Port in  property is a Tomcat system port used for shutdown, it
should not be confused with a port Tomcat service connector listens on
(client connection port like 80, 8080, 443 etc). So changing it to 8080 is
not what you should've done, I think.

Two instances are most likely due to first failed attempt to stop Tomcat,
after which you've started it again. I have seen the similar issue.

What you'd probably want to do is to killall java, then change port back to
8005, start Tomcat and wait till it's up and running, check that it listens
on port 8005 and it is the correct Tomcat (in case you have several of them
you should use other port, but not 8080 as it is used for client
connections).
My example with 2 tomcats running:


After this you'd probably want to (manually) send a signal (default is
sending 'SHUTDOWN') to this port and wait for what happens. I bet
catalina.out log will have some info on whether the shutdown was successful.

One more tip: you actually shouldn't run Tomcat as root, this could get
messy pretty fast.



--
View this message in context: 
http://xwiki.475771.n2.nabble.com/Stopping-Xwiki-8-4-3-Tomcat-9-0-and-integrating-with-systemctl-tp7602905p7602907.html
Sent from the XWiki- Users mailing list archive at Nabble.com.


Re: [xwiki-users] Stopping Xwiki-8.4.3/Tomcat-9.0 and integrating with systemctl

2017-03-01 Thread Douglas Landau
Okay.  I found the line with port 8005 in server.xml:
./conf/server.xml:

... and changed it to 8080.   However, altho $CTALINA_HOME/bin/shutdown.sh now 
runs, it doesn't seem to shut it down.  Furthermore there are two of them 
running. PIDs 1597 and 1598.  Is that correct?TIA.  
/var/run/jsvc.pid shows only 1598.

root  1597  0.0  0.0   8560   336 ?Ss   17:30   0:00 jsvc.exec 
-classpath 
/opt/apache-tomcat-9.0.0.M15/bin/bootstrap.jar:/opt/apache-tomcat-9.0.0.M15/bin/tomcat-juli.jar
 -outfile /opt/apache-tomcat-9.0.0.M15/logs/catalina.out -errfile 
/opt/apache-tomcat-9.0.0.M15/logs/catalina.err 
-Dcatalina.home=/opt/apache-tomcat-9.0.0.M15 
-Dcatalina.base=/opt/apache-tomcat-9.0.0.M15 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.0.M15/conf/logging.properties
 org.apache.catalina.startup.Bootstrap

root  1598 71.2  2.0 2986964 80708 ?   Sl   17:30   0:02 jsvc.exec 
-classpath 
/opt/apache-tomcat-9.0.0.M15/bin/bootstrap.jar:/opt/apache-tomcat-9.0.0.M15/bin/tomcat-juli.jar
 -outfile /opt/apache-tomcat-9.0.0.M15/logs/catalina.out -errfile 
/opt/apache-tomcat-9.0.0.M15/logs/catalina.err 
-Dcatalina.home=/opt/apache-tomcat-9.0.0.M15 
-Dcatalina.base=/opt/apache-tomcat-9.0.0.M15 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=/opt/apache-tomcat-9.0.0.M15/conf/logging.properties
 org.apache.catalina.startup.Bootstrap
root  1613  0.0  0.0 161352  1884 pts/0R+   17:31   0:00 ps -auxww
[root@pwswiki10 opt]# more catalina_start
CATALINA_BASE=$CATALINA_HOME
CATALINA_OPTS="-Xmx1024m -XX:MaxPermSize=192m"

export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"

cd $CATALINA_HOME
./bin/jsvc \
-classpath $CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/tomcat-juli.j
ar \
-outfile $CATALINA_BASE/logs/catalina.out \
-errfile $CATALINA_BASE/logs/catalina.err \
-Dcatalina.home=$CATALINA_HOME \
-Dcatalina.base=$CATALINA_BASE \
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties \
org.apache.catalina.startup.Bootstrap
export PERL_MB_OPT="--install_base /root/perl5";
export PERL_MM_OPT="INSTALL_BASE=/root/perl5";
[root@pwswiki10 opt]#



-Original Message-
From: users [mailto:users-boun...@xwiki.org] On Behalf Of Douglas Landau
Sent: Wednesday, March 01, 2017 5:14 PM
To: XWiki Users
Subject: [xwiki-users] Stopping Xwiki-8.4.3/Tomcat-9.0 and integrating with 
systemctl

Hi All,

Sorry for the dumb question.  I've installed CentOS-7.2, Java-1.8, MySQL 5.7, 
Tomcat 9.0.0, XWiki 8.4.3.  I've built jsvc and have created a startup script, 
catalina_start.   But now I want a stop script, and to integrate with 
systemctl/systemd on CentOS-7.  I see the page at 
https://www.weblab360.com/User:xltran/App/xWiki/Installation/CentOS_7 which 
shows the form of the systemd script /etc/systemd/system.xwiki.service:
---
[Unit]
Description=xWiki Service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/bin/bash /usr/local/xwiki/start_xwiki.sh -p 80 ExecStop=/bin/bash 
/usr/local/xwiki/stop_xwiki.sh -p 80 Restart=on-abort

[Install]
WantedBy=multi-user.target
---

But, I have no /usr/local/xwiki and thus no start-xwiki.sh and stop_xwiki.sh.  
I installed from .war and don't see those scripts in 
/opt/apache-tomcat-9.0.0.M15/webapps/xwiki/.  

Okay, well, I have a catalina_start that works, so I can use that.  But for the 
stop?  When I say "$CATALINA_HOME/bin/catalina.sh stop" or 
"$CATALINA_HOME/bin/shutdown.sh", I get the following:
[root@pwswiki10 opt]# $CATALINA_HOME/bin/shutdown.sh
Using CATALINA_BASE:   /opt/apache-tomcat-9.0.0.M15
Using CATALINA_HOME:   /opt/apache-tomcat-9.0.0.M15
Using CATALINA_TMPDIR: /opt/apache-tomcat-9.0.0.M15/temp
Using JRE_HOME:/usr/java/jdk1.8.0_25
Using CLASSPATH:   
/opt/apache-tomcat-9.0.0.M15/bin/bootstrap.jar:/opt/apache-tomcat-9.0.0.M15/bin/tomcat-juli.jar
Mar 01, 2017 5:12:16 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Mar 01, 2017 5:12:16 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.(Socket.jav

[xwiki-users] Stopping Xwiki-8.4.3/Tomcat-9.0 and integrating with systemctl

2017-03-01 Thread Douglas Landau
Hi All,

Sorry for the dumb question.  I've installed CentOS-7.2, Java-1.8, MySQL 5.7, 
Tomcat 9.0.0, XWiki 8.4.3.  I've built jsvc and have created a startup script, 
catalina_start.   But now I want a stop script, and to integrate with 
systemctl/systemd on CentOS-7.  I see the page at 
https://www.weblab360.com/User:xltran/App/xWiki/Installation/CentOS_7 which 
shows the form of the systemd script /etc/systemd/system.xwiki.service:
---
[Unit]
Description=xWiki Service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/bin/bash /usr/local/xwiki/start_xwiki.sh -p 80
ExecStop=/bin/bash /usr/local/xwiki/stop_xwiki.sh -p 80
Restart=on-abort

[Install]
WantedBy=multi-user.target
---

But, I have no /usr/local/xwiki and thus no start-xwiki.sh and stop_xwiki.sh.  
I installed from .war and don't see those scripts in 
/opt/apache-tomcat-9.0.0.M15/webapps/xwiki/.  

Okay, well, I have a catalina_start that works, so I can use that.  But for the 
stop?  When I say "$CATALINA_HOME/bin/catalina.sh stop" or 
"$CATALINA_HOME/bin/shutdown.sh", I get the following:
[root@pwswiki10 opt]# $CATALINA_HOME/bin/shutdown.sh
Using CATALINA_BASE:   /opt/apache-tomcat-9.0.0.M15
Using CATALINA_HOME:   /opt/apache-tomcat-9.0.0.M15
Using CATALINA_TMPDIR: /opt/apache-tomcat-9.0.0.M15/temp
Using JRE_HOME:/usr/java/jdk1.8.0_25
Using CLASSPATH:   
/opt/apache-tomcat-9.0.0.M15/bin/bootstrap.jar:/opt/apache-tomcat-9.0.0.M15/bin/tomcat-juli.jar
Mar 01, 2017 5:12:16 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Mar 01, 2017 5:12:16 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.(Socket.java:434)
at java.net.Socket.(Socket.java:211)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:476)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:408)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:497)


What have I neglected to do?
Thanks in advance
Doug




The information contained in this transmission may contain West Marine 
proprietary, confidential and/or privileged 
information.  It is intended only for the use of the person(s) named above. If 
you are not the intended recipient, you are 
hereby notified that any review, dissemination, distribution or duplication of 
this communication is strictly prohibited. 
If you are not the intended recipient, please contact the sender by reply email 
and destroy all copies of the original 
message. To reply to our email administrator directly, please send an email to 
netad...@westmarine.com.


Re: [xwiki-users] [xwiki-devs] [ANN] XWiki 9.1.1 released

2017-03-01 Thread Guillaume Delhumeau
We can be proud to have released it that fast :)

2017-03-01 19:20 GMT+01:00 Vincent Massol :

>
> > On 1 Mar 2017, at 18:47, Thomas Mortagne 
> wrote:
> >
> > The XWiki development team is proud to announce the availability of
> XWiki 9.1.1.
>
> Well, we’re not that proud actually :)
>
> Thanks to Thomas for having released quickly a new version that fixes the
> regression introduced in 9.1.
>
> Thanks
> -Vincent
>
> > This version fix a bug that makes the Distribution Wizard always
> automated.
> >
> > 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/Data/XWiki/9.1.1
> >
> > Thanks for your support
> > -The XWiki dev team
>
>


-- 
Guillaume Delhumeau (guillaume.delhum...@xwiki.com)
Research & Development Engineer at XWiki SAS
Committer on the XWiki.org project


[xwiki-users] Rest API to create pages (and pages within pages)

2017-03-01 Thread Juan Huerta
Hi,

I'm quite new in XWiki and trying to use the RestAPI to create pages, and
pages inside pages (which I think is called spaces).  I have the feeling
that 'spaces' is a legacy term, and that in the current XWiki (Enterprise
9.1), an space is just a page that contains other pages. Kindly correct me
if I'm wrong, but I have not find anywhere how to create an space.

Below the 2 URLs I'm using to create the pages. In both cases, when I use
PUT to call the 2 urls, I pass as data a content and a title. I have no
problem with the title and the content, both are being created correctly.
My end goal is to create pages, and pages withing pages.

"http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/2017-2020/pages/madrid
"
"
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/2017-2020/spaces/madrid/pages/cibeles
"


In both cases, I'm using PUT and I'm able to create pages successfully,
however, not as I want:

- "
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/2017-2020/pages/madrid";
This one creates a page called "madrid" (with the content I pass)

- "
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/2017-2020/spaces/madrid/pages/cibeles
"
I would expect this one to create a page named "cibeles" inside the
previous "madrid" page.
Instead, it creates a new "madrid" page (without any text in the content,
which is fine as I dont pass anything), and inside this page, the "cibeles"
page (with the content I expect)

So, I end up having TWO pages named "madrid"

 One points to "http://localhost:8080/xwiki/bin/view/2017-2020/madrid/";
(and have inside a page named cibeles) . This "madrid" page displays this
text: "The requested page could not be found.", although inthe hierarchy
tree I see it has a page inside.

 The other (without a nested page), points to: "
http://localhost:8080/xwiki/bin/view/2017-2020/madrid"; and has a proper
content (which I passed in the PUT request)

 (notice the / at the end of the URL, "madrid" vs "madrid/" )

 How to indicate that the page should be created in an existing page
without the need to create this new parent page? Or even if I have to
create first the parent page, how to tell that the child page should be
inside that existing parent page?

 Thanks for your help,

 Juan


Re: [xwiki-users] [ANN] XWiki 9.1.1 released

2017-03-01 Thread Vincent Massol

> On 1 Mar 2017, at 18:47, Thomas Mortagne  wrote:
> 
> The XWiki development team is proud to announce the availability of XWiki 
> 9.1.1.

Well, we’re not that proud actually :)

Thanks to Thomas for having released quickly a new version that fixes the 
regression introduced in 9.1.

Thanks
-Vincent

> This version fix a bug that makes the Distribution Wizard always automated.
> 
> 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/Data/XWiki/9.1.1
> 
> Thanks for your support
> -The XWiki dev team



[xwiki-users] [ANN] XWiki 9.1.1 released

2017-03-01 Thread Thomas Mortagne
The XWiki development team is proud to announce the availability of XWiki 9.1.1.
This version fix a bug that makes the Distribution Wizard always automated.

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/Data/XWiki/9.1.1

Thanks for your support
-The XWiki dev team


[xwiki-users] Rollback Failure

2017-03-01 Thread Keith Davis
We have a page that fails when we attempt to rollback, other pages seem to
work fine:

Detailed information:

Error number 0 in 11: Uncaught exception
com.xpn.xwiki.XWikiException: Error number 0 in 11: Uncaught exception
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:474)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:210)
at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at 
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at 
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at 
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at 
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at 
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: -29
at java.lang.String.substring(Unknown Source)
at 
org.xwiki.store.legacy.store.internal.FilesystemAtta

Re: [xwiki-users] Batch move of pages

2017-03-01 Thread Sebastian Luna Valero
Many thanks, Marius.

Apart from that option, would it be possible to drag and drop wiki pages
when using the "tree view" in the "Page index"?
(xwiki/bin/view/Main/AllDocs?view=tree)

Best regards,
Sebastian


2017-03-01 14:50 GMT+00:00 Marius Dumitru Florea <
mariusdumitru.flo...@xwiki.com>:

> Hi Sebastian,
>
> Take a look at the Refactoring Module
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Refactoring+Module .
> It provides some scripting APIs to move/rename pages. The full list of
> methods is available at
> https://github.com/xwiki/xwiki-platform/blob/master/
> xwiki-platform-core/xwiki-platform-refactoring/xwiki-
> platform-refactoring-api/src/main/java/org/xwiki/refactoring/script/
> RefactoringScriptService.java
> . Move request accepts a list as input (i.e. you can move multiple pages to
> the same target location).
>
> Hope this helps,
> Marius
>
> On Wed, Mar 1, 2017 at 4:22 PM, Sebastian Luna Valero <
> sebastian.luna.val...@gmail.com> wrote:
>
> > Hi All,
> >
> > We are rearranging our xwiki and we have many pages to move to different
> > locations. So far, the only solution seems to be doing so one page at a
> > time, which is tedious having into account that more than 200 pages need
> to
> > be moved.
> >
> > I was wondering whether this could be streamlined somehow. I could not
> find
> > help in the mailing list archives and I think the only extension
> available
> > is:
> >
> > http://extensions.xwiki.org/xwiki/bin/view/Extension/File+
> > Manager+Application
> >
> > but this seems to work with non-wiki files.
> >
> > Any feedback is appreciated.
> >
> > Best regards,
> > Sebastian
> >
>


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

2017-03-01 Thread D R
Hi Marius,

thanks, I'm one step further now, at least the NameManager now does
renaming in general (it renamed itself until I added an #if clause to not
do so).

I wanted to implement it step by step so I didn't add the redirect yet.

But the sheet is not executed when editing application entries.

Meanwhile I have the following.

Test App.Code.Test AppSheet:

```
[...]
#set( $nameManRef = $services.model.createDocumentReference('', ['Test
App', 'Code'], 'Test App NameManager') )
#set( $nameMan = $xwiki.getDocument($nameManRef) )


  


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

```

Test App.Code.Test App NameManager:

```
{{velocity}}
#if ( $doc.name != 'Test App NameManager' )
  #set ($renameRequest =
$services.refactoring.createRenameRequest($doc.documentReference, 'Now
RENAMED'))
  #set ($discard = $renameRequest.setAutoRedirect(false))
  $services.refactoring.rename($renameRequest)).join()
#end
{{/velocity}}

```

Thanks again,
Dennis

2017-03-01 10:30 GMT+01:00 Marius Dumitru Florea <
mariusdumitru.flo...@xwiki.com>:

> On Tue, Feb 28, 2017 at 3:03 PM, D R  wrote:
>
> > 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'))
> >
>
> As per
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Refactoring+Module#
> HScriptService
> the first parameter passed to createRenameRequest must be an
> EntityReference. In your case you can pass:
>
> * either the reference of the current document, i.e. $doc.documentReference
> , if the document is terminal (its name != 'WebHome')
> * or the reference of the current space, i.e. $doc.documentReference.parent
> , if the document is not terminal (its name is 'WebHome')
>
>
> > #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.
> >
>
> I don't see any redirect in "Test App NameManager" so it's normal you stay
> on the same page, but do you have the sheet parameter in the query string?
> i.e. is the "Test App NameManager" sheet executed?
>
>
> >
> > 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',
> > > > "te

Re: [xwiki-users] Batch move of pages

2017-03-01 Thread Marius Dumitru Florea
Hi Sebastian,

Take a look at the Refactoring Module
http://extensions.xwiki.org/xwiki/bin/view/Extension/Refactoring+Module .
It provides some scripting APIs to move/rename pages. The full list of
methods is available at
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-api/src/main/java/org/xwiki/refactoring/script/RefactoringScriptService.java
. Move request accepts a list as input (i.e. you can move multiple pages to
the same target location).

Hope this helps,
Marius

On Wed, Mar 1, 2017 at 4:22 PM, Sebastian Luna Valero <
sebastian.luna.val...@gmail.com> wrote:

> Hi All,
>
> We are rearranging our xwiki and we have many pages to move to different
> locations. So far, the only solution seems to be doing so one page at a
> time, which is tedious having into account that more than 200 pages need to
> be moved.
>
> I was wondering whether this could be streamlined somehow. I could not find
> help in the mailing list archives and I think the only extension available
> is:
>
> http://extensions.xwiki.org/xwiki/bin/view/Extension/File+
> Manager+Application
>
> but this seems to work with non-wiki files.
>
> Any feedback is appreciated.
>
> Best regards,
> Sebastian
>


[xwiki-users] Batch move of pages

2017-03-01 Thread Sebastian Luna Valero
Hi All,

We are rearranging our xwiki and we have many pages to move to different
locations. So far, the only solution seems to be doing so one page at a
time, which is tedious having into account that more than 200 pages need to
be moved.

I was wondering whether this could be streamlined somehow. I could not find
help in the mailing list archives and I think the only extension available
is:

http://extensions.xwiki.org/xwiki/bin/view/Extension/File+Manager+Application

but this seems to work with non-wiki files.

Any feedback is appreciated.

Best regards,
Sebastian


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

2017-03-01 Thread aleksey-s
Hi Vincent,

Thank you! This is really good. 



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


Re: [xwiki-users] How to use PDF viewer macro

2017-03-01 Thread Richter, Tobias

> Hi all,
>
> I'm using xwiki enterprise 8.4.4.
>
> I've installed the PDF view macro
>  >extension
> (it appears as "installed" in the extensions manager).
>
> How do I now view a PDF using it? See the attached screenshot. When I 
> click on the PDF, the file is downloaded locally. How can I view the 
> PDF in the browser?
>

>>Indeed, the PDF Viewer Macro documentation doesn't give any usage example..
>>In general, wiki rendering macros are supposed to be used from the content of 
>>a wiki page. So you have to edit a wiki page and insert the macro from the 
>>CKEditor toolbar (see 
http://extensions.xwiki.org/xwiki/bin/download/Extension/CKEditor+Integration/macroToolbarIcon.png
>>).

>>Hope this helps,
>>Marius


>
> Oliver
>

Hi everybody - I have got a question about the PDF-Viewer Macro too - am I able 
to use an URI from a document,  shared from a windows file server?

If yes - is there any special syntax like 
fileserver//path//to//the/document.pdf  

Thanks,

Tobias


Re: [xwiki-users] How to use PDF viewer macro

2017-03-01 Thread Marius Dumitru Florea
On Thu, Feb 23, 2017 at 1:26 PM, Oliver Angélil  wrote:

> Hi all,
>
> I'm using xwiki enterprise 8.4.4.
>
> I've installed the PDF view macro
>  >extension
> (it appears as "installed" in the extensions manager).
>
> How do I now view a PDF using it? See the attached screenshot. When I click
> on the PDF, the file is downloaded locally. How can I view the PDF in the
> browser?
>

Indeed, the PDF Viewer Macro documentation doesn't give any usage example..
In general, wiki rendering macros are supposed to be used from the content
of a wiki page. So you have to edit a wiki page and insert the macro from
the CKEditor toolbar (see
http://extensions.xwiki.org/xwiki/bin/download/Extension/CKEditor+Integration/macroToolbarIcon.png
).

Hope this helps,
Marius


>
> Oliver
>


Re: [xwiki-users] Adding Macro as Buttons in CKEditor

2017-03-01 Thread Marius Dumitru Florea
On Mon, Feb 27, 2017 at 12:40 PM, Mahomed Hussein 
wrote:

> Hi
>
> With the editor in XWiki < v9.0.0 (GWT Editor), I could add different
> buttons and macros onto the toolbar by modifying the configuration and
> adding “macro:macroName” as a toolbar “feature”.
>
>

> Has anyone got a simple step by step instructions for adding the same
> thing in CKEditor? I’ve tried looking at the documentation, but it doesn’t
> immediately or easily relate to the macros/add-ins (e.g. the lightbox
> macro/plugin is one we use a lot).
>

The CKEditor integration doesn't support this ATM, unfortunately. Would be
great if you could make a feature request on
http://jira.xwiki.org/browse/CKEDITOR . Someone else also asked for this
recently so I could try to make some time to implement it but I can't
guarantee. If you can't wait and you know JavaScript you could try to
implement this yourself like this:

* read the CKEditor documentation for writing a plugin
http://docs.ckeditor.com/#!/guide/plugin_sdk_sample . You can write the
plugin in a JSX similar to
https://github.com/xwiki-contrib/application-ckeditor/blob/application-ckeditor-1.0/ui/src/main/resources/CKEditor/WikiSourcePlugin.xml
and load it like
https://github.com/xwiki-contrib/application-ckeditor/blob/application-ckeditor-1.0/ui/src/main/resources/CKEditor/EditSheet.xml#L154
* the "insertTimestamp" command defined in the example plugin from the
CKEditor documentation would open the macro editor and then insert macro
when the dialog is closed. Something like this is done in
https://github.com/xwiki-contrib/application-ckeditor/blob/master/plugins/src/main/resources/xwiki-macro/plugin.js#L160
.

But it's not very easy and I would like to implement something generic.

Thanks,
Marius


>
> Thanks in advance for any help.
>
>
> Kind regards,
>
>
> Mahomed Hussein
> Custodian Data Centre
> Email: maho...@custodiandc.com
> http://www.CustodianDC.com
>


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

2017-03-01 Thread Marius Dumitru Florea
On Tue, Feb 28, 2017 at 3:03 PM, D R  wrote:

> 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'))
>

As per
http://extensions.xwiki.org/xwiki/bin/view/Extension/Refactoring+Module#HScriptService
the first parameter passed to createRenameRequest must be an
EntityReference. In your case you can pass:

* either the reference of the current document, i.e. $doc.documentReference
, if the document is terminal (its name != 'WebHome')
* or the reference of the current space, i.e. $doc.documentReference.parent
, if the document is not terminal (its name is 'WebHome')


> #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.
>

I don't see any redirect in "Test App NameManager" so it's normal you stay
on the same page, but do you have the sheet parameter in the query string?
i.e. is the "Test App NameManager" sheet executed?


>
> 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)}&parent=${
> > > escapetool.url($urlParent)}&title=${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
> > >
> >
>