Re: [xwiki-users] xwiki render cache not working?

2012-12-06 Thread David Delbecq





Rendering cache works well for me. 

Well, quite obviously, not for me :) 


First of all, not that your are mixing two different features here: what 
you find in xwiki.cfg and $context.setCacheDuration() are old caching 
system which is maintained for retro-compatibility reasons only in 
xwiki/1.0 syntax. 

If setCacheDuration does not work in xwiki 2, how do i specify per page cache 
rules? Going through the process of shuting down xwiki to adjust .properties 
for each page that requires cache disabling can quickly beocme a nightmare. 




Now about the more generic rendering cache located in xwiki.properties, is 
your wiki name really wiki ? Because here you indicated that you wanted 
to cache all the pages in the wiki which has wiki as identifier. If you 
are in a single wiki mode (XWiki Enterprise for example) you can simply 
remove the wiki part as in 

core.renderingcache.documents=Space.Page 

I thought xwiki was the default wiki name :) However, here is adujsted config: 
still the same problem. As you can see, i asked to cache *everything* :) 

#-# [Since 2.4M1] 
#-# A list of Java regex patterns matching full documents reference. 
# core.renderingcache.documents=wiki:Space\.Page 
# core.renderingcache.documents=wiki:Space\..* 
core.renderingcache.documents=.* 

#-# [Since 2.4M1] 
#-# The time (in seconds) after which data should be removed from the cache 
when not used. 
#-# Default value is 300 (5 min). 
# core.renderingcache.duration=300 

#-# [Since 2.4M1] 
#-# The size of the rendering cache. Not that it's not the number of cached 
documents but the number of cached results. 
#-# (For a single document several cache entries are created, because each 
action, language and request query string 
#-# produces a unique rendering result) 
#-# Default value is 100. 
core.renderingcache.size=200 


Here is my log output, if that can be of any use: 
12:15:44,611 INFO [stdout] 
(http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 ***phone menu not in cache 
12:15:45,327 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%2Dfind.png)
 No FormBeanConfig found under 'download' 
12:15:45,342 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/back.png)
 No FormBeanConfig found under 'download' 
12:15:45,327 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/document.png)
 No FormBeanConfig found under 'download' 
12:15:59,560 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 No FormBeanConfig found under 'view' 
12:16:00,377 INFO [stdout] 
(http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 ***phone menu not in cache 
12:16:00,496 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%2Dfind.png)
 No FormBeanConfig found under 'download' 
12:16:00,497 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/document.png)
 No FormBeanConfig found under 'download' 
12:16:00,496 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/back.png)
 No FormBeanConfig found under 'download' 
12:19:06,714 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 No FormBeanConfig found under 'view' 
12:19:07,520 INFO [stdout] 
(http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 ***phone menu not in cache 
12:19:07,601 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/document.png)
 No FormBeanConfig found under 'download' 
12:19:07,609 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%2Dfind.png)
 No FormBeanConfig found under 'download' 
12:19:07,647 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/back.png)
 No FormBeanConfig found under 'download' 
12:19:09,749 WARN [org.apache.struts.util.RequestUtils] 
(http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 No FormBeanConfig found under 'view' 
12:19:10,440 INFO [stdout] 
(http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 

Re: [xwiki-users] xwiki render cache not working?

2012-12-06 Thread Thomas Mortagne
On Thu, Dec 6, 2012 at 1:26 PM, David Delbecq david.delb...@meteo.bewrote:






 Rendering cache works well for me.

 Well, quite obviously, not for me :)


 First of all, not that your are mixing two different features here: what
 you find in xwiki.cfg and $context.setCacheDuration() are old caching
 system which is maintained for retro-compatibility reasons only in
 xwiki/1.0 syntax.

 If setCacheDuration does not work in xwiki 2, how do i specify per page
 cache rules? Going through the process of shuting down xwiki to adjust
 .properties for each page that requires cache disabling can quickly beocme
 a nightmare.


You can also use cache macro (see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Cache+Macro) to choose
different timing for each contents.





 Now about the more generic rendering cache located in xwiki.properties, is
 your wiki name really wiki ? Because here you indicated that you wanted
 to cache all the pages in the wiki which has wiki as identifier. If you
 are in a single wiki mode (XWiki Enterprise for example) you can simply
 remove the wiki part as in

 core.renderingcache.documents=Space.Page

 I thought xwiki was the default wiki name :) However, here is adujsted
 config: still the same problem. As you can see, i asked to cache
 *everything* :)

 #-# [Since 2.4M1]
 #-# A list of Java regex patterns matching full documents reference.
 # core.renderingcache.documents=wiki:Space\.Page
 # core.renderingcache.documents=wiki:Space\..*
 core.renderingcache.documents=.*

 #-# [Since 2.4M1]
 #-# The time (in seconds) after which data should be removed from the
 cache when not used.
 #-# Default value is 300 (5 min).
 # core.renderingcache.duration=300

 #-# [Since 2.4M1]
 #-# The size of the rendering cache. Not that it's not the number of
 cached documents but the number of cached results.
 #-# (For a single document several cache entries are created, because each
 action, language and request query string
 #-# produces a unique rendering result)
 #-# Default value is 100.
 core.renderingcache.size=200


