Re: [xwiki-users] Can't make big uploads?

2015-01-12 Thread Thomas Mortagne
Well that stack trace don't look like filesystem attachment storage
stack trace. Attachment archives are handled by ListAttachmentArchive
so we should have seen a ListAttachmentArchive#updateArchive call
instead of the
XWikiAttachment.updateContentArchive call.

I agree that your configuration looks right so not sure why you don't
end up in the filesystem attachment store code.

On Mon, Jan 12, 2015 at 10:05 AM, Paul Libbrecht  wrote:
> Thomas,
>
> I believe I am using the filesystem attachment. At least that's when I 
> thought when using the following configuration:
>
>> # enable attachment filesystem storage
>> xwiki.store.attachment.hint=file
>> xwiki.store.attachment.versioning.hint=file
>> xwiki.store.attachment.recyclebin.hint=file
>
> Any other way for me to proof?
>
> thanks
>
> Paul
>
>
> On 12 janv. 2015, at 09:38, Thomas Mortagne  wrote:
>
>> When saving an attachment XWikiAttachment.updateContentArchive produce
>> a base 64 String of the attachment (so a lot bigger than the
>> attachment size) before copy it again as String[] (so again double the
>> size in memory) and then sending it to the database (which is not
>> quite the streamed thing you would expect in case of MySQL for
>> example). There is thing that can be improved (but not much we can do
>> about non streaming MySQL connector) but yes currently default
>> attachment store is not exactly great to store 600 Mb files unless you
>> allocate a looot of memory to your XWiki instance.
>>
>> Filesystem attachment should support it well (been made just for this
>> kind of use case after all), see
>> http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HFilesystemAttachmentStore.
>
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users



-- 
Thomas Mortagne
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Can't make big uploads?

2015-01-12 Thread Caleb James DeLisle
The error makes it look like FSAttach is disabled.
Check for files existing in the Permanent Storage directory in the server's 
filesystem.

Thanks,
Caleb

On 01/12/2015 10:05 AM, Paul Libbrecht wrote:
> Thomas,
> 
> I believe I am using the filesystem attachment. At least that's when I 
> thought when using the following configuration:
>   
>> # enable attachment filesystem storage
>> xwiki.store.attachment.hint=file
>> xwiki.store.attachment.versioning.hint=file
>> xwiki.store.attachment.recyclebin.hint=file
> 
> Any other way for me to proof?
> 
> thanks
> 
> Paul
> 
> 
> On 12 janv. 2015, at 09:38, Thomas Mortagne  wrote:
> 
>> When saving an attachment XWikiAttachment.updateContentArchive produce
>> a base 64 String of the attachment (so a lot bigger than the
>> attachment size) before copy it again as String[] (so again double the
>> size in memory) and then sending it to the database (which is not
>> quite the streamed thing you would expect in case of MySQL for
>> example). There is thing that can be improved (but not much we can do
>> about non streaming MySQL connector) but yes currently default
>> attachment store is not exactly great to store 600 Mb files unless you
>> allocate a looot of memory to your XWiki instance.
>>
>> Filesystem attachment should support it well (been made just for this
>> kind of use case after all), see
>> http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HFilesystemAttachmentStore.
> 
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
> 
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Run Macro inside velocity

2015-01-12 Thread Thomas Mortagne
Then I don't really understand the question.

This code does not work ? You want to know how to do the same thing in Java ?

You can access the current XWikiContext by injecting in your macro
component  and then you have pretty much the same API than in the
script oriented one, something like

@Inject
private Provider xcontextProvider;

[...]

XWikiContext xcontext = xcontextProvider.get();
xcontext.getWiki().getUser(xcontext).isUserInGroup('XWiki.AGroup'))

On Mon, Jan 12, 2015 at 10:10 AM, Marius Dumitru Florea
 wrote:
