Re: [xwiki-users] How do I evaluate a Velocity variable in XWiki syntax?

2012-12-14 Thread Eduard Moraru
Hi,

Here is an example that illustrates your problem, in a simplified case
(using an 'AppWithinMinutes.String' object):

{{velocity}}
This is done with a displayer:
{{{
$doc.getObject('AppWithinMinutes.String').shortText
}}}

This is the raw value of the property:
$doc.getObject('AppWithinMinutes.String').getProperty('shortText').value
{{/velocity}}

Basically, when you are doing $n.description you are doing
$doc.display('description', $n) which renders the output based on the
default displayer.
To test this, you can do:
{{velocity}}
{{{
$doc.getObject('AppWithinMinutes.String').shortText
}}}
{{velocity}}

and see the output (which prints the value literally with wiki='false' and
which was not what you were expecting to see):
{{html clean=false wiki=false}}[[linkMain.WebHome]]{{/html}}

You just need to be aware of this and decide when you want to use a
displayer and when you actually want the raw value of the object property.

Thanks,
Eduard


On Fri, Dec 14, 2012 at 2:54 AM, crocket crockabisc...@gmail.com wrote:

 Below is the velocity macro that displays the XWiki link syntax in a
 variable literally.
 $n.description contains a link, and it is not displayed as a link but
 displayed literally in the XWiki syntax.

 {{velocity}}
 #set($nsrv=$doc.getObjects(Private.NetworkServices))

 #if($nsrv)
 $services.objectsort.getInstance().sortByProps($nsrv, [firewalled:desc,
 port])
 |=Firewalled|=Port|=Protocol|=Service|=Application|=Description
   #foreach ( $n in $nsrv )

 |$n.firewalled|$n.port|$n.protocol|$n.service|$n.application|$n.description
   #end

 #else
 There is no network service defined.
 #end
 {{/velocity}}


 On Sun, Dec 9, 2012 at 6:36 PM, crocket crockabisc...@gmail.com wrote:

  Suppose str is set by #set($str=[[labelSpace.Page]])
 
  How do I render $str as a link in a Velocity macro?
 
 ___
 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] Forms good practices

2012-12-14 Thread Eduard Moraru
Hi Jeremie,

Yes, that's the right way to do it and it's what we have already been doing
ourselves.

I`ve updated the document to:

Obs: The CSS classes have as parent the .xform class. This is supposed to
be used on the form tag, but if the styling is done inside dynamically
generated structures it can be used on other elements, like divs, as long
as the element remains the parent for the other form components. For
instance, a common use case is when you design a form that is to be used in
inline edit mode, you have to wrap it in a div element and use
class='.xform' on the div instead of the form. This is needed because in
inline edit mode your form element will not be rendered and, instead, your
page will be wrapped inside the main inline edit form.

Hope it's clearer now.

Thanks,
Eduard


On Fri, Dec 14, 2012 at 11:24 AM, Jeremie BOUSQUET 
jeremie.bousq...@gmail.com wrote:

 Hello,

 Following Vertical Layout standards [1], I've written the following to
 display a form (XE 4.3 standalone):

 #set($class = $obj.xWikiClass)
 {{html wiki=true}}
 form action=. class=xform name=form_server
 #foreach($prop in $class.properties)
   dl
 dtlabel for=MySpave.MyClass_0_$prop.name
 $prop.prettyName/label/dt
 dd$doc.display($prop.getName())/dd
   /dl
 #end
 /form
 {{/html}}

 In view mode, labels are correctly displayed uppercase, but in inline edit
 mode, they switch to lowercase bold, which is not very nice.
 I investigated, and in inline mode my form is removed, and replaced by
 the encapsulating inline form. So to fix that, I decorated my form with
 a div with class xform. Is it the right way to do that ?

 If so, I think the comment from [1] is not complete:

 Obs: The CSS classes have as parent the .xform class. This is supposed to
 be used on the form tag, but if the styling is done inside dynamically
 generated structures it can be used on other elements, like divs, as long
 as the element remains the parent for the other form components.

 It would not really be limited to dynamically generated structures, but
 also to inline edit mode.

 BR,
 Jeremie


 [1] - http://platform.xwiki.org/xwiki/bin/view/DevGuide/VerticalForms
 ___
 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] Forms good practices

2012-12-14 Thread Jeremie BOUSQUET
Yes thanks, it's clearer now (at least for me). Might avoid some searching
to others, why I pointed it out :)

BR,
Jeremie


2012/12/14 Eduard Moraru enygma2...@gmail.com

 Hi Jeremie,

 Yes, that's the right way to do it and it's what we have already been doing
 ourselves.

 I`ve updated the document to:

 Obs: The CSS classes have as parent the .xform class. This is supposed to
 be used on the form tag, but if the styling is done inside dynamically
 generated structures it can be used on other elements, like divs, as long
 as the element remains the parent for the other form components. For
 instance, a common use case is when you design a form that is to be used in
 inline edit mode, you have to wrap it in a div element and use
 class='.xform' on the div instead of the form. This is needed because in
 inline edit mode your form element will not be rendered and, instead, your
 page will be wrapped inside the main inline edit form.

 Hope it's clearer now.

 Thanks,
 Eduard


 On Fri, Dec 14, 2012 at 11:24 AM, Jeremie BOUSQUET 
 jeremie.bousq...@gmail.com wrote:

  Hello,
 
  Following Vertical Layout standards [1], I've written the following to
  display a form (XE 4.3 standalone):
 
  #set($class = $obj.xWikiClass)
  {{html wiki=true}}
  form action=. class=xform name=form_server
  #foreach($prop in $class.properties)
