I am writing a macro that performs a relatively expensive calculation
to generate content for display (a PNG image) based on user input. The
basic macro works fine, but I'd like to cache the generated content to
save recalculating it when I don't need to.
My idea is that I generate a SHA1 digest of the macro content, and
persistently cache the output generated for that input. I'm thinking
of using an LRU cache to avoid keeping massive amounts of data that'll
never get used again. The question I have is where I can put the cache
so that it is saved with the page, and I can access and update it from
the macro code. I suspect that the answer is to attach an object to
the page somehow, but I've been looking round the documentation and
can't find any examples of how I might do this (TBH, I'm struggling to
find my way round the documentation, so it may be that I've missed
something obvious - if so, then by all means point me to the right
place :-))
As the object is a PNG image, I'm currently base64-encoding it, and
using a data URL to display it. But if it's possible to cache the data
in such a way that the raw data is (or can be made) directly
addressible via a URL, that would be even better.
Can anyone help?
Thanks,
Paul.
When I try to use Maven as described in the tutorial, I get an error:
PS D:\Data\Java\x> mvn archetype:generate
-DarchetypeArtifactId=xwiki-commons-component-archetype
-DarchetypeGroupId=org.xwiki.commons -DarchetypeVersion=3.3
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.130s
[INFO] Finished at: Mon May 28 16:35:02 BST 2012
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there
is no POM in this directory (D:\Data\Java\x). Please verify you
invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
I'm a little concerned about the "-DarchetypeVersion=3.3" flag. I'm
using XWiki 4.0. Is this page out of date?
Sorry if I haven't given the right details, I haven't used Maven
before so I'm not sure what I should do next.
Paul.
Hi, all,
I am trying to add buttons on the wysiwyg or inline form editor toolbar, I
checked the wysiwyg gwt source code, and the wysiwyg.js file, I am more
toward add javascript code in wysiwyg.js file to add javascript code for
buttons on the toolbar, instead of adding java code for the plugin, any
suggestions?
Thanks in advance
Dave
Hi All,
I want to set the view deny permission on specific page for group
XWikiAllGroup through groovy script. This is my groovy script i tried
Document docSetSearchableRights=xwiki.getDocument("Xwiki.User1")
if(docSetSearchableRights!=null)
{
com.xpn.xwiki.api.Object
rightsToSearchObject=docSetSearchableRights.newObject("XWiki.XWikiRights")
rightsToSearchObject.set("groups", "XWiki.XWikiAllGroup")
rightsToSearchObject.set("levels", "view")
rightsToSearchObject.set("allow", "0") // also tried value 2 but does
not work.
docSetSearchableRights.save()
}
Above i am trying to set view deny permission to group XWiki.XWikiAllGroup
on page Xwiki.User1. But when i go access rights section of User1 page, i
do not see deny permission set on view for group XWikiAllGroup.
For information, The reason i am doing it is i do not want user profiles
visible in serach results. i was able to do it from xwiki ui by edit the
access rights of that page and deny the view permission of that user
profile page to XWikiAllGoup . But in the question, i am trying to do it
from groovy script.
I've been having real problems accessing xwiki.org and the API
documentation over the last few days. Proxy timeouts seem to be
happening all the time, and I haven't been able to get at the API docs
most of today. Two questions:
1. Is there an issue?
2. Is there an offline copy of any of the docs (even just the API docs
would be a start) that I can download and use locally?
An export of the XWiki platform wiki, plus a zipped copy of the API
docs, would be ideal. From what I've been able to find on Google, they
don't seem to exist as far as I can tell.
Paul.
Hi Folks,
i want to export the specific space.For this i was suggested
xwiki-importexport-1.3 application at
http://extensions.xwiki.org/xwiki/bin/view/Extension/Import+Export+Applicat….
But as upload this application and go to export page. Then select the space
, no page appears from selected space. Basically on selection of space in
dropdown, nothing happens.
Then i tried to look in to issue and looks like application at above link
does not contain all pages like webhome. Because when go dashboard page , i
see question mark(?) in front
of admin space. Probably this can be the reason that this application is
not working for me.
For your information , after import of xwiki-importexport-1.3 application
, i just see 7 xml files and here are the names:-
1)Export
2)ExportFromDate
3)ExportFromDateGroovy
4)ExportPage
5)ExportPageSuggest
6)ExportSpaceSuggest
7)ImportPage
Let me know if this application contains only 7 pages. If more , can
someone point me to right link for application or send me the application
as attachment.