> On Fri, Jan 9, 2015 at 10:21 AM, Thomas Mortagne
>  wrote:
>> On Thu, Jan 8, 2015 at 9:35 PM, Matthias Wegner  
>> wrote:
>>> Hi All,
>>>
>>> i just uploaded a new extension to
>>> http://extensions.xwiki.org/xwiki/bin/view/Extension/TaskMacro.
>>>
>>> I want to enable in inside
>>
>
>> Is there something missing to this phrase ?
>
> Yes,
>
> {{velocity}}
> #if ($xwiki.getUser().isUserInGroup('XWiki.AGroup'))
>{{task}}A Task{{/task}}
> #end
> {{/velocity}}
>
> Checkout the Nabble link.
>
>>
>>>
>>>
>>> Can i do that?
>>>
>>> Regards,
>>> Matthias
>>>
>>>
>>>
>>> --
>>> View this message in context: 
>>> http://xwiki.475771.n2.nabble.com/Run-Macro-inside-velocity-tp7593608.html
>>> Sent from the XWiki- Users mailing list archive at Nabble.com.
>>> ___
>>> users mailing list
>>> users@xwiki.org
>>> http://lists.xwiki.org/mailman/listinfo/users
>>
>>
>>
>> --
>> Thomas Mortagne
>> ___
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users



-- 
Thomas Mortagne
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] prevent page save

2015-01-12 Thread Clemens Klein-Robbenhaar
On 01/08/2015 04:52 PM, Jason Clemons wrote:
> Hello all, 
> 
> I've implemented some client side page validation using JavaScript which 
> works well, but I want to implement some simple checks on server side also.  
> I know how to evaluate the values in my UI using velocity after the page is 
> submitted, but how do I prevent the page from saving if my criteria isn't met?

I think you can use the "Validation" feature, as explained here:

http://platform.xwiki.org/xwiki/bin/view/DevGuide/Creating+a+form+with+validation+and+tooltips#HHowtocreatevalidationsusingagroovyscript

I see the tutorial is a bit old (still using xwiki/1.0 syntax in some places), 
so in case something no longer works as documented,
another example can be found in the "MoccaCalendar" doing something similar 
with its "MoccaCalendarEventValidation" script (it refuses to save events with 
end time before start time)

   
https://github.com/xwiki-contrib/application-mocca-calendar/tree/master/application-mocca-calendar-ui

the latter should work, otherwise please report a bug at 
http://jira.xwiki.org/browse/MOCCACAL

Cheers,
Clemens
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Run Macro inside velocity

2015-01-12 Thread Marius Dumitru Florea
On Fri, Jan 9, 2015 at 10:21 AM, Thomas Mortagne
 wrote:
> On Thu, Jan 8, 2015 at 9:35 PM, Matthias Wegner  wrote:
>> Hi All,
>>
>> i just uploaded a new extension to
>> http://extensions.xwiki.org/xwiki/bin/view/Extension/TaskMacro.
>>
>> I want to enable in inside
>

> Is there something missing to this phrase ?

Yes,

{{velocity}}
#if ($xwiki.getUser().isUserInGroup('XWiki.AGroup'))
   {{task}}A Task{{/task}}
#end
{{/velocity}}

Checkout the Nabble link.

>
>>
>>
>> Can i do that?
>>
>> Regards,
>> Matthias
>>
>>
>>
>> --
>> View this message in context: 
>> http://xwiki.475771.n2.nabble.com/Run-Macro-inside-velocity-tp7593608.html
>> Sent from the XWiki- Users mailing list archive at Nabble.com.
>> ___
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
>
>
>
> --
> Thomas Mortagne
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Can't make big uploads?

2015-01-12 Thread Paul Libbrecht
Thomas,

I believe I am using the filesystem attachment. At least that's when I thought 
when using the following configuration:

> # enable attachment filesystem storage
> xwiki.store.attachment.hint=file
> xwiki.store.attachment.versioning.hint=file
> xwiki.store.attachment.recyclebin.hint=file

Any other way for me to proof?

thanks

Paul


On 12 janv. 2015, at 09:38, Thomas Mortagne  wrote:

> When saving an attachment XWikiAttachment.updateContentArchive produce
> a base 64 String of the attachment (so a lot bigger than the
> attachment size) before copy it again as String[] (so again double the
> size in memory) and then sending it to the database (which is not
> quite the streamed thing you would expect in case of MySQL for
> example). There is thing that can be improved (but not much we can do
> about non streaming MySQL connector) but yes currently default
> attachment store is not exactly great to store 600 Mb files unless you
> allocate a looot of memory to your XWiki instance.
> 
> Filesystem attachment should support it well (been made just for this
> kind of use case after all), see
> http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HFilesystemAttachmentStore.

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Can't make big uploads?

2015-01-12 Thread Thomas Mortagne
When saving an attachment XWikiAttachment.updateContentArchive produce
a base 64 String of the attachment (so a lot bigger than the
attachment size) before copy it again as String[] (so again double the
size in memory) and then sending it to the database (which is not
quite the streamed thing you would expect in case of MySQL for
example). There is thing that can be improved (but not much we can do
about non streaming MySQL connector) but yes currently default
attachment store is not exactly great to store 600 Mb files unless you
allocate a looot of memory to your XWiki instance.

Filesystem attachment should support it well (been made just for this
kind of use case after all), see
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HFilesystemAttachmentStore.

On Sat, Jan 10, 2015 at 12:53 AM, Paul Libbrecht  wrote:
>
> Hello all,
>
> after I changed my max upload size to 2Gb, and after having used the 
> filesystem attachment, I thought it would be flawless to upload a 600 Mb but 
> no. I get the following exception:
>
>> Caused by: java.lang.OutOfMemoryError: Java heap space
>>   at java.util.Arrays.copyOf(Arrays.java:2786)
>>   at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
>>   at 
>> org.apache.commons.io.output.ProxyOutputStream.write(ProxyOutputStream.java:90)
>>   at 
>> org.apache.commons.codec.binary.BaseNCodecOutputStream.flush(BaseNCodecOutputStream.java:116)
>>   at 
>> org.apache.commons.codec.binary.BaseNCodecOutputStream.write(BaseNCodecOutputStream.java:97)
>>   at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1720)
>>   at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1696)
>>   at org.apache.commons.io.IOUtils.copy(IOUtils.java:1671)
>>   at com.xpn.xwiki.internal.xml.XMLWriter.writeBase64(XMLWriter.java:182)
>>   at com.xpn.xwiki.doc.XWikiAttachment.toXML(XWikiAttachment.java:413)
>>   at 
>> com.xpn.xwiki.doc.XWikiAttachment.toStringXML(XWikiAttachment.java:340)
>>   at 
>> com.xpn.xwiki.doc.XWikiAttachmentArchive.updateArchive(XWikiAttachmentArchive.java:180)
>>   at 
>> com.xpn.xwiki.doc.XWikiAttachment.updateContentArchive(XWikiAttachment.java:718)
>>   at 
>> com.xpn.xwiki.store.XWikiHibernateStore.saveAttachment(XWikiHibernateStore.java:1528)
>>   at 
>> com.xpn.xwiki.store.XWikiHibernateStore.saveAttachmentList(XWikiHibernateStore.java:1496)
>
> Could it be that this copy is indeed copying the whole file?
>
> paul
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users



-- 
Thomas Mortagne
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] [myxwiki] new wiki request

2015-01-12 Thread Thomas Mortagne
The description is not helping much knowing what this is about,
myxwiki.org is dedicated to "non-profit organizations and
individuals".

On Sun, Jan 11, 2015 at 4:15 AM, drew  wrote:
> subject: [myxwiki] new wiki request
> description: replace XWiki Cloud account
> owner name: DrewDuckworth
> wiki name: DD3
>
>>
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users



-- 
Thomas Mortagne
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users