dl
  dtlabel for=MySpave.MyClass_0_$prop.name
  $prop.prettyName/label/dt
  dd$doc.display($prop.getName())/dd
/dl
  #end
  /form
  {{/html}}
 
  In view mode, labels are correctly displayed uppercase, but in inline
 edit
  mode, they switch to lowercase bold, which is not very nice.
  I investigated, and in inline mode my form is removed, and replaced by
  the encapsulating inline form. So to fix that, I decorated my form
 with
  a div with class xform. Is it the right way to do that ?
 
  If so, I think the comment from [1] is not complete:
 
  Obs: The CSS classes have as parent the .xform class. This is supposed
 to
  be used on the form tag, but if the styling is done inside dynamically
  generated structures it can be used on other elements, like divs, as long
  as the element remains the parent for the other form components.
 
  It would not really be limited to dynamically generated structures, but
  also to inline edit mode.
 
  BR,
  Jeremie
 
 
  [1] - http://platform.xwiki.org/xwiki/bin/view/DevGuide/VerticalForms
  ___
  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


Re: [xwiki-users] How do I evaluate a Velocity variable in XWiki syntax?

2012-12-14 Thread crocket
Thanks for your advise. It now works.


On Fri, Dec 14, 2012 at 8:48 PM, Eduard Moraru enygma2...@gmail.com wrote:

 Hi,

 Here is an example that illustrates your problem, in a simplified case
 (using an 'AppWithinMinutes.String' object):

 {{velocity}}
 This is done with a displayer:
 {{{
 $doc.getObject('AppWithinMinutes.String').shortText
 }}}

 This is the raw value of the property:
 $doc.getObject('AppWithinMinutes.String').getProperty('shortText').value
 {{/velocity}}

 Basically, when you are doing $n.description you are doing
 $doc.display('description', $n) which renders the output based on the
 default displayer.
 To test this, you can do:
 {{velocity}}
 {{{
 $doc.getObject('AppWithinMinutes.String').shortText
 }}}
 {{velocity}}

 and see the output (which prints the value literally with wiki='false' and
 which was not what you were expecting to see):
 {{html clean=false wiki=false}}[[linkMain.WebHome]]{{/html}}

 You just need to be aware of this and decide when you want to use a
 displayer and when you actually want the raw value of the object property.

 Thanks,
 Eduard


 On Fri, Dec 14, 2012 at 2:54 AM, crocket crockabisc...@gmail.com wrote:

  Below is the velocity macro that displays the XWiki link syntax in a
  variable literally.
  $n.description contains a link, and it is not displayed as a link but
  displayed literally in the XWiki syntax.
 
  {{velocity}}
  #set($nsrv=$doc.getObjects(Private.NetworkServices))
 
  #if($nsrv)
  $services.objectsort.getInstance().sortByProps($nsrv, [firewalled:desc,
  port])
  |=Firewalled|=Port|=Protocol|=Service|=Application|=Description
#foreach ( $n in $nsrv )
 
 
 |$n.firewalled|$n.port|$n.protocol|$n.service|$n.application|$n.description
#end
 
  #else
  There is no network service defined.
  #end
  {{/velocity}}
 
 
  On Sun, Dec 9, 2012 at 6:36 PM, crocket crockabisc...@gmail.com wrote:
 
   Suppose str is set by #set($str=[[labelSpace.Page]])
  
   How do I render $str as a link in a Velocity macro?
  
  ___
  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


[xwiki-users] Admin user can't install extensions

2012-12-14 Thread Pape, Barry
Hi Everyone,

I just switched from the standalone install to a tomcat/mysql installation and 
now the Admin user can't install any extensions.  Specifically, I am running 
Tomcat 7.0.34 with MySQL 5.1 on Windows Server 2008 R2 Standard and XWiki 
Enterprise 4.3.  I imported the Default Wiki Xar file 
(xwiki-enterprise-ui-all-4.3.xar) and since the macros on the home page aren't 
working (Spaces, Tags, Send Message, and Activity Stream all state unknown 
macro) proceeded to login with the Admin user and navigated to the Extension 
Manager.  I was surprised to see only one extension installed (XWiki Enterprise 
- UI All) instead of the 27 that came with the standalone version of XWiki. So 
I went to install some of the missing extensions and received the message 
Admin right is required to install extension 
[org.xwiki.platform:xwiki-platform-wiki-manager-ui-4.3] on namespace 
[wiki:xwiki].  Which I hadn't received any messages like that when using the 
standalone version.  I verified that the Admin us
 er is in the XWikiAdminGroup and has Admin privileges.  Are there other access 