Did you kept core.renderingcache.enabled=true ?



 Here is my log output, if that can be of any use:
 12:15:44,611 INFO [stdout] (
 http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 ***phone menu not in cache
 12:15:45,327 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%2Dfind.png)
 No FormBeanConfig found under 'download'
 12:15:45,342 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/back.png)
 No FormBeanConfig found under 'download'
 12:15:45,327 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/document.png)
 No FormBeanConfig found under 'download'
 12:15:59,560 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 No FormBeanConfig found under 'view'
 12:16:00,377 INFO [stdout] (
 http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 ***phone menu not in cache
 12:16:00,496 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%2Dfind.png)
 No FormBeanConfig found under 'download'
 12:16:00,497 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/document.png)
 No FormBeanConfig found under 'download'
 12:16:00,496 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/back.png)
 No FormBeanConfig found under 'download'
 12:19:06,714 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 No FormBeanConfig found under 'view'
 12:19:07,520 INFO [stdout] (
 http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?menu=SomeSpace.Menuxpage=plain)
 ***phone menu not in cache
 12:19:07,601 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/document.png)
 No FormBeanConfig found under 'download'
 12:19:07,609 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%2Dfind.png)
 No FormBeanConfig found under 'download'
 12:19:07,647 WARN [org.apache.struts.util.RequestUtils] (
 http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuStylesheet/back.png)
 No FormBeanConfig found under 'download'
 12:19:09,749 WARN 

Re: [xwiki-users] BUG? xwiki render cache not working?

2012-12-06 Thread David Delbecq
Hello, 

i did a step by step analysis of the problem using eclipse debugger and i found 
the culprit. Before i submit a bugreport, can someone confirm me this is 
unexpected behaviour? 

Inside 
com.xpn.xwiki.internal.cache.rendering.DefaultRenderingCache.getRenderedContent(DocumentReference
 documentReference, String source, XWikiContext context), there is a call to 

this.cache.get(documentReference, source, getAction(context), 
context.getLanguage(), 
getRequestParameters(context)); 
which uses this information to generate a cache Key that is then looked up in 
cache. 

However, getRequestParameters(context) in my case is returning 

