We are using a SharePoint site to house a document library. I'd like to move this into our xwiki site, but haven't figured out how to configure pages in a way that would make this viable.
We use lists in SP - so people can add documents and when they upload them, they need to add in fields such as a description of the document and notes, usually related to when the document was current as of. The site auto adds in who uploaded it.
While I can add pages that use the Attachment macro and that makes it easy to display documents, it’s the extra fields that make the information more valuable - and that's the functionality I'd be interested in.
One thought I had was to use a form which would then populate a table, but not sure if that's a truly workable solution.
Thoughts or ideas would be welcomed!
Paul Pinkerton
KnowledgeNow Project/ ACLCO
Hi,
that's what I get, when browsing to our freshly installed XWiki instance
"HTTP Status 500 - com.xpn.xwiki.XWikiException: Error number 11007 in
0: Failed to extract Entity Resource Reference from URL"
The error appears, after the "XWiki Loading..." status has reached ca
50%. The complete stacktrace can be found at http://pastebin.com/SnuA0AY8.
I've found quite some references to the error "Error number 11007", but
most of them referred to the PostgreSQL JDBC driver not being installed.
This is not the case on our system.
One reference (http://jira.xwiki.org/browse/XWIKI-11477) seems to
exactly match our error, but unfortunately none of the explanations
given in this ticket are understandable for me.
Our system is running on OpenSuSE 13.1 with PostgreSQL 9.2.14 (from
repo), Apache Tomcat 8.0.30 (manually installed) and XWiki Enterprise
7.4 (WEB, manually installed).
Any pointer to fix this problem is appreciated. Additional information
can be provided if it is required.
Cheers
Frank
Hi users,
Searching and reading plenty of material, I have understood some of the
XClass and Sheet behaviour, but I have still some problems because, even if
I have created an XClass and a related Sheet (binded adding an
"XWiki.ClassSheetBinding" object to the XClass document) and after have
inserted in the sheet the velocity script:
{{velocity}}\n
#set($class = $doc.getObject('MySpace.myXClass').xWikiClass)
#foreach($prop in $class.properties)
=== $prop.prettyName ===
:$doc.display($prop.getName())\n";
#end
{{/velocity}}\n";
When I update my pages in each pages I get this Velocity error:
"
org.xwiki.rendering.macro.MacroExecutionException: The execution of
the [velocity] script macro is not allowed. Check the rights of its
last author or the parameters if it's rendered from another script.
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:178)
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:269)
at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:95)
at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:253)
at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:126)
at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:56)
at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96)
at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39)
at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:229)
at org.xwiki.sheet.internal.SheetDocumentDisplayer.applySheet(SheetDocumentDisplayer.java:209)
at org.xwiki.sheet.internal.SheetDocumentDisplayer.maybeDisplayWithSheet(SheetDocumentDisplayer.java:164)
at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:102)
at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:50)
at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68)
at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1164)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1127)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1179)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:692)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.xwiki.velocity.introspection.TryCatchDirective.render(TryCatchDirective.java:72)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:256)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:725)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:626)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:604)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:570)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:556)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:65)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1876)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1854)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:820)
at sun.reflect.GeneratedMethodAccessor179.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:256)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:725)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:626)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:604)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:570)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:556)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:65)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1876)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1854)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:820)
at sun.reflect.GeneratedMethodAccessor179.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:256)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:725)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:626)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:604)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:570)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:556)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:65)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1876)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:431)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:184)
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:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:137)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)"
Thanks,
Giordano.
--- En date de : Jeu 21.1.16, vincent(a)massol.net <vincent(a)massol.net> a écrit :
> De: vincent(a)massol.net <vincent(a)massol.net>
> Arial;font-size:13px;}Very nice Bastien, I
> wasn't asking that much! :)
np :-)
You are right some nice screenshot is always better.
> I’ve taken the liberty
> of editing the page to tune the language here and there, I
> hope you don’t mind. I’ve also used the {{image}} macro
> which is our best practice in order to have similar images
> across xwiki.org.
In fact, I hoped secretly that you (or nice xwiki team) correct my "english" ;-))
> Thanks a lot for providing
> this, I’m sure it’ll help others!-Vincent PS: I’ve
> checked a bit the non-working link (the fact that the user
> cannot click on it). The generated HTML seems to have a
> wrong & :
Ok thxs
Pascal
A form to choose and delete manually some event from Activity Stream:
http://extensions.xwiki.org/xwiki/bin/view/Extension/CleanActivityStream
Bon appetit then!
BTW, in inline mode of extension page the link "Extension Compatibility Object" from <<General Compatibility: For registering information about a Tested configuration please add an Extension Compatibility Object instead (save your modifications first!)>> doesn't work.
We must add manually ExtensionCode.ExtensionCompatibilityClass object at the extension page.
--------------------------------------------
En date de : Mer 20.1.16, vincent(a)massol.net <vincent(a)massol.net> a écrit :
Objet: Re: [xwiki-users] How can I get event object through a form (a form to choose and delete manually some events)
À: "XWiki Users" <users(a)xwiki.org>
Date: Mercredi 20 janvier 2016, 15h09
On 20 Jan 2016 at 11:49:31,
Pascal BASTIEN (pbasnews-xwiki(a)yahoo.fr)
wrote:
greedy!
indeed :)
Ok I will find some time to post that :-)
cool,
thanks
-Vincent
Hello,
I migrated from Debian packages xwiki 7.3 to 7.4
Since I have two errors:
• when connecting, the connection is very very long. It loads after validation of login and password, and then it displays the dashboard. I do not see in the logs where it loses time.
• when edtion of any page
During validation, hiberntate sends me an error:
Information détaillée:
Error number 3201 in 3: Exception while saving document suivitaxedesjour:Changements de tarifs 2016.WebHome
com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document suivitaxedesjour:Changements de tarifs 2016.WebHome
at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:658)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:167)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:160)
at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1564)
at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:181)
at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:223)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:416)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:184)
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.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:690)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:477)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:105)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:124)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1003)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.xpn.xwiki.XWikiException: Error number 3234 in 3: Exception while saving attachments attachment list of document suivitaxedesjour:Changements de tarifs 2016.WebHome
at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachmentList(XWikiHibernateStore.java:1676)
at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:531)
... 66 more
Caused by: com.xpn.xwiki.XWikiException: Error number 3232 in 3: Exception while saving attachments for attachment 2015-12-17_4.1. Tarification 2016 et pre?le?vement de la taxe de se?jour sur le territoire intercommunal.pdf of document suivitaxedesjour:Changements de tarifs 2016.WebHome
at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachment(XWikiHibernateStore.java:1752)
at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachmentList(XWikiHibernateStore.java:1667)
... 67 more
Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.xpn.xwiki.doc.XWikiAttachment#2003897923]
at org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:638)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:305)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
at org.hibernate.event.def.DefaultUpdateEventListener.performSaveOrUpdate(DefaultUpdateEventListener.java:57)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:742)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:730)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:722)
at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachment(XWikiHibernateStore.java:1722)
... 68 more
thanks for your help,
Julien
Ok thxs guys
I didn't understood why my $xwiki.activitystream.searchEvents doesn't work with eventid...
I'm starting to begin some help and copy/paste
Doc http://platform.xwiki.org/xwiki/bin/view/DevGuide/DatabaseSchema indicate:
"In a hibernate query you can use the same name as the get method but without the get and with the first letter lowercase so the SQL query"
I drink a strong coffe and read ... WITH THE FIRST LETTER LOWERCASE!
Then I replace my EventId by eventId to fix my ugly code (because public String getEventId()):
#set($results= $xwiki.activitystream.searchEvents("act.eventId='$MyValue'", false, 0, 0))
and tadaaaa!
it's working thxs a lot.
I will post my form here later when it will be ready if you want it. :-)
> $xwiki.activitystream.method but if I use where condition on
> eventid field I obtain this error :-(
>
>
> Caused by: org.hibernate.QueryException: could not resolve
> property: EventId of:
> com.xpn.xwiki.plugin.activitystream.impl.ActivityEventImpl
> [select act from
> com.xpn.xwiki.plugin.activitystream.impl.ActivityEventImpl
> as act where
> act.EventId='757328280-1453216488000-dishFheu' order by
> act.date desc]
> at
> org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:81)
>
>
greedy!
Ok I will find some time to post that :-)
--------------------------------------------
En date de : Mer 20.1.16, vincent(a)massol.net <vincent(a)massol.net> a écrit :
Objet: Re: [xwiki-users] How can I get event object through a form (a form to choose and delete manually some events)
À: "XWiki Users" <users(a)xwiki.org>
Cc: "Pascal BASTIEN" <pbasnews-xwiki(a)yahoo.fr>
Date: Mercredi 20 janvier 2016, 11h06
#yiv8476593446
body{font-family:Helvetica,
Arial;font-size:13px;}Hi Pascal,
What would be very nice
would be to post this snippet on extensions.xwiki.org :)
(With possibly a screenshot to attract users…)
Thanks!-Vincent
On 20 Jan 2016 at 11:03:13,
Pascal BASTIEN (pbasnews-xwiki(a)yahoo.fr)
wrote: Here a nice
form to choose and delete manually some annoying event (like
a page deleted or some rude text in an page updated)
*********************************************************
*********************************************************
{{velocity}}
Form to delete
manually some event entry from Activity stream :
#if
($xwiki.hasAdminRights())
{{html}}
##<form method="post"
onsubmit="return confirm('Are you
sure?')">
## <form
action="" id="newdoc"
method="get">
<form
method="get" id="DelActivityStream"
onsubmit="return confirm('Delete selected events:
are you sure?')">
<div
class="container">
#foreach
($MyEvent in $xwiki.activitystream.getEvents(false, 500, 0
))
##1. AAA $MyEvent -
$MyEvent.getPage()
#set($MycheckBox="<input type='checkbox'
name='IdEntry' value='")
#set($MycheckBox=$MycheckBox +
"$MyEvent.getEventId()")
#set($MycheckBox=$MycheckBox + "'/>" +
"$MyEvent.getDisplayDate() - $MyEvent.getPage() -
$MyEvent.getType() - - $MyEvent.getUser() " +
"<br />")
$MycheckBox
#end
##
<input type="checkbox"
name="IdEntry"
value="${doc.fullName}"/> This is checkbox
<br />
</div>
<span
class="buttonwrapper"><input
type="submit" value="Supprimer les entrées
sélectionnées du flux d'activité"
class="button"/></span>
</form>
{{/html}}
#else
{{warning}}
Vous
devez être connecté avec un compte Admin pour utiliser
cette macro
{{/warning}}
#end
##
Récupère les id des event sélectionnés
## mise en forme pour générer la requête hql
cat.name in ( 'Foo', 'Bar', 'Baz'
)
#set($ListIn =
$stringtool.join($request.getParameterValues('IdEntry'),
"', '"))
#set($ListIn =
"'" + $ListIn + "'")
##set($results=
$xwiki.activitystream.searchEvents("act.eventId='$MyValue'",
false, 0, 0))
#set($results=
$xwiki.activitystream.searchEvents("act.eventId in
($ListIn)", false, 0, 0))
#foreach ($MyEventToDelete in $results)
## #foreach ($MyEventToDelete in
$xwiki.activitystream.getEvents($MonStream, false, 1500,
0))
$xwiki.activitystream.deleteActivityEvent($MyEventToDelete)
* $MyEventToDelete.getDisplayDate() -
$MyEventToDelete.getPage() - $MyEventToDelete.getType() - -
$MyEventToDelete.getUser() ~*~* //**deleted**// ~*~*
#end
{{/velocity}}
*********************************************************
*********************************************************
--------------------------------------------
En date de : Mer 20.1.16, Pascal BASTIEN
<pbasnews-xwiki(a)yahoo.fr> a écrit :
it's
working thxs a lot.
I will post my form
here later when it will be ready if you
want it. :-)
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
Hi to all xwiki devs and users, First of all best wishes and happy new year.
We have a problem to get statistics from a standalone xwiki 7.1.2 (hsql + jetty) into a new version xwiki entreprise 7.4 (postgre + tomcat).As we have seen on the support site the import/export fonctions do not include statitics… Is there a possiblity to do so and how could it be done? Thank in advance for your replies
Nigel COUTIN
Le Mercredi 6 janvier 2016 9h37, Nigel COUTIN <coutin_nigel(a)yahoo.fr> a écrit :
Hi to all xwiki devs and users, First of all best wishes and happy new year.
We have a problem to get statistics from a standalone xwiki 7.1.2(hsql + jetty) into a new version xwiki entreprise 7.4 (postgre + tomcat).As we have seen on the support site the import/exportfonctions do not include statitics… Is there a possiblity to do so and how could it be done? Thank in advance for your replies
Nigel COUTIN
In our use of the calendar extension, I expect to have situations where the
title is repeated (sometimes for what are really recurring events and
sometimes not). For this reason, we'll leave the randomly generated string
in the title field. I've added a 'short description' field to the event
class to use in place of the title. I would like to display the new field in
the calendar month/week/day view instead of the title. Does anyone have
suggestions on how to do this?
I'm using XWiki 7.4.
--
View this message in context: http://xwiki.475771.n2.nabble.com/Mocca-calendar-display-short-description-…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Here a nice form to choose and delete manually some annoying event (like a page deleted or some rude text in an page updated)
*********************************************************
*********************************************************
{{velocity}}
Form to delete manually some event entry from Activity stream :
#if ($xwiki.hasAdminRights())
{{html}}
##<form method="post" onsubmit="return confirm('Are you sure?')">
## <form action="" id="newdoc" method="get">
<form method="get" id="DelActivityStream" onsubmit="return confirm('Delete selected events: are you sure?')">
<div class="container">
#foreach ($MyEvent in $xwiki.activitystream.getEvents(false, 500, 0 ))
##1. AAA $MyEvent - $MyEvent.getPage()
#set($MycheckBox="<input type='checkbox' name='IdEntry' value='")
#set($MycheckBox=$MycheckBox + "$MyEvent.getEventId()")
#set($MycheckBox=$MycheckBox + "'/>" + "$MyEvent.getDisplayDate() - $MyEvent.getPage() - $MyEvent.getType() - - $MyEvent.getUser() " + "<br />")
$MycheckBox
#end
## <input type="checkbox" name="IdEntry" value="${doc.fullName}"/> This is checkbox <br />
</div>
<span class="buttonwrapper"><input type="submit" value="Supprimer les entrées sélectionnées du flux d'activité" class="button"/></span>
</form>
{{/html}}
#else
{{warning}}
Vous devez être connecté avec un compte Admin pour utiliser cette macro
{{/warning}}
#end
## Récupère les id des event sélectionnés
## mise en forme pour générer la requête hql cat.name in ( 'Foo', 'Bar', 'Baz' )
#set($ListIn = $stringtool.join($request.getParameterValues('IdEntry'), "', '"))
#set($ListIn = "'" + $ListIn + "'")
##set($results= $xwiki.activitystream.searchEvents("act.eventId='$MyValue'", false, 0, 0))
#set($results= $xwiki.activitystream.searchEvents("act.eventId in ($ListIn)", false, 0, 0))
#foreach ($MyEventToDelete in $results)
## #foreach ($MyEventToDelete in $xwiki.activitystream.getEvents($MonStream, false, 1500, 0))
$xwiki.activitystream.deleteActivityEvent($MyEventToDelete)
* $MyEventToDelete.getDisplayDate() - $MyEventToDelete.getPage() - $MyEventToDelete.getType() - - $MyEventToDelete.getUser() ~*~* //**deleted**// ~*~*
#end
{{/velocity}}
*********************************************************
*********************************************************
--------------------------------------------
En date de : Mer 20.1.16, Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr> a écrit :
it's working thxs a lot.
I will post my form here later when it will be ready if you
want it. :-)
Hi,
I suffered to find hql query to use $xwiki.activitystream.method but if I use where condition on eventid field I obtain this error :-(
Caused by: org.hibernate.QueryException: could not resolve property: EventId of: com.xpn.xwiki.plugin.activitystream.impl.ActivityEventImpl [select act from com.xpn.xwiki.plugin.activitystream.impl.ActivityEventImpl as act where act.EventId='757328280-1453216488000-dishFheu' order by act.date desc]
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:81)
>
> > >
> > Did you try using
> > >
> searchEvents and building an HQL that
> >
> >
> >
> Anyway I found table and field to use an hql query here:
> > http://platform.xwiki.org/xwiki/bin/view/DevGuide/DatabaseSchema
> (I must use a ggogle glass+zoom to see field ;-) )
> > but my query with
> $services.query.hql($hql).execute() doesn't work with
> table name (rg.hibernate.hql.ast.QuerySyntaxException:
> activitystream_events is not mapped ).
> >
> Then I tested with simple query:
> > SELECT
> doc.XWD_TITLE FROM xwikidoc AS doc WHERE doc.XWD_FULLNAME =
> 'Main.WebHome'
> > didn't work
> => Caused by: org.hibernate.hql.ast.QuerySyntaxException:
> xwikidoc is not mapped [select doc.XWD_TITLE FROM xwikidoc
> AS doc WHERE doc.XWD_FULLNAME = 'Main.WebHome']
> > SELECT doc.title FROM XWikiDocument AS doc
> WHERE doc.fullName = 'Main.WebHome'
> > working fine
> > With
> velocity+API we can not use hql query with true field/table
> name?
> > If we can not then where I can
> found field/table mapping name for activitystream_events
> table?
> >
> > Thxs
>
> _______________________________________________
> users mailing list
> users(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
--- En date de : Mar 19.1.16, vincent(a)massol.net <vincent(a)massol.net> a écrit :
> De: vincent(a)massol.net <vincent(a)massol.net>
> Objet: Re: [xwiki-users] Fw : Re: How can I get event object through a form
> À: "XWiki Users" <users(a)xwiki.org>
> Date: Mardi 19 janvier 2016, 8h09
> Also note that the AS has
> a buitin feature to delete old events, see your xwiki.cfg
> file:
>
....
> xwiki.plugin.activitystream.daystokeepevents=0
Yes I know that and delete some event with API :-)
My problem is the way to give some selected event object through a form with $request.getParameterValues() to delete these events.
>
> If you still need to delete
> event manually you could check the code executed by the
> scheduler job.
I didn't found it either Scheduler.ActivityStreamCleaner is empty and anyway I suppose it is groovy code (look into xar source if needed).
> > Did you try using
> searchEvents and building an HQL that
> >
Anyway I found table and field to use an hql query here:
http://platform.xwiki.org/xwiki/bin/view/DevGuide/DatabaseSchema (I must use a ggogle glass+zoom to see field ;-) )
but my query with $services.query.hql($hql).execute() doesn't work with table name (rg.hibernate.hql.ast.QuerySyntaxException: activitystream_events is not mapped ).
Then I tested with simple query:
SELECT doc.XWD_TITLE FROM xwikidoc AS doc WHERE doc.XWD_FULLNAME = 'Main.WebHome'
didn't work => Caused by: org.hibernate.hql.ast.QuerySyntaxException: xwikidoc is not mapped [select doc.XWD_TITLE FROM xwikidoc AS doc WHERE doc.XWD_FULLNAME = 'Main.WebHome']
SELECT doc.title FROM XWikiDocument AS doc WHERE doc.fullName = 'Main.WebHome'
working fine
With velocity+API we can not use hql query with true field/table name?
If we can not then where I can found field/table mapping name for activitystream_events table?
Thxs
>
> Did you try using searchEvents and building an HQL that
> retrieves the Event object with the given IDs? Then, once
> you get the Event objects, you can use
> deleteActivityEvent on each of them.
That is what I was affraid of ... hql query. I though there was a simplier way like xcontext stuff or convert id in event object ;-)
Thxs I will give a try (must found id field and table)
>
> I try to make an Admin form to delete some event from
> activity stream.
>
> I manage:
>
> - to list events in a checkbox list
>
> - to delete an event
>
> #foreach ($MonEvent in
> $xwiki.activitystream.getEventsForUser($MyUserr, false, 300,
> 0))
>
> #if
> ($MonEvent.getPage()=='MySpace.MyPage')
>
> * event deletion
>
>
> $xwiki.activitystream.deleteActivityEvent($MonEvent)
>
> #end
>
> #end
>
> - but I didn't manage to pass an event id/object with
> form to my deleteActivityEvent method :-(
>
>
>
> It doesn't work because when I get my event through
> $request.getParameterValues('IdEntry'), event ID is
> transformed in text and is not event object anymore.
>
>
>
> I use velocity with xwiki 7.0.1 and my page contains this
> code:
>
>
>
> **********************************
>
> {{velocity}}
>
> {{html}}
>
> ## My form to select events to delete
>
> <form method="get"
> id="DelActivityStream" onsubmit="return
> confirm('Are you sure?')">
>
> <div class="container">
>
> #foreach ($MonEvent in
> $xwiki.activitystream.getEvents(false, 200, 0 ))
>
> ##1. AAA $MonEvent - $MonEvent.getPage()
>
> #set($MycheckBox="<input
> type='checkbox' name='IdEntry'
> value='")
>
> #set($MycheckBox=$MycheckBox +
> "$MonEvent")
>
> #set($MycheckBox=$MycheckBox + "'/>"
> + "$MonEvent.getPage() - $MonEvent.getDisplayDate() -
> $MonEvent.getType() - $MonEvent.getPriority() -
> $MonEvent.getUser() - $MonEvent.getEventId() -
> $MonEvent.getEvent() " + "<br />")
>
> $MycheckBox
>
> #end
>
> ## <input type="checkbox"
> name="IdEntry"
> value="${doc.fullName}"/> This is checkbox
> <br />
>
> </div>
>
> <span
> class="buttonwrapper"><input
> type="submit" value="Supprimer les entrées
> du flux d'activité"
> class="button"/></span>
>
> </form>
>
> {{/html}}
>
>
>
> ## get select events ID
>
> $request.getParameterValues('IdEntry')
>
>
>
> ## i want to delete these ID
>
> #foreach ($MyValue in
> $request.getParameterValues('IdEntry'))
>
> * try to delete this event with ID: $MyValue
> $MyValue.getPage()
>
> ## $MyValue.getPage() it doesn't work because
> $MyValue is not event anymore
>
> ## delete event method
>
> :-(
>
> #end
>
> **********************************
>
>
>
> To resume, do you have a way to give an event object to my
> deleteActivityEvent with form+velocity (because
> deleteActivityEvent accept only event object) ?
>
>
>
> Thxs
>
>
>
> Pascal B
>
> _______________________________________________
>
> users mailing list
>
> users(a)xwiki.org
>
> http://lists.xwiki.org/mailman/listinfo/users
>
>
>
Hi,
I try to make an Admin form to delete some event from activity stream.
I manage:
- to list events in a checkbox list
- to delete an event
#foreach ($MonEvent in $xwiki.activitystream.getEventsForUser($MyUserr, false, 300, 0))
#if ($MonEvent.getPage()=='MySpace.MyPage')
* event deletion
$xwiki.activitystream.deleteActivityEvent($MonEvent)
#end
#end
- but I didn't manage to pass an event id/object with form to my deleteActivityEvent method :-(
It doesn't work because when I get my event through $request.getParameterValues('IdEntry'), event ID is transformed in text and is not event object anymore.
I use velocity with xwiki 7.0.1 and my page contains this code:
**********************************
{{velocity}}
{{html}}
## My form to select events to delete
<form method="get" id="DelActivityStream" onsubmit="return confirm('Are you sure?')">
<div class="container">
#foreach ($MonEvent in $xwiki.activitystream.getEvents(false, 200, 0 ))
##1. AAA $MonEvent - $MonEvent.getPage()
#set($MycheckBox="<input type='checkbox' name='IdEntry' value='")
#set($MycheckBox=$MycheckBox + "$MonEvent")
#set($MycheckBox=$MycheckBox + "'/>" + "$MonEvent.getPage() - $MonEvent.getDisplayDate() - $MonEvent.getType() - $MonEvent.getPriority() - $MonEvent.getUser() - $MonEvent.getEventId() - $MonEvent.getEvent() " + "<br />")
$MycheckBox
#end
## <input type="checkbox" name="IdEntry" value="${doc.fullName}"/> This is checkbox <br />
</div>
<span class="buttonwrapper"><input type="submit" value="Supprimer les entrées du flux d'activité" class="button"/></span>
</form>
{{/html}}
## get select events ID
$request.getParameterValues('IdEntry')
## i want to delete these ID
#foreach ($MyValue in $request.getParameterValues('IdEntry'))
* try to delete this event with ID: $MyValue $MyValue.getPage()
## $MyValue.getPage() it doesn't work because $MyValue is not event anymore
## delete event method
:-(
#end
**********************************
To resume, do you have a way to give an event object to my deleteActivityEvent with form+velocity (because deleteActivityEvent accept only event object) ?
Thxs
Pascal B
When I try to execute the database to filesystem porter tool in xwiki 7.4, I
see the following error:
Failed to execute the [groovy] macro. Click on this message
for details.
Can anyone suggest how to resolve or work around this problem?
My environment is Debian jessie, Postgresql 9.4, WAR file running on tomcat8
and openjdk-7
The details are below.
org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Script
Macro for content [import com.xpn.xwiki.doc.XWikiAttachment;
import com.xpn.xwiki.doc.XWikiDocument;
import com.xpn.xwiki.doc.DeletedAttachment;
import org.xwiki.store.legacy.doc.internal.ListAttachmentArchive;
import com.xpn.xwiki.store.XWikiAttachmentStoreInterface;
import org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore;
import com.xpn.xwiki.store.AttachmentVersioningStore;
import org.xwiki.store.legacy.store.internal.XWikiHibernateTransaction;
import com.xpn.xwiki.store.AttachmentRecycleBinStore;
import com.xpn.xwiki.web.Utils;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.XWiki;
import com.xpn.xwiki.XWikiException;
import org.xwiki.store.filesystem.internal.FilesystemStoreTools;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.hibernate.ObjectNotFoundException;
private void printIntro(final XWiki wiki)
{
println("= Filesystem attachment storage porting script =");
println("== Step 1: Switch to Filesystem attachments. ==");
boolean ret = isFilesystemStore(wiki.getAttachmentStore()) \
&& isFilesystemStore(wiki.getAttachmentVersioningStore()) \
&& isFilesystemStore(wiki.getAttachmentRecycleBinStore());
println(getStoreLine(isFilesystemStore(wiki.getAttachmentStore()),
wiki.getAttachmentStore()));
println(getStoreLine(isFilesystemStore(wiki.getAttachmentVersioningStore()),
wiki.getAttachmentVersioningStore()));
println(getStoreLine(isFilesystemStore(wiki.getAttachmentRecycleBinStore()),
wiki.getAttachmentRecycleBinStore()));
if (!ret) {
println("Please edit your xwiki.cfg file by modifying "
+ "the attachment store lines to read as follows:");
println("xwiki.store.attachment.hint = file");
println("xwiki.store.attachment.versioning.hint = file");
println("xwiki.store.attachment.recyclebin.hint = file");
println("Also make sure they are not commented out.");
}
println("== Step 2: Add this directory to your backup routine. ==");
println("This is your storage directory, "
+ "when filesystem attachments are enabled you have to back this up
"
+ "as part of your data backup routine.\n");
println(Utils.getComponent(FilesystemStoreTools.class).storageDir.getAbsolutePath());
println("== Step 3: Copy attachments from database to filesystem. ==");
println("Now you are ready to copy the data over from your database to
the filesystem. "
+ "It is prudent to leave the attachments in the database since this
is still experimental "
+ "and in most situations the attachment data is not bothersome just
sitting in the "
+ "database. As such, this script contains no facility to delete
entries from the database.");
println("If anything goes wrong in this function, it will fail with an
error message, "
+ "you should get the stack trace (probably in the log file) and
keep it to "
+ "confuse and humiliate the developers with. No harm should be done
since this only loads "
+ "from the database and only saves to the filesystem.");
}
main();
private void main()
{
final XWikiContext xc = xcontext.getContext();
final XWiki wiki = xc.getWiki();
int startAt = 0;
int seconds = 20;
boolean dryRun = true;
boolean verbose = false;
boolean go = request.getMethod().equals("POST") &&
request.getParameter("doIt") != null;
boolean ajax = "plain".equals(request.getParameter("xpage"));
int endedAt = 0;
if (!ajax) {
this.printIntro(wiki);
}
if (go) {
startAt = Integer.parseInt(request.getParameter("startAt"));
seconds = Integer.parseInt(request.getParameter("seconds"));
dryRun = "on".equals(request.getParameter("dryRun"));
verbose = "on".equals(request.getParameter("verbose"));
endedAt = this.doIt(startAt, seconds, dryRun, verbose, ajax);
if (ajax) {
if (endedAt == -1) {
this.printFooter();
} else {
println("\n{{html clean=false}}<meta name='endedAt'
content='"
+ endedAt + "' />{{/html}}");
}
return;
}
}
this.printJs();
if (!go || endedAt > startAt) {
println("\n{{html clean=false}}");
println("<div id='javascriptSpace'></div>");
println("<form action='?time=" + System.nanoTime()
+ "#doItForm' id='doItForm' method='POST'>");
println("<input type='hidden' name='seconds' value='" + seconds + "'
/>");
println("<input type='hidden' id='startAt' name='startAt' value='" +
endedAt + "' />");
println("<dl>");
println("<dt><label for='dryRun'>Dry Run, don't save any
files.</label></dt>");
println("<dd><input type='checkbox' name='dryRun' checked='"
+ ((dryRun) ? "checked" : "") + "' /></dd>");
println("<dt><label for='verbose'>Verbose, show every
attachment.</label></dt>");
println("<dd><input type='checkbox' name='verbose' checked='"
+ ((verbose) ? "checked" : "") + "' /></dd>");
println("</dl>");
println("<input type='hidden' name='doIt' value='yes' />")
println("<input type='submit' name='start' value='"
+ ((endedAt > startAt) ? "Continue" : "Start") + "' />");
println("</form>");
println("")
println("{{/html}}\n");
return;
}
this.printFooter();
}
private void printFooter()
{
println("== Step 4: make sure everything is working. ==");
println("Check to make sure your attachments are still there, if an
attachment is broken, "
+ "it will appear to be there but on opening it will tell you the
attachment does not exist. "
+ "If something goes terribly wrong with filesystem attachments, you
may have your old "
+ "attachment system back simply by changing the lines in the
xwiki.cfg file and restarting "
+ "the container. HOWEVER: This will not preserve attachments which
were uploaded **after** "
+ "switching to filesystem attachments so as users edit the system
you will become "
+ "locked in to filesystem attachments unless a script is written to
do the "
+ "inverse of this one.");
println("Despite being experimental, the filesystem attachment storage
is quite stable and the "
+ "risk of actually losing something so that it is unrecoverable is
very remote.");
println("NOTE: This must be run seperately in each subwiki.");
println("\n\nEnjoy and give feedback.");
}
private static boolean isFilesystemStore(final Object store)
{
return store.getClass().getName().contains("Filesystem");
}
private static String getStoreLine(final boolean isFilesystem, final Object
store)
{
return "(%style='color:" + (isFilesystem ? "#080" : "#d00") + "'%)(((* "
+ store + ")))";
}
private void printJs()
{
println("""\n{{html}}{{/html}}""");
}
/**
* Port all attachments from the original form to filesystem attachment
store.
* Do one batch at a time so the user can see the progress and it won't time
out.
*
* @param startAt the index of the first job to do, 0 to start at the
beginning.
* @param seconds the number of seconds to run for before returning.
* @param dryRun don't save any files if this is true.
* @return the number of the first job which was not done. This can be
startAt in the next call.
* -1 if the operation is complete.
*/
private int doIt(int startAt, int seconds, boolean dryRun, boolean verbose,
boolean ajax)
{
final XWikiContext xc = this.xcontext.getContext();
final XWiki wiki = xc.getWiki();
final FilesystemAttachmentStore fileAttachStore =
Utils.getComponent(XWikiAttachmentStoreInterface.class, "file");
final XWikiAttachmentStoreInterface defAttachStore =
Utils.getComponent(XWikiAttachmentStoreInterface.class,
"hibernate");
final AttachmentVersioningStore defAttachmentVersioningStore =
Utils.getComponent(AttachmentVersioningStore.class, "hibernate");
int count = 0;
long stopTime = System.currentTimeMillis() + (1000 * seconds);
println("(%style='color:#00d'%)(((");
if (verbose && startAt == 0) {
println("\n== Attachments ==\n");
}
for (String docName : xwiki.searchDocuments("where 1=1")) {
if (count < startAt) {
count++;
continue;
} else if (stopTime < System.currentTimeMillis()) {
println(")))");
return count;
} else {
count++;
}
final XWikiDocument doc = xwiki.getDocument(docName).getDocument();
try {
final XWikiHibernateTransaction transaction = new
XWikiHibernateTransaction(xc);
if (verbose) {
println("* [[" + doc.getFullName() + "]]");
}
// This is the equivilant of doc.getAttachmentList() but there
is an issue which
// causes some attachments to be lost.
// jira.xwiki.org/browse/XWIKI-7936
def hql = "select att from XWikiAttachment att WHERE
att.docId=?";
for (XWikiAttachment attach : xwiki.search(hql, [doc.getId()]))
{
attach.setDoc(doc);
if (verbose) {
println("** [[attach:" + doc.getFullName() + "@" +
attach.getFilename() + "]]");
}
try {
fileAttachStore.loadAttachmentContent(attach, xc,
false);
continue;
} catch (XWikiException noAttachmentInFilesystem) {
// no such attachment, let's save it.
}
try {
try {
defAttachStore.loadAttachmentContent(attach, xc,
true);
} catch (XWikiException notInHibernate) {
final Throwable wrapped =
notInHibernate.getException();
if (wrapped && wrapped instanceof
ObjectNotFoundException) {
println("(%style='color:#c80'%)(((");
println("Unable to find this attachment
[[attach:" + attach.getFilename()
+ "@" + doc.getFullName() + "]] in the
database, "
+ "it may be the result of database
corruption from a failed "
+ "upload prior to the fixing of "
+
"[[jira.xwiki.org/browse/XWIKI-5055]]");
println("xwikiattachment_content.XWA_ID = " +
attach.getId());
println(")))");
}
}
defAttachmentVersioningStore.loadArchive(attach, xc,
true);
try {
// jira.xwiki.org/jira/browse/XWIKI-6199
attach.getAttachment_archive().getVersions();
} catch (NullPointerException e) {
attach.setAttachment_archive(new
ListAttachmentArchive([attach]));
}
// Setup the runnables to do the save but don't save
just yet.
fileAttachStore.getAttachmentContentSaveRunnable(attach,
false, xc)
.runIn(transaction);
} catch (Exception e) {
println("(%style='color:#d00'%)(((");
println("Error in [" + doc.getFullName() + ":" +
attach.getFilename() + "]"
+ e.getMessage());
println(ExceptionUtils.getStackTrace(e));
println(")))");
}
}
if (!dryRun) {
transaction.start();
}
} catch (Exception e) {
println("(%style='color:#d00'%)(((");
println("Failed to port attachments for document [" +
doc.getFullName() + "]");
println(e.getMessage());
println(ExceptionUtils.getStackTrace(e));
println(")))");
}
}
println(")))");
if (startAt < count) {
int attachCount =
xwiki.search("select count(at) from XWikiDocument as doc, "
+ "XWikiAttachment as at where at.docId =
doc.id").get(0).intValue();
println("**[" + attachCount + "] attachments.**");
}
// And now for the deleted attachments.
final AttachmentRecycleBinStore fileBin =
Utils.getComponent(AttachmentRecycleBinStore.class, "file");
final AttachmentRecycleBinStore defaultBin =
Utils.getComponent(AttachmentRecycleBinStore.class, "hibernate");
if (verbose && startAt < count) {
println("\n== Deleted Attachments ==\n");
}
List<Object[]> entries =
xwiki.search("select da.id, da.docName, da.filename, da.date from
DeletedAttachment as da");
if (verbose && entries.size() == 0) {
println("\nnone.");
}
int delAttachCount = 0;
for (Object[] o : entries) {
long delAttachId = o[0];
final String docName = o[1];
final String fileName = o[2];
final Date deleteDate = o[3];
delAttachCount++;
if (count < startAt) {
if (verbose && !ajax) {
println("* [[" + docName + "]] - " + fileName);
}
count++;
continue;
} else if (stopTime < System.currentTimeMillis()) {
return count;
}
count++;
try {
final DeletedAttachment delAttach =
defaultBin.getDeletedAttachment(delAttachId, xc, true);
// Can't use the transaction runnable here because
(non-filesystem)
// deleted attachments hold all content in memory so they have
to be
// handled one at a time.
final XWikiAttachment attach = delAttach.restoreAttachment(null,
xc);
try {
// jira.xwiki.org/jira/browse/XWIKI-6199
attach.getAttachment_archive().getVersions();
} catch (NullPointerException e) {
attach.setAttachment_archive(new
ListAttachmentArchive([attach]));
}
if (!dryRun) {
fileBin.saveToRecycleBin(attach,
delAttach.getDeleter(),
delAttach.getDate(),
xc,
false);
}
if (verbose) {
println("* [[" + docName + "]]");
println("** " + fileName + " - Deleted: " + deleteDate);
}
} catch (Exception e) {
println("(%style='color:#d00'%)(((");
println("* [[" + docName + "]] - " + fileName + " - Deleted: " +
deleteDate);
println(e.getMessage());
println(")))");
println(ExceptionUtils.getStackTrace(e));
}
}
println("\n**[" + delAttachCount + "] deleted attachments.**");
return -1;
}]
at
org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:199)
at
org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:60)
at
org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:182)
at
org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
at
org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:269)
at
org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
at
org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:95)
at
org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:253)
at
org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:126)
at
org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:56)
at
org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96)
at
org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39)
at
org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:113)
at
org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:50)
at
org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68)
at
org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42)
at
com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1164)
at
com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1127)
at
com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1179)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:692)
at sun.reflect.GeneratedMethodAccessor562.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at
org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at
org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.xwiki.velocity.introspection.TryCatchDirective.render(TryCatchDirective.java:72)
at
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:256)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:725)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:626)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:604)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:570)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:556)
at
com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:65)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1876)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1854)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:821)
at sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at
org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at
org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:256)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:725)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:626)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:604)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:570)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:556)
at
com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:65)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1876)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1854)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:821)
at sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at
org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at
org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:256)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:725)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:626)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:604)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:570)
at
com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:556)
at
com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:65)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1876)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:431)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:184)
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:618)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:115)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:137)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
at
org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2340)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.script.ScriptException:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:
Script7.groovy: -1: Mixing private and public/protected methods of the same
name causes multimethods to be disabled and is forbidden to avoid surprising
behaviour. Renaming the private methods will solve the problem.
@ line -1, column -1.
Script7.groovy: 62: Mixing private and public/protected methods of the same
name causes multimethods to be disabled and is forbidden to avoid surprising
behaviour. Renaming the private methods will solve the problem.
@ line 62, column 1.
private void main()
^
2 errors
at
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:159)
at
org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.eval(AbstractJSR223ScriptMacro.java:340)
at
org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:249)
at
org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:194)
... 154 more
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed:
Script7.groovy: -1: Mixing private and public/protected methods of the same
name causes multimethods to be disabled and is forbidden to avoid surprising
behaviour. Renaming the private methods will solve the problem.
@ line -1, column -1.
Script7.groovy: 62: Mixing private and public/protected methods of the same
name causes multimethods to be disabled and is forbidden to avoid surprising
behaviour. Renaming the private methods will solve the problem.
@ line 62, column 1.
private void main()
^
2 errors
at
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1075)
at
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
at
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:254)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:212)
at
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:374)
at
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:151)
... 157 more
--
View this message in context: http://xwiki.475771.n2.nabble.com/Admin-Tools-database-to-filesystem-porter…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi users,
I am writing because I have an object in my Java code to be represented in
XWiki. My idea is to create an XClass and a related style sheet, then I
would create a Base Object for each object to be represented with a wiki
page.
I need to update the wiki every time the data structure that I have in Java
is modified but I can't understand how to do what I've written above.
Thank you,
Giordano.
On 18 Jan 2016 at 11:15:44, Gerritjan Koekkoek (gerritjan@cdlsworld.org(mailto:gerritjan@cdlsworld.org)) wrote:
>
> Could I do this in the params:
>
>
> label=abc
>
>
> target=Sandbox.try2
>
>
> icon=gerritjan.png
>
>
> test=$stringtool.split("item1, item2, item3", “ ,”)
>
> I tried to test it, but did not work?
It won’t work because the parameter values are not typed, they are strings.
So if you have:
#foreach ($uix in $services.uix.getExtensions(…))
#set ($params = $uix.parameters)
...
#end
then $params is always a String.
Thanks
-Vincent
PS: Please always reply to the list ;)
> The velocity part was:
>
>
> #set($items=$extension.getParameters().get('test'))
>
>
>
>
>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website(http://www.cdlsworld.org)
> Facebook(https://www.facebook.com/gerritjan.koekkoek)
> email(gerritjan(a)cdlsworld.org)
>
>
>
>
>
> From: Vincent Massol on behalf of vincent(a)massol.net
> Sent: 18 January 2016 10:46
> To: XWiki Users
> Cc: Gerritjan Koekkoek
> Subject: Re: [xwiki-users] Data-Types in UIExtension parameters
>
>
> Hi Gerritjan,
>
> On 18 Jan 2016 at 09:34:22, Gerritjan Koekkoek (gerritjan@cdlsworld.org(mailto:gerritjan@cdlsworld.org)) wrote:
> > Hi
> >
> >
> > I wonder if it is possible to use velocity data-types (Number, Date/Time, Array or List, Object) in the parameters field of a UIExtension.
> >
> >
> > I get the impression it is always considered as string and we have to do a conversion?
>
> I’ve updated the UIX Module documentation at
> http://extensions.xwiki.org/xwiki/bin/view/Extension/UIExtension+Module#HMo…
>
> So yes, the parameters field can contain velocity.
>
> > Following example (for a List of items in a Array)
> >
> > cdls.try.abc has the following parameters:
> >
> >
> > label=abc
> >
> > target=Sandbox.try2
> >
> > icon=gerritjan.png
> >
> > test=["Item1", 'item2', "item3"]
> >
> >
> > {{velocity}}
> >
> > $services.uix.getExtensions("cdls.try.abc")
> >
> >
> > #foreach ($extension in $services.uix.getExtensions("cdls.try.abc"))
> >
> > $services.rendering.render($extension.execute(), 'xhtml/1.0')
> >
> > #set($paramlist=$extension.getParameters().get('test'))
> >
> > #end
> >
> >
> > paramlist is String?: $paramlist.class
> >
> >
> > ##Would like it to be a list of items, but now I have to use velocity string functions to create the list...
> >
> > #set($paramlistLengthMinusOne = $paramlist.length() - 1)
> >
> > #set($items = $paramlist.substring(1, $paramlistLengthMinusOne).split(","))
> >
> >
> > #foreach($item in $items)
>
> [snip]
>
> That’s correct, UIX parameters are not typed (they’re strings).
>
> However you can simplify a lot your velocity code.
>
> In the UIX:
> test=item1, item2, item3
>
> In the calling code:
> #set ($paramlist = $extension.getParameters().get('test'))
> #set ($items = $stringtool.split($paramList, “ ,”))
> …
>
> Thanks
> -Vincent
>
> > Gerritjan Koekkoek
> > Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
>
Hi
I wonder if it is possible to use velocity data-types (Number, Date/Time, Array or List, Object) in the parameters field of a UIExtension.
I get the impression it is always considered as string and we have to do a conversion?
Following example (for a List of items in a Array)
cdls.try.abc has the following parameters:
label=abc
target=Sandbox.try2
icon=gerritjan.png
test=["Item1", 'item2', "item3"]
{{velocity}}
$services.uix.getExtensions("cdls.try.abc")
#foreach ($extension in $services.uix.getExtensions("cdls.try.abc"))
$services.rendering.render($extension.execute(), 'xhtml/1.0')
#set($paramlist=$extension.getParameters().get('test'))
#end
paramlist is String?: $paramlist.class
##Would like it to be a list of items, but now I have to use velocity string functions to create the list...
#set($paramlistLengthMinusOne = $paramlist.length() - 1)
#set($items = $paramlist.substring(1, $paramlistLengthMinusOne).split(","))
#foreach($item in $items)
<h1>"$item.replace('"',"")"</h1>
#end
{{/velocity}}
Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerritjan(a)cdlsworld.org>
Hi,
I'm a real novice, so please forgive my question if it is trivial.
I've created a simple app with App Within Minutes, and I'd like to
customise it a little. For example I have a boolean checkbox and a
user selector with the app, which I'd like to be disabled (uneditable)
for all users except my manager. So that only the manager can edit the
assigned users to a 'task' and mark the task as complete. I'd also
like a second user selector to default to the currently logged in
user.
I've spent a few days googling the problem, and I've come across
information in the xwiki mailing archive etc which makes me think that
it is possible to run checks against the current user using velocity
or groovy scripts embedded in one of the app sheets and modify the
respective elements. But I don't really understand how.
Can this actually be done?
Can anyone direct me to a resource that would clear this up for me? Or
give me an example code snippet and simple directions for its
implementation i.e. what sheet they should be inserted into? A real
idiot's guide
I'd really appreciate any help you could give me,
Thanks
Danny
Hi users,
Today I am wondering about how to create, inside a wiki page, a drop down
menù containing all the child pages of another space.
Any idea?
Giordano.
Hi devs,
I am developing a sort of UI for my java component and I have encountered a
problem:
In a wiki page I've put some input text boxes(i.e. *Page name: <input
type="text" name="pName" >*) in which the user will insert the information
needed by the method that I want to invoke from Velocity when I push a
button.
I have tried some solution but I don't know how to do that, following the
code in my page:
*{{velocity}}*
*#if("$!request.create" == 1)*
* $services.evoS.addInstance("$type", "$pName", "$description")*
*#end*
*{{html}} *
* <form action="" id="dataForm" method="POST">*
* Page name: <input type="text" name="pName" value="$!pName"><br>*
* Description: <input type="text" name="description"
value="$!description"><br>*
* Type: <input type="text" name="type" value="$!type"><br>*
* <div>*
* <input type="hidden" name="create" value="1"/> *
* <span class="buttonwrapper">*
* <input type="submit" value="Create" class="button"/>*
* </span>*
* </div>*
*</form> *
*{{/html}}*
* {{/velocity}}*
Thank you,
Giordano.
Hi users,
I have a problem with my Java component. I have a hjava method wich take as
input 3 strings: wikiName, wikiSpace and the wiki page to retrieve the doc,
thus the content and perform modification.
Ok, when I try to delete a terminal page inside a nested page, there is no
problem, the component retrieve the page's document and can delete it, it
works!
But when I want to delete a terminal page that is inside a nested page
which is inside another nested page it stops working. The point is that I
can't retrieve the terminal page's document, probably because of the
wikiSpace variable.
I have tried "NestedPage1.NestedPage2" but it is not woking at all, it is
keep creating and successively deleting new documents(thus pages).
Thank you,
Giordano.
I can't get my attachment limit above 4Mb. I am running 7.4 on Tomcat 8 with MySQL5.6 all running on Server 2012 R2.
I have included screenshots of the current settings in Xwiki and MySQL
Xwiki Maximum Upload Size = 3000000000
MySQL max_allowed_packet = 900M
Any help would be greatly appreciated.
Joshua Spiva I.T. Manager
1411 Twin Oaks Street, Wichita Falls, TX 76302
tel: (940) 322-2206
dir: (940) 264-9114
jspiva(a)emdinc.com
We are running XWiki Enterprise 7.3 and I would like to enable a 'login
timeout'. Currently the users stay logged in even after the browser has
been closed, which poses a security threat. So how do I set an idle time
after which the users are logged out?
Thanks!
RBG
--
View this message in context: http://xwiki.475771.n2.nabble.com/How-do-I-enable-login-timeout-tp7597463.h…
Sent from the XWiki- Users mailing list archive at Nabble.com.