controls that I need to modify for this?  Is there some other configuration 
that I need to perform first?  Any help is much appreciated.

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


Re: [xwiki-users] Admin user can't install extensions

2012-12-14 Thread Sergiu Dumitriu
On 12/14/2012 02:03 PM, Pape, Barry wrote:
 Hi Everyone,
 
 I just switched from the standalone install to a tomcat/mysql installation 
 and now the Admin user can't install any extensions.  Specifically, I am 
 running Tomcat 7.0.34 with MySQL 5.1 on Windows Server 2008 R2 Standard and 
 XWiki Enterprise 4.3.  I imported the Default Wiki Xar file 
 (xwiki-enterprise-ui-all-4.3.xar) and since the macros on the home page 
 aren't working (Spaces, Tags, Send Message, and Activity Stream all state 
 unknown macro) proceeded to login with the Admin user and navigated to the 
 Extension Manager.  I was surprised to see only one extension installed 
 (XWiki Enterprise - UI All) instead of the 27 that came with the standalone 
 version of XWiki. So I went to install some of the missing extensions and 
 received the message Admin right is required to install extension 
 [org.xwiki.platform:xwiki-platform-wiki-manager-ui-4.3] on namespace 
 [wiki:xwiki].  Which I hadn't received any messages like that when using the 
 standalone version.  I verified that the Admin 
 us
  er is in the XWikiAdminGroup and has Admin privileges.  Are there other 
 access controls that I need to modify for this?  Is there some other 
 configuration that I need to perform first?  Any help is much appreciated.
 

When importing the XAR, make sure you check Import as backup package.
Otherwise, all the imported documents will be created with an
unprivileged account, thus the rights issues.

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


Re: [xwiki-users] [xwiki-devs] How to Include a page without velocity code into another page

2012-12-14 Thread Geo Du
Hi Marius,

This works, but my problem is that I have a xwiki page, I have a link on
this page, when I click on this link, a javascript function is called, with
the call, I want to include a new xwiki page at the bottom of the current
page without reloading the current old content (like appending a new page
to the current page without change of the old content), the new appended
content could be in edit or view mode.
My question is the approach you have here is to use display macro, how to
trigger this macro inside javascript code? also how to avoid reloading the
old content when appending new content? since in the old page I have some
search results listed, I do not want to lose it and make users have to
search again.

Thanks for your help.
David

On Mon, Nov 5, 2012 at 3:33 AM, Marius Dumitru Florea 
mariusdumitru.flo...@xwiki.com wrote:

 The display macro works for me as you would expect. For instance, if I
 create a page with this content:

 --8--
 {{velocity}}
 Current action: $xcontext.action
 {{/velocity}}

 {{display reference=Blog.BlogIntroduction/}}
 --8--

 in view mode I can see the blog post preceded by Current action:
 view and in Inline Form edit mode I can edit the blog post, which
 is preceded by Current action: edit.

 Hope this helps,
 Marius

 On Fri, Nov 2, 2012 at 10:18 PM, Geo Du ddd...@gmail.com wrote:
  Hi Marius,
 
  Thanks for your response, it works when I use display macro to include
 the
  testpage into the other page, but I need also to include (display) the
 page
  with inline mode inside the other page, since user can click the edit
 pencil
  button on the right corner of the testpage to edit it, right now the edit
  button will lead to the testpage in inline mode but the testpage is not
  inside the other page which originally include(display) the testpage.
 
  So how to include or display a page with inline mode into another page?
 
  Thanks for your help.
 
  David
 
  On Fri, Nov 2, 2012 at 3:06 AM, Marius Dumitru Florea
  mariusdumitru.flo...@xwiki.com wrote:
 
  On Thu, Nov 1, 2012 at 10:51 PM, Geo Du ddd...@gmail.com wrote:
  
   Hi All,
  
   I want to include one page into another page in terms of content
 instead
   of
   velocity code, for example, the Blog.WebHome is a page without
 velocity
   code if you choose Edit-Wiki, but it has Blog.BlogClass if you select
   Edit-Objects, from Blog.WebHome page, I can create a new post with
 tile
   testpage, now the Blog.testpage is the new page created that I need to
   include into another page, this testpage has no velocity code from
   Edit_Wiki. so how to include that page into a different page?
  
 
   I tried: include Macro, includeInContext Macro, includeTopic Macro,
 none
   of
   them displays the testpage for me, any idea?
 
  display is the key. You want to display not to include. See
  http://extensions.xwiki.org/xwiki/bin/view/Extension/Display+Macro .
 
  Hope this helps,
  Marius
 
  
   Thanks very much for your help.
  
   David
   ___
   devs mailing list
   d...@xwiki.org
   http://lists.xwiki.org/mailman/listinfo/devs
  ___
  devs mailing list
  d...@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/devs
 
 

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


[xwiki-users] AUTO: MaryEllen Coleman/Rochester/IBM is out of the office. (returning 12/17/2012)

2012-12-14 Thread MaryEllen Coleman


I am out of the office until 12/17/2012.




Note: This is an automated response to your message  users Digest, Vol 65,
Issue 25 sent on 12/14/2012 22:53:24.

This is the only notification you will receive while this person is away.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users