{menu=[Ljava.lang.String;@3e5da853, xpage=[Ljava.lang.String;@76d60121} 
where it should return something like 
{menu={SysAdminRmi.Menu}, xpage={plain}} 
As a result, my cache key change at each reaquest because values are not 
properly used and so even if my page is cache, it's never rendered from cache. 

Reason, behind this is this code in getRequestParameters: 

MapString, String parameters = context.getRequest().getParameterMap(); 
... 
return parameters.toString(); 

This map is generated by com.xpn.xwiki.web.XWikiServletRequest.getParameterMap, 
and is MapString,Object and not a MapString,String! Here is the proving 
code 
public Map getParameterMap() 
{ 
Map newMap = new HashMap(); 
Map map = this.request.getParameterMap(); 
Iterator it = map.keySet().iterator(); 
while (it.hasNext()) { 
String key = (String) it.next(); 
Object value = map.get(key); 
if (value instanceof String) { 
newMap.put(key, filterString((String) value)); 
} else if (value instanceof String[]) { 
newMap.put(key, filterStringArray((String[]) value)); 
} else { 
newMap.put(key, value); 
} 
} 
return map; 
} 

Clearly, 
In my case, catalina request facade does decode so that ParameterMap return 
MapString,String[1 ] instead of MapString,String. 


Consequences? Cache only works when there are no request parameters. 


Is there some way for me to replace DefaultRenderingCache with another 
implementation i write that does not have this issue, as a temporary solution? 




- Mail original -

De: Thomas Mortagne thomas.morta...@xwiki.com 
À: XWiki Users users@xwiki.org 
Envoyé: Mercredi 5 Décembre 2012 18:05:59 
Objet: Re: [xwiki-users] xwiki render cache not working? 

On Wed, Dec 5, 2012 at 3:29 PM, David Delbecq david.delb...@meteo.bewrote: 

 Hello, 
 
 i have a specific wiki page that is quite slow to render because some 
 groovy code and macros in there are quite slow. Fortunately, content does 
 not change often, si i tried to make it faster for user by using cache 
 rendering. 
 
 Here is what is inside my xwiki.cfg: 
 
 
 xwiki.rendering.defaultCacheDuration=3600 
 
 And here is my xwiki.properties 
 
 
 core.renderingcache.enabled=true 
 core.renderingcache.documents=wiki:.* 
 core.renderingcache.size=200 
 # Default value is 300 (5 min). 
 # core.renderingcache.duration=300 
 
 I have also this inside my page: 
 
 
 {{velocity}} 
 $context.setCacheDuration(60) 
 //complex content here that has a custom groovy macro and a velocity 
 include 
 {{/velocity}} 
 
 
 {{groovy}} 
 System.out.println(***phone menu not 
 in cache) 
 {{/groovy}} 
 
 
 And i see in my log that, everytime, the System.out is executed, meaning 
 the render cache is not used. What's my configuration problem? What did i 
 miss? 
 
 Note: using xwiki 4.1.2 and the url i try is 
 http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menuxpage=plain 
 
 
Thank you. 
 
 David Delbecq 
 
 ___ 
 users mailing list 
 users@xwiki.org 
 http://lists.xwiki.org/mailman/listinfo/users 
 

Rendering cache works well for me. 

First of all, not that your are mixing two different features here: what 
you find in xwiki.cfg and $context.setCacheDuration() are old caching 
system which is maintained for retro-compatibility reasons only in 
xwiki/1.0 syntax. 

Now about the more generic rendering cache located in xwiki.properties, is 
your wiki name really wiki ? Because here you indicated that you wanted 
to cache all the pages in the wiki which has wiki as identifier. If you 
are in a single wiki mode (XWiki Enterprise for example) you can simply 
remove the wiki part as in 

core.renderingcache.documents=Space.Page 

-- 
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] BUG? xwiki render cache not working?

2012-12-06 Thread David Delbecq

Hello, 

i did a step by step analysis of the problem using eclipse debugger and i found 
the culprit. Before i submit a bugreport, can someone confirm me this is 
unexpected behaviour? 

Inside 
com.xpn.xwiki.internal.cache.rendering.DefaultRenderingCache.getRenderedContent(DocumentReference
 documentReference, String source, XWikiContext context), there is a call to 

this.cache.get(documentReference, source, getAction(context), 
context.getLanguage(), 
getRequestParameters(context)); 
which uses this information to generate a cache Key that is then looked up in 
cache. 

However, getRequestParameters(context) in my case is returning 

{menu=[Ljava.lang.String;@3e5da853, xpage=[Ljava.lang.String;@76d60121} 
where it should return something like 
{menu={SysAdminRmi.Menu}, xpage={plain}} 
As a result, my cache key change at each reaquest because values are not 
properly used and so even if my page is cache, it's never rendered from cache. 

Reason, behind this is this code in getRequestParameters: 

MapString, String parameters = context.getRequest().getParameterMap(); 
... 
return parameters.toString(); 

This map is generated by com.xpn.xwiki.web.XWikiServletRequest.getParameterMap, 
and is MapString,Object and not a MapString,String! Here is the proving 
code 
public Map getParameterMap() 
{ 
Map newMap = new HashMap(); 
Map map = this.request.getParameterMap(); 
Iterator it = map.keySet().iterator(); 
while (it.hasNext()) { 
String key = (String) it.next(); 
Object value = map.get(key); 
if (value instanceof String) { 
newMap.put(key, filterString((String) value)); 
} else if (value instanceof String[]) { 
newMap.put(key, filterStringArray((String[]) value)); 
} else { 
newMap.put(key, value); 
} 
} 
return map; 
} 

Clearly, 
In my case, catalina request facade does decode so that ParameterMap return 
MapString,String[1] instead of MapString,String. 


Consequences? Cache only works when there are no request parameters. 


Is there some way for me to replace DefaultRenderingCache with another 
implementation i write that does not have this issue, as a temporary solution? 




- Mail original -

De: Thomas Mortagne thomas.morta...@xwiki.com 
À: XWiki Users users@xwiki.org 
Envoyé: Mercredi 5 Décembre 2012 18:05:59 
Objet: Re: [xwiki-users] xwiki render cache not working? 

On Wed, Dec 5, 2012 at 3:29 PM, David Delbecq david.delb...@meteo.bewrote: 

 Hello, 
 
 i have a specific wiki page that is quite slow to render because some 
 groovy code and macros in there are quite slow. Fortunately, content does 
 not change often, si i tried to make it faster for user by using cache 
 rendering. 
 
 Here is what is inside my xwiki.cfg: 
 
 
 xwiki.rendering.defaultCacheDuration=3600 
 
 And here is my xwiki.properties 
 
 
 core.renderingcache.enabled=true 
 core.renderingcache.documents=wiki:.* 
 core.renderingcache.size=200 
 # Default value is 300 (5 min). 
 # core.renderingcache.duration=300 
 
 I have also this inside my page: 
 
 
 {{velocity}} 
 $context.setCacheDuration(60) 
 //complex content here that has a custom groovy macro and a velocity 
 include 
 {{/velocity}} 
 
 
 {{groovy}} 
 System.out.println(***phone menu not 
 in cache) 
 {{/groovy}} 
 
 
 And i see in my log that, everytime, the System.out is executed, meaning 
 the render cache is not used. What's my configuration problem? What did i 
 miss? 
 
 Note: using xwiki 4.1.2 and the url i try is 
 http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menuxpage=plain 
 
 
Thank you. 
 
 David Delbecq 
 
 ___ 
 users mailing list 
 users@xwiki.org 
 http://lists.xwiki.org/mailman/listinfo/users 
 

Rendering cache works well for me. 

First of all, not that your are mixing two different features here: what 
you find in xwiki.cfg and $context.setCacheDuration() are old caching 
system which is maintained for retro-compatibility reasons only in 
xwiki/1.0 syntax. 

Now about the more generic rendering cache located in xwiki.properties, is 
your wiki name really wiki ? Because here you indicated that you wanted 
to cache all the pages in the wiki which has wiki as identifier. If you 
are in a single wiki mode (XWiki Enterprise for example) you can simply 
remove the wiki part as in 

core.renderingcache.documents=Space.Page 

-- 
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] xwiki render cache not working?

2012-12-06 Thread David Delbecq

 You can also use cache macro (see 
 http://extensions.xwiki.org/xwiki/bin/view/Extension/Cache+Macro) to choose 
 different timing for each contents. 

For what i read, it operates at a differente level, i caches the XDOM, not the 
rendered content. I am pretty sure XDOM uses more space in memory that a simple 
String, you still have the overhead of rendering operation and you have to 
manually manage your cache key, which is far mor cumbersome thant saying xwiki 
hey, cache this page for 5 minutes, ok?) Moreover, documentation suggest to 
avoid haveing different timeToLive on different pages, because that's as much 
threads :s

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


Re: [xwiki-users] Problem accessing sub-wikis

2012-12-06 Thread Trash Mail
well, after a complete new installation of wiki its almost working..
there is only one thing left i dont get to work and i hope someone could
help me out.

the panels on the left and right won't appear no matter what i do.
only for admin users and that seems really strange to me.

any ideas?

thanks and regards,
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] How to display a local file

2012-12-06 Thread H.-Dirk Schmitt
Hi!

I'm looking for a receipt to display a local file inside an xwiki page.

The use case is that this is an intranet documentation provided by xwiki.
Every user in the audience has normally some configuration files in a
standardized location.
The content may differ between for each user (or concrete his
workstation). This is also the reason not to expose the files on a
webserver and use the RemoteCode marco.

Current solution is to at a link [[ConfigFilefile:///etc.]]
It would be nicer to display the content inside the xwiki page.


Best Regards,

H.-Dirk Schmitt


-- 
Signature H.-Dirk Schmitt


*
H.-Dirk Schmitt http://www.computer42.org*
Dipl.Math.

eMail:/dirk.schm...@computer42.org/
mobile:/+49 177 616 8564/
phone: /+49 2642 99 41 10/
fax: /+49 2642 99 41 15/
Kripper Str. 35, D-53489 Sinzig

pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html
http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html

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


Re: [xwiki-users] How to display a local file

2012-12-06 Thread Sergiu Dumitriu
On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
 Hi!
 
 I'm looking for a receipt to display a local file inside an xwiki page.
 
 The use case is that this is an intranet documentation provided by xwiki.
 Every user in the audience has normally some configuration files in a
 standardized location.
 The content may differ between for each user (or concrete his
 workstation). This is also the reason not to expose the files on a
 webserver and use the RemoteCode marco.
 
 Current solution is to at a link [[ConfigFilefile:///etc.]]
 It would be nicer to display the content inside the xwiki page.
 

For security reasons, that kind of thing is not supposed to be doable.

Try using an iframe.

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] How to display a local file

2012-12-06 Thread Jerome Velociter

On 12/06/2012 05:44 PM, Sergiu Dumitriu wrote:

On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:

Hi!

I'm looking for a receipt to display a local file inside an xwiki page.

The use case is that this is an intranet documentation provided by xwiki.
Every user in the audience has normally some configuration files in a
standardized location.
The content may differ between for each user (or concrete his
workstation). This is also the reason not to expose the files on a
webserver and use the RemoteCode marco.

Current solution is to at a link [[ConfigFilefile:///etc.]]
It would be nicer to display the content inside the xwiki page.


For security reasons, that kind of thing is not supposed to be doable.

Try using an iframe.


It's also doable using the programming right (providing a macro for 
example), but then again you must be careful what you allow (what paths, 
etc.) so that users can't abuse it and display /etc/shadow or whatever 
they fancy.


Jerome.





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


Re: [xwiki-users] How to display a local file

2012-12-06 Thread Paul Libbrecht
Why is 
$xwiki.getURLContent(file:///etc/...)
not supposed to work? (if you have programming rights).

paul



Le 6 déc. 2012 à 08:44, Sergiu Dumitriu a écrit :

 On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
 Hi!
 
 I'm looking for a receipt to display a local file inside an xwiki page.
 
 The use case is that this is an intranet documentation provided by xwiki.
 Every user in the audience has normally some configuration files in a
 standardized location.
 The content may differ between for each user (or concrete his
 workstation). This is also the reason not to expose the files on a
 webserver and use the RemoteCode marco.
 
 Current solution is to at a link [[ConfigFilefile:///etc.]]
 It would be nicer to display the content inside the xwiki page.
 
 
 For security reasons, that kind of thing is not supposed to be doable.
 
 Try using an iframe.
 
 -- 
 Sergiu Dumitriu
 http://purl.org/net/sergiu/
 ___
 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] How to display a local file

2012-12-06 Thread Sergiu Dumitriu
On 12/06/2012 12:04 PM, Paul Libbrecht wrote:
 Why is 
   $xwiki.getURLContent(file:///etc/...)
 not supposed to work? (if you have programming rights).

Because the OP asked for files local to the user's computer, not the
server. file:/// on the server will still point to the server.

The only thing that has access to the client machine is the browser. And
browser makers try really hard to prevent web pages from having access
to the user's disk.

Unless some LDAP tricks are used to link a user to a certain computer,
and the XWiki server can have access to each user machine.

 paul
 
 
 
 Le 6 déc. 2012 à 08:44, Sergiu Dumitriu a écrit :
 
 On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
 Hi!

 I'm looking for a receipt to display a local file inside an xwiki page.

 The use case is that this is an intranet documentation provided by xwiki.
 Every user in the audience has normally some configuration files in a
 standardized location.
 The content may differ between for each user (or concrete his
 workstation). This is also the reason not to expose the files on a
 webserver and use the RemoteCode marco.

 Current solution is to at a link [[ConfigFilefile:///etc.]]
 It would be nicer to display the content inside the xwiki page.


 For security reasons, that kind of thing is not supposed to be doable.

 Try using an iframe.

 -- 
 Sergiu Dumitriu
 http://purl.org/net/sergiu/


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] How to display a local file

2012-12-06 Thread Paul Libbrecht
Thanks Sergiu,

I agree this is absolutely a dangerous thing to do and should not be encouraged 
at all!

paul


Le 6 déc. 2012 à 10:27, Sergiu Dumitriu a écrit :

 On 12/06/2012 12:04 PM, Paul Libbrecht wrote:
 Why is 
  $xwiki.getURLContent(file:///etc/...)
 not supposed to work? (if you have programming rights).
 
 Because the OP asked for files local to the user's computer, not the
 server. file:/// on the server will still point to the server.
 
 The only thing that has access to the client machine is the browser. And
 browser makers try really hard to prevent web pages from having access
 to the user's disk.
 
 Unless some LDAP tricks are used to link a user to a certain computer,
 and the XWiki server can have access to each user machine.
 
 paul
 
 
 
 Le 6 déc. 2012 à 08:44, Sergiu Dumitriu a écrit :
 
 On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
 Hi!
 
 I'm looking for a receipt to display a local file inside an xwiki page.
 
 The use case is that this is an intranet documentation provided by xwiki.
 Every user in the audience has normally some configuration files in a
 standardized location.
 The content may differ between for each user (or concrete his
 workstation). This is also the reason not to expose the files on a
 webserver and use the RemoteCode marco.
 
 Current solution is to at a link [[ConfigFilefile:///etc.]]
 It would be nicer to display the content inside the xwiki page.
 
 
 For security reasons, that kind of thing is not supposed to be doable.
 
 Try using an iframe.
 
 -- 
 Sergiu Dumitriu
 http://purl.org/net/sergiu/
 
 
 -- 
 Sergiu Dumitriu
 http://purl.org/net/sergiu
 ___
 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] How to display a local file

2012-12-06 Thread Jeremie BOUSQUET
Hi,

Looks like this configuration would better fit in a cookie...
And a more xwikied solution could be to store it in an Xobject attached to
the users profiles pages.

Is there a special reason for having it on users computers, other than
being user-specific ?

BR,
Jerem
Le 6 déc. 2012 17:39, H.-Dirk Schmitt d...@computer42.org a écrit :

 Hi!

 I'm looking for a receipt to display a local file inside an xwiki page.

 The use case is that this is an intranet documentation provided by xwiki.
 Every user in the audience has normally some configuration files in a
 standardized location.
 The content may differ between for each user (or concrete his
 workstation). This is also the reason not to expose the files on a
 webserver and use the RemoteCode marco.

 Current solution is to at a link [[ConfigFilefile:///etc.]]
 It would be nicer to display the content inside the xwiki page.


 Best Regards,

 H.-Dirk Schmitt


 --
 Signature H.-Dirk Schmitt
 

 *
 H.-Dirk Schmitt http://www.computer42.org*
 Dipl.Math.

 eMail:/dirk.schm...@computer42.org/
 mobile:/+49 177 616 8564/
 phone: /+49 2642 99 41 10/
 fax: /+49 2642 99 41 15/
 Kripper Str. 35, D-53489 Sinzig

 pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html
 http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html

 ___
 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] How to display a local file

2012-12-06 Thread H.-Dirk Schmitt
On 06.12.2012 19:47, Jeremie BOUSQUET wrote:
 Is there a special reason for having it on users computers, other than
 being user-specific ?


Simple and consistent right management :-)
If the user running the web browser haven't the right to view the file -
it is not displayed.
Why should a consistent right management (unix filesystem) duplicated to
the xwiki server? ;-)

Best Regards,

H.-Dirk Schmitt

-- 
Signature H.-Dirk Schmitt


*
H.-Dirk Schmitt http://www.computer42.org*
Dipl.Math.

eMail:/dirk.schm...@computer42.org/
mobile:/+49 177 616 8564/
phone: /+49 2642 99 41 10/
fax: /+49 2642 99 41 15/
Kripper Str. 35, D-53489 Sinzig

pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html
http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html

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


Re: [xwiki-users] How to display a local file

2012-12-06 Thread H.-Dirk Schmitt
On 06.12.2012 17:44, Sergiu Dumitriu wrote:
 Try using an iframe. 

I have only seen examples with javascript manipulating the dom of the page.
Is there a more simple solution ?

Best Regards,

H.-Dirk Schmitt


-- 
Signature H.-Dirk Schmitt


*
H.-Dirk Schmitt http://www.computer42.org*
Dipl.Math.

eMail:/dirk.schm...@computer42.org/
mobile:/+49 177 616 8564/
phone: /+49 2642 99 41 10/
fax: /+49 2642 99 41 15/
Kripper Str. 35, D-53489 Sinzig

pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html
http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html

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


[xwiki-users] Javascripted slideshow for home pages

2012-12-06 Thread Gerritjan Koekkoek
For one translation www.cdlsworld.org?language=nl we've included an iFrame that 
links to a 'hidden' website that holds a WOWSLIDER based html page. It is 
heavily javascripted with jQuery. The use of jQuery instead of Protoptype makes 
it difficult to use the wow slider javascript from within xwiki
We're experimenting if we could do this from within XWiki (without the iFrame). 
The reason being that maintaining the wow slider is a single person task and 
makes the organization vulnerable if this person leaves.

I've noticed you were active developing a carrousel on XWiki. Would it be 
possible to learn about this and share the approach?

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


[xwiki-users] [myxwiki] new wiki request

2012-12-06 Thread Jose Andres Gonzalez
Wiki -- Knowledge base for IT explanations

Username:  dogosuan
Server Name: piensalo.myxwiki.org
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] XWiki login timeout

2012-12-06 Thread Hoang Tuan Viet

Hi all,

I am usually out of session when editing XWiki page, after about 2 minutes.

I have checked tomcat6's web.xml file:
 ...
/servlet-mapping

session-config
session-timeout30/session-timeout
/session-config
...

as 
http://www.xwiki.org/xwiki/bin/view/FAQ/How+can+I+change+the+Session+timeout.


I also see file web.xml in xwiki/WEB-INF folder. I tried to add above 
config to this file but no luck.


Would you please tell me how to fix this?

Regards,

--
Viet Hoang

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


Re: [xwiki-users] XWiki login timeout

2012-12-06 Thread Ludovic Dubost
Hi

You should look if your IP (as received by the server) is changing and if your 
server has the ip restriction setting set in xwiki.cfg

Ludovic

Envoyé de mon iPhone

Le 7 déc. 2012 à 05:28, Hoang Tuan Viet vie...@vccloud.vn a écrit :

 Hi all,
 
 I am usually out of session when editing XWiki page, after about 2 minutes.
 
 I have checked tomcat6's web.xml file:
 ...
 /servlet-mapping
 
 session-config
 session-timeout30/session-timeout
 /session-config
 ...
 
 as 
 http://www.xwiki.org/xwiki/bin/view/FAQ/How+can+I+change+the+Session+timeout.
 
 I also see file web.xml in xwiki/WEB-INF folder. I tried to add above config 
 to this file but no luck.
 
 Would you please tell me how to fix this?
 
 Regards,
 
 -- 
 Viet Hoang
 
 ___
 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] BUG? xwiki render cache not working?

2012-12-06 Thread Marius Dumitru Florea
On Thu, Dec 6, 2012 at 3:37 PM, David Delbecq david.delb...@meteo.be wrote:
 Hello,

 i did a step by step analysis of the problem using eclipse debugger and i 
 found the culprit. Before i submit a bugreport, can someone confirm me this 
 is unexpected behaviour?

 Inside 
 com.xpn.xwiki.internal.cache.rendering.DefaultRenderingCache.getRenderedContent(DocumentReference
  documentReference, String source, XWikiContext context), there is a call to

 this.cache.get(documentReference, source, getAction(context), 
 context.getLanguage(),
 getRequestParameters(context));
 which uses this information to generate a cache Key that is then looked up in 
 cache.

 However, getRequestParameters(context) in my case is returning


 {menu=[Ljava.lang.String;@3e5da853, xpage=[Ljava.lang.String;@76d60121}

This is the expected output of calling toString() on a MapString,
String[]. The bug is that the code in DefaultRenderingCache wrongly
assumes that the request parameters are stored in a MapString,
String.

 where it should return something like
 {menu={SysAdminRmi.Menu}, xpage={plain}}
 As a result, my cache key change at each reaquest because values are not 
 properly used and so even if my page is cache, it's never rendered from cache.

 Reason, behind this is this code in getRequestParameters:

 MapString, String parameters = context.getRequest().getParameterMap();
 ...
 return parameters.toString();


 This map is generated by 
 com.xpn.xwiki.web.XWikiServletRequest.getParameterMap, and is 
 MapString,Object and not a MapString,String! Here is the proving code

See 
http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getParameterMap%28%29
. The return value is clear, MapString, String[].
DefaultRenderingCache#getRequestParameters() needs to be fixed to
serialize the map correctly, and the best way is to serialize it as a
query string.

 public Map getParameterMap()
 {
 Map newMap = new HashMap();
 Map map = this.request.getParameterMap();
 Iterator it = map.keySet().iterator();
 while (it.hasNext()) {
 String key = (String) it.next();
 Object value = map.get(key);
 if (value instanceof String) {
 newMap.put(key, filterString((String) value));
 } else if (value instanceof String[]) {
 newMap.put(key, filterStringArray((String[]) value));
 } else {
 newMap.put(key, value);
 }
 }
 return map;
 }

 Clearly,
 In my case, catalina request facade does decode so that ParameterMap return 
 MapString,String[1 ] instead of MapString,String.


 Consequences? Cache only works when there are no request parameters.



 Is there some way for me to replace DefaultRenderingCache with another 
 implementation i write that does not have this issue, as a temporary solution?

Yes, because DefaultRenderingCache is a component implementation. See
http://extensions.xwiki.org/xwiki/bin/view/Extension/Component+Module#HOverrides
.

Hope this helps,
Marius





 - Mail original -

 De: Thomas Mortagne thomas.morta...@xwiki.com
 À: XWiki Users users@xwiki.org
 Envoyé: Mercredi 5 Décembre 2012 18:05:59
 Objet: Re: [xwiki-users] xwiki render cache not working?

 On Wed, Dec 5, 2012 at 3:29 PM, David Delbecq david.delb...@meteo.bewrote:

 Hello,

 i have a specific wiki page that is quite slow to render because some
 groovy code and macros in there are quite slow. Fortunately, content does
 not change often, si i tried to make it faster for user by using cache
 rendering.

 Here is what is inside my xwiki.cfg:


 xwiki.rendering.defaultCacheDuration=3600

 And here is my xwiki.properties


 core.renderingcache.enabled=true
 core.renderingcache.documents=wiki:.*
 core.renderingcache.size=200
 # Default value is 300 (5 min).
 # core.renderingcache.duration=300

 I have also this inside my page:


 {{velocity}}
 $context.setCacheDuration(60)
 //complex content here that has a custom groovy macro and a velocity
 include
 {{/velocity}}


 {{groovy}}
 System.out.println(***phone menu not
 in cache)
 {{/groovy}}


 And i see in my log that, everytime, the System.out is executed, meaning
 the render cache is not used. What's my configuration problem? What did i
 miss?

 Note: using xwiki 4.1.2 and the url i try is
 http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menuxpage=plain


 Thank you.

 David Delbecq

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


 Rendering cache works well for me.

 First of all, not that your are mixing two different features here: what
 you find in xwiki.cfg and $context.setCacheDuration() are old caching
 system which is maintained for retro-compatibility reasons only in
 xwiki/1.0 syntax.

 Now about the more generic rendering cache located in xwiki.properties, is
 your wiki name really wiki ? Because here you indicated that you wanted
 to cache all the pages in the wiki which has wiki as identifier. If you
 are in a single wiki mode (XWiki Enterprise for example) you 

Re: [xwiki-users] XWiki login timeout

2012-12-06 Thread Hoang Tuan Viet

Hi,

In fact, my WAN IP is usually changed.

I searched in xwiki.cfg but cannot find any section about ip restriction.

Then I found this: http://jira.xwiki.org/browse/XWIKI-2256

I put xwiki.authentication.useip=0 in xwiki.cfg and restart tomcat, 
then the problem went away.


Thank you very much,

Viet

On 12/07/2012 02:21 PM, Ludovic Dubost wrote:

Hi

You should look if your IP (as received by the server) is changing and if your 
server has the ip restriction setting set in xwiki.cfg

Ludovic

Envoyé de mon iPhone

Le 7 déc. 2012 à 05:28, Hoang Tuan Viet vie...@vccloud.vn a écrit :


Hi all,

I am usually out of session when editing XWiki page, after about 2 minutes.

I have checked tomcat6's web.xml file:
...
/servlet-mapping

session-config
session-timeout30/session-timeout
/session-config
...

as http://www.xwiki.org/xwiki/bin/view/FAQ/How+can+I+change+the+Session+timeout.

I also see file web.xml in xwiki/WEB-INF folder. I tried to add above config to 
this file but no luck.

Would you please tell me how to fix this?

Regards,

--
Viet Hoang

___
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



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