Je suis absent(e) du bureau jusqu'au 15/06/2016
Je suis actuellement en congés.
En cas d'urgence, merci de contacter le Support Technique Isocel
support-technique(a)isocel.info ou Tel: 05 24 54 99 61
Remarque : ceci est une réponse automatique à votre message "[xwiki-users]
Filesize limits for fileUpload plugin" envoyé le 23/05/2016 05:16:36.
C'est la seule notification que vous recevrez pendant l'absence de cette
personne.
Hi,
I have a Groovy script in my XWiki 7.1.1 site that reads files sent to it. I've been using the fileUpload plugin as shown below.
{{groovy}}
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.commons.io.IOUtils;
import org.apache.commons.fileupload.FileItem
// Function to actually read the file data from file.getInputStream();
def processFile(String filename, FileItem file, String title) { ... }
def params = request.getParameterNames().toList()
def fileUpload = xwiki.fileupload
def results = [:]
if (!(params.contains("title"))) {
results.put('error',"No title specified")
} else {
fileUpload.loadFileList(2147483648L, 100000, (String) (xcontext.getContext().getWiki().Param("xwiki.upload.tempdir")))
FileItem fileItem = fileUpload.getFileItems().find {it.getFieldName().equals("newfile")}
if (fileItem == null) {
results.put('error',"Couldn't load file - did you forget to choose one?")
} else {
results = processFile(fileUpload.getFileName("newfile"), fileItem, request.getParameter('title'))
}
}
// Handle display of results based on how script was called
def jsontool = new org.xwiki.velocity.tools.JSONTool()
if (request.getParameter('outputSyntax') == 'plain' || request.getParameter('xpage') == 'plain') {
response.setContentType('application/json')
if (results.error) {
response.setStatus(400)
}
print jsontool.serialize(results)
} else {
if(results.error) {
println "{{error}}${results.error}{{/error}}"
} else {
println "{{success}}File processed{{/success}}"
}
println "Return to [[Original page>>${request.getHeader('referer')}]]";
}
{{/groovy}}
Files are sent to this page via a form:
<form action="FileProcessor" method="post" enctype="multipart/form-data">
<input type="file" name="newfile" />
<input type="hidden" name="title" value="foo" />
<button type="submit">Upload</button>
</form>
The files I need to read can sometimes be large (~1GB), which is why the call to fileUpload.loadFileList explicitly gives a large maximum file size (10GB, although I don't expect files to reach this size for the time being). However, this limit seems to get ignored: when files exceed the limit specified in the Maximum Upload Size setting on xwiki/bin/edit/XWiki/XWikiPreferences?editor=object the script fails at the step (!(params.contains("title"))) { ...
This is despite the title definitely being set. My guess is the an exception gets thrown by the File Upload plugin that causes the parameters to fail being processed - when I increase the upload limit from 32MB to 50MB the problem goes away for a 47MB file, for instance.
So problem 1: is there a way to get fileUpload.loadFileList to respect the file limit I specify? I don't want to allow very large files to be included in attachments, so it would be nice if I can leave the default setting lower.
Then comes problem 2: Even if I do set the maximum size to something very large, I get a similar problem for files over about 500Mb. I've tried testing just uploading such files as attachments and I end up with a page saying "waiting for server confirmation", and then "an error occurred while uploading the file". Digging around in the Tomcat logs I see exceptions containing:
Caused by: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. No space left on device
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:351) ~[commons-fileupload-1.3.1.jar:1.3.1]
at com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.loadFileList(FileUploadPlugin.java:248) ~[xwiki-platform-legacy-oldcore-7.1.2.jar:na]
... 47 common frames omitted
Caused by: java.io.IOException: No space left on device
at java.io.FileOutputStream.writeBytes(Native Method) ~[na:1.7.0_79]
at java.io.FileOutputStream.write(FileOutputStream.java:345) ~[na:1.7.0_79]
at org.apache.commons.io.output.ThresholdingOutputStream.write(ThresholdingOutputStream.java:129) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.fileupload.util.Streams.copy(Streams.java:107) ~[commons-fileupload-1.3.1.jar:1.3.1]
at org.apache.commons.fileupload.util.Streams.copy(Streams.java:70) ~[commons-fileupload-1.3.1.jar:1.3.1]
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:347) ~[commons-fileupload-1.3.1.jar:1.3.1]
... 48 common frames omitted
Looking at this I see that there is probably an earlier call to loadFileList with default values, which is probably why my first problem was occurring. I can't see where this is being called - probably the crucial info is in one of those 48 omitted frames. My guess is that it's in com.xpn.xwiki.web.Utils.handleMultipart
Also, looking in https://github.com/xwiki/xwiki-platform/blob/7392653655d1a8524c67851393b0ac… it appears that all files in a request are processed using org.apache.commons.fileupload.FileUploadBase.parseRequest() which writes all files to file, which I'm guessing is the ultimate problem once files get too big to store in temporary storage. Is there any way that I can use the streaming API http://commons.apache.org/proper/commons-fileupload/streaming.html instead?
Thanks,
Bryn
I just released a version 7.4-1 of the helper to use as parent in
contrib Maven projects.
Fix two issues with enforcer plugin (for platform projects).
See https://github.com/xwiki-contrib/parent for more details about the project.
--
Thomas Mortagne
In our Xwiki, I've added some fields such as birthday (of type Date) to the
user profile. I'd like to implement a REST call that retrieves all of the
non-hidden users with birthdays in a specific month (typically the current
month) and some specific attribute values. Right now the values I want are
the first name, last name, birthday and the link to the avatar image file. I
have bits and pieces of the solution but am having trouble with some parts -
specifically how to put it together into a single REST call.
PROBLEM 1: I can create a page with a script like the following to filter
some users and display their names.
{{velocity}}
#set ($tags=$services.query.xwql("select obj.first_name from Document doc,
doc.object(XWiki.XWikiUsers) as obj where (obj.first_name LIKE '%a%' and
(doc.hidden <> true OR doc.hidden is null))").execute())
$tags
{{/velocity}}
But if I try to execute that query in a REST call like the following, the
result is different
.../rest/wikis/query?q=select+obj.first_name+from+Document+doc%2C+doc.object%28XWiki.XWikiUsers%29+as+obj+where+%28obj.first_name+LIKE+%27%25a%25%27+and+%28doc.hidden+%3C%3E+true+OR+doc.hidden+is+null%29%29&type=xwql
The REST call returns some data completely unrelated to the users:
<searchResults
template="http://...rest?q={solrquery}(&number={number})(&start={start})(&orderField={fieldname}(&order={asc|desc}))(&distinct=1)(&prettyNames={false|true})(&wikis={wikis})(&className={classname})"><searchResult><link
href="http://...rest/wikis/xwiki/spaces/XWiki/pages/DocumentTreeMacros"
rel="http://www.xwiki.org/rel/page"/><type>page</type><id>xwiki:XWiki.DocumentTreeMacros</id><pageFullName>XWiki.DocumentTreeMacros</pageFullName><wiki>xwiki</wiki><space>XWiki</space><pageName>DocumentTreeMacros</pageName><modified>2016-02-15T12:14:34-03:00</modified><author>xwiki:XWiki.Admin</author><version>4.1</version><score>0.62450576</score></searchResult><searchResult><link
href="http://...rest/wikis/xwiki/spaces/XWiki/pages/DocumentTree"
rel="http://www.xwiki.org/rel/page"/><type>page</type><id>xwiki:XWiki.DocumentTree</id><pageFullName>XWiki.DocumentTree</pageFullName><wiki>xwiki</wiki><space>XWiki</space><pageName>DocumentTree</pageName><modified>2016-01-27T10:23:05-03:00</modified><author>xwiki:XWiki.Admin</author><version>2.1</version><score>0.5804536</score></searchResult><searchResult><link
href="http://...rest/wikis/xwiki/spaces/Panels/pages/DocumentInformation"
rel="http://www.xwiki.org/rel/page"/><type>page</type><id>xwiki:Panels.DocumentInformation</id><pageFullName>Panels.DocumentInformation</pageFullName><wiki>xwiki</wiki><space>Panels</space><pageName>DocumentInformation</pageName><modified>2016-01-12T09:56:52-03:00</modified><author>xwiki:XWiki.superadmin</author><version>1.1</version><score>0.4841085</score></searchResult>
PROBLEM 2: If I try to implement a query that retrieves multiple fields from
the user profile like the following:
{{velocity}}
#set ($tags=$services.query.xwql("select obj.first_name, obj.last_name,
obj.birthday from Document doc, doc.object(XWiki.XWikiUsers) as obj where
(obj.first_name LIKE '%a%' and (doc.hidden <> true OR doc.hidden is
null))").execute())
$tags
{{/velocity}}
the data displayed in the xwiki page looks like the following instead the
actual attribute values:
[[Ljava.lang.Object;@723f4d95, [Ljava.lang.Object;@4054e1bb,
[Ljava.lang.Object;@436c8d04, [Ljava.lang.Object;@5c93ddc1,
[Ljava.lang.Object;@54c86023, [Ljava.lang.Object;@33760a38,
[Ljava.lang.Object;@14d5b5ff, [Ljava.lang.Object;@566a1f71,
[Ljava.lang.Object;@41b4b4e7, [Ljava.lang.Object;@42904123,
[Ljava.lang.Object;@7b536ec3, [Ljava.lang.Object;@7d44674f,
[Ljava.lang.Object;@1933e78c, [Ljava.lang.Object;@59ea34d0,
[Ljava.lang.Object;@392f7c58, [Ljava.lang.Object;@678f1a2d,
[Ljava.lang.Object;@61868ed7, [Ljava.lang.Object;@69426a83,
[Ljava.lang.Object;@2bcd164f, [Ljava.lang.Object;@340c3f69,
[Ljava.lang.Object;@6129ef09, [Ljava.lang.Object;@1b4587dd,
[Ljava.lang.Object;@58799594, [Ljava.lang.Object;@d5b1e85,
[Ljava.lang.Object;@2324f980, [Ljava.lang.Object;@1468f956,
[Ljava.lang.Object;@290b7a]
Regards
Mark Sack
--
View this message in context: http://xwiki.475771.n2.nabble.com/REST-query-to-fetch-filtered-list-of-user…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I'm using the REST API to get the wiki users as per the example in
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI
i.e.
http://<server>/xwiki/rest/wikis/query?q=object:XWiki.XWikiUsers
This only returns 10 of the users in the wiki database. If I make the call
using curl, it returns 10 non-hidden users. If I make the call from a
browser, it returns almost the same set of 10 users except that 2 of them
are replaced with hidden users.
I can get around this by adding the start and number parameters to the query
and then repeating the call incrementing the start parameter until nothing
is returned.
This leads to a number of questions.
1. Is there a way to adjust the default limit of 10 results other than using
the number parameter?
2. Is there a way to get the count of the total number of users using the
REST API?
3. Is there an explanation for the different behaviour between curl and the
browser? Which behaviour should I expect if making the call from another
application (eg. Rails)?
4. Is there a more elegant way to get all of the users through the API?
5. Is this documented somewhere that I've missed or would it be useful to
add a comment to the RESTful API page?
6. Niggly point regarding the REST API page. In some places, the start
parameter is labeled as 'n' and in others as 'offset'. I assume this is
perhaps an artefact of updates by different authors. Should it really be
'offset' everywhere or is the distinction intentional?
Regards
Mark
--
View this message in context: http://xwiki.475771.n2.nabble.com/REST-query-returns-subset-of-results-tp75…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I have been looking everywhere for an article or an addon for this function. Has anyone managed to find a way to add a simple button or menu options to email the page via Outlook? My users really want to have the articles they are sending out in their own mailboxes as a sent item.
Please remove me from your email list. I have tried to do this through the unsubscribe link and it's been unsuccessful. Thank you for your help. Dld07sierra(a)gmail.com
Sent from my T-Mobile 4G LTE Device
1. The "tags" feature display a lot of jumbled text.
For example:
"运营" displays as "è¿è¥", if I click "è¿è¥", it becomes "è¿ÂèÂÂ¥", much worse.
2. The "Solr Search" feature display a log of jumbled text.
For example:
"表格" displays as "表格" in the search result page.
And of couse, it returns no hitted page, but it is actually appeared in the default "Sandbox" chinese page.
For example:
3. The Chinese Sandbox, incorrectly use ">" instead of ">" in wiki source text.
For example:
[[沙箱测试页面1>>Sandbox.TestPage1]]
Should be:
[[沙箱测试页面1>>Sandbox.TestPage1]]
For example, I have a page called “基础品质及小垂直团队”
The URL is ‘http://mysite/xwiki/bin/view/web_product/基础品质及小垂直团队/’
In the “Rename” Action, I can see both “Title” and “Page Name” is “基础品质及小垂直团队”
But, In the “Administrator Page”, its location shows: “EVA小组(评估、分析、垂直等)/ Preferences”,
and title is “Administration: web_product.基础品质及小垂直团队”
and URL is “…/xwiki/bin/admin/web_product/基础品质及小垂直团队/WebPreferences”
“EVA小组(评估、分析、垂直等)” is the old name of this page, I donot know why it is still here.
Version: XWiki-7.4.3, Mac Safari 9.1.1, Firefox 38.7.1esr
A encoding bug of page administration page.
When I do administrator a Chinese title page, click any label twice, the page would jump to a invalid page.
For example:
At beginning:
You can see: there is no left panel.
First Click at “Rights: Page”
It seems OK, and left panel appears:
Second Click at “Rights: Page”
It jumps to a invalid page with invalid title.
Per the Query Module documentation:
List of child spaces: select space.name from XWikiSpace as space where space.parent = 'Parent Space’
List of all nested documents in a space: where doc.space like 'Space' or doc.space like 'Space.%’
The first gives me the correct spaces but I want the documents (WebHome) and the second gives me every single document in every space below ‘Space’. How do you query for just the documents in the immediate child spaces? Anything I do to narrow the results seems to give me no results and no error. Thanks for any help.
Regards,
Jesse
Hi all,
could someone please help me to find a way to script the creation of new
wiki pages from data/text saved in html files?
I’m trying to (semi)automatically organize and upload data to new wiki
pages, i.e. analyze and plot data with an external program, sve the
information (including page name, etc.) in a html file, and then have some
sort of script take the html file – or objects from it – and create a wiki
page. It doesn’t have to be fully automatic and include a scheduled service
or similar, a script that I can run every day would be fine.
I did look for hints but I guess I’m too much of a beginner to piece
everything together. I found
http://extensions.xwiki.org/xwiki/bin/view/Extension/Create+Page+With+Object
which tells me that I can script a page creation.
Now my naïve question is: Where do I script this? I am not familiar with
Velocity (Python is my only scripting language), but willing to learn. From
what I could see in tutorials like
http://platform.xwiki.org/xwiki/bin/view/DevGuide/XWikiVelocityTraining I
put the velocity text in a wiki page (as opposed to run it in a terminal or
via some application outside of the wiki pages?
Does that mean I create a ‘control’ page with a script that’ll grab data and
creates new pages? I f so, it would be great if someone can point me to an
example.
Thank you
Sebastian
--
View this message in context: http://xwiki.475771.n2.nabble.com/How-to-programmatically-create-pages-from…
Sent from the XWiki- Users mailing list archive at Nabble.com.
I am currently trying to Filter my userlist
#set($users = $xwiki.rightsmanager.usersApi.allUsers)
#foreach($user in $users)
#if(($xwiki.getUser($user).isUserInGroup("XWiki.GroupName"))&& $xwiki.getUser($user).position !="StringExample")
{{section justify="true"}}
It should show me all users except of those with String I defined in if within position section.
sadly the second part of IF is being ignored. Users with String are still shown.
Thanks =)
Oli
I found a nice way to translate $language into pretty language name in the translation desired.
{{velocity}}
#displayLanguagePrettyName("it")
#macro(displayLanguagePrettyName $language)#set($languageLocale = $services.localization.toLocale("it"))$stringtool.capitalize($languageLocale.getDisplayName("nl"))#end
{{/velocity}}
So changing the 'nl' to 'pt' (portugese) it will do
Italiaans (dutch) -> Italiano (portugese)
Ca the same be done for country?
Italië (dutch) -> Itália (Portuguse)
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>
Hello XWiki users and devs,
The current xwiki.org blog [1] contains mostly release notes announcements,
Bug Fixing Days results and some occasional events that XWiki has taken
part of.
We would like to pump some life into it by encouraging community members to
post articles and news related to the XWiki ecosystem so that everybody can
have a better view of what`s going on.
It can be anything XWiki-related:
* a tutorial / how-to,
* a feature presentation,
* an event where XWiki was presented,
* an extension that you have worked on and published on extensions.xwiki.org
,
* tips and tricks on how to boost productivity with XWIki,
* a real-life problem that was fixed with XWiki,
* news about some public/government agency or even high-profile private
company adopting XWiki,
* etc.
Also, you don`t necessarily have to be a technical person to show your love
for XWiki :)
Anyone interested would have to do it as an individual, member of the
community, using their xwiki.org account. We do not care what company you
are from, as long as your article has content that is interesting/valuable
for the XWiki community.
You should obviously avoid writing SPAM articles, promoting irrelevant
products and generally off-topic stuff.
Here is how to do it in a few easy steps:
1. Log in with your xwiki.org account and go to the Blog Drafts [2] section
2. Create a new sub-page there (use the + button) and write your article.
Don`t forget to save!
3. Contact an XWiki committer either by mail (users or devs list) or by IRC
[3], give them the link to your draft and ask them for a review it.
4. If the review is successful, the article gets moved to the main Blog [1]
and published.
You could view it as a sort of "Pull Request", but for blog articles :)
Note: We also accept cross-posting! You can also share an article on XWiki
that you have written on some other blogging platform. You can post it
entirely or just do a quick summary about it and link to its original
location.
We hope to see some interesting articles and to increase visibility on what
people are achieving with XWiki!
Thanks,
Eduard
----------
[1] http://www.xwiki.org/xwiki/bin/view/Blog/
[2] http://www.xwiki.org/xwiki/bin/view/Blog/Drafts
[2] http://dev.xwiki.org/xwiki/bin/view/Community/IRC
Hello:
I have an app within minutes that is a collection of procedures. I want the
procedures to display differently than the rest of the wiki, specifically I
want to override the title of the pages. So each page is named with a number
like "QP-001"; there is also a field in the class called "title", which is
the actual title of the procedure. By keeping the page name separate from
the title, I can allow the user to change the title without changing the
procedure number (which once created should never change). So What I want to
do is combine the page name and title into one and display it as the page
name, like "QP-001 Procedure of all things".
How do I override the skin for any page that is displayed with the Class
Sheet? is there a worked out example somewhere? I've been reading the wiki
pages on overriding the skin, but I'm not sure how to apply it to my need.
Dan
--
View this message in context: http://xwiki.475771.n2.nabble.com/Overriding-skin-for-a-class-sheet-tp75994…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Using the 'rename' feature, I moved a page from one location from under Home
to under a different page. However, I learned about the tagging feature
after that and thought it would be better to use that. So, I wanted to move
the page back to under Home, but I get the error "Error: A page with the
given name (name of my page.WebHome) already exists. Please provide a
different name". When I try to visit the page under Home, I'm redirected to
the Home page rather than shown a screen for creating a new page (what
usually happens when I try to visit a page that shouldn't exist). How do I
move the page back to under Home?
--
View this message in context: http://xwiki.475771.n2.nabble.com/Moving-a-page-back-tp7599407.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
I think I've made a mistake on my wiki. Since I don't have much content yet, I'd like to delete my wiki and start a new one. However, there are some pages that seem to not exist, yet exist in the sense that they don't show up on any list, but redirect me to the home page when I access them rather than present me with a screen for making a new page, so I can't make new pages under their name. What would be the easiest way to restore my wiki to the state it was in when I first installed XWiki?
Hi
I'm struggling to understand the relationship between the code generated by App-With-Minutes for the Sheet and the Generated translation files; Especially if I want to rename application, page, class) (or copy it to another wiki)
#set ($discard = $services.localization.use('document', 'WaihonaCode.qbgTranslations'))
(% class="xform" %)
(((
; <label for="WaihonaCode.qbgClass_0_date1">$escapetool.xml($doc.displayPrettyName('date1', false, false))</label>
: $doc.display('date1')
...
)))
The space WaihonaCode is where class, sheet and template are located
'date1' is the class attribute we need a translated text
This is what is generated in the translation file:
# Class fields
WaihonaCode.qbgClass_date1=Date
Since we do not see any $services.localization.render("date1") i'm uncertain how the key is created? (what logic is applied?)
Why is there: $escapetool.xml($doc.displayPrettyName('date1', false, false))?
Why escape tool?
what is the function of the method displayPrettyName('date1', false, false))?
Is there any client side functionality (JavaScript) required for this to work?
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>
Hello:
I created an app with App Within Minutes, but I have customized the View and
Edit Class Sheets. Now I have separate View and Class sheets. I wanted a
third Class Sheet only used for printing, because the TOC makes no sense
while printing. I tried creating a third Class Sheet, bound it to the Class,
and then set its SheetDescrptorClass Action to "print" thinking that that
would work. It doesn't. Can this be done?
Dan
--
View this message in context: http://xwiki.475771.n2.nabble.com/Actions-for-Class-Sheets-tp7599424.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
I am shopping around for a Wiki and I believe XWiki is the one.
Before I commit I have a few questions:
What programing language is used (can I use C#)?
Does it run on IIS?
Does it require a database or can it be a file system?
Thanks for your time.
Best regards,
Dave D.
hello:
When you add a page in App Within Minutes, it prompts you for a page name. I
want to create this name automatically, how can I override this behavior so
that it goes straight to the class sheet for edit without asking for page
name?
Dan
--
View this message in context: http://xwiki.475771.n2.nabble.com/Override-App-Within-Minutes-behavior-tp75…
Sent from the XWiki- Users mailing list archive at Nabble.com.