Hi all,
Is there a way I can configure my setup to allow me to access the util binding from within Velocity? I've searched around in the documentation and can't seem to find it.
I really just want to create a map - and whilst I can do it in Groovy, it'll be easier for users if they can do it using velocity.
Any advice?
Cheers,
Adam
>If I try:
>
> {{velocity}}
> #set($map = {'name':'marius'})
> $map.put('myname','adam')
> $map.name and $map.myname
> {{/velocity}}
>
> I get:
>
> $map.put('myname','adam')
> marius and adam
>
> which is normal because the put method returns the previous value mapped
> to the specified key, which is null in our case.
The penny drops. When debugging velocity script I tend to dab $values all over the place and look for where they show up on the page. I hadn't considered this scenario. Dumping the map does indeed show that the entries are in there.
That's fantastic - thanks for your assistance.
Cheers,
Adam
>
> Do you really need a utility class? I just tried this:
Not explicitly no.
> {{velocity}}
> #set($map = {'name':'marius'})
> $map.name
> {{/velocity}}
The problem is that I don't seem to be able to update a
map created that way. If I try:
{{velocity}}
#set($map = {'name':'marius'})
$map.put('myname','adam')
$map.name
{{/velocity}}
It fails. Whereas if I use a map from elsewhere (xcontext for example) and pass it in it seems to work just fine.
I may be missing something obvious, that happens a lot!
Cheers,
Adam
Hi,
I added my LDAP users to Xwiki manually one by one through the Xwiki
Administration form, I did that so I can add them to their corresponding
groups so they have their correct user rights since their first login.
When creating a new user through the form, the password is mandatory, so I
copy/pasted the user in the password field (e.g.: user jsmith and password
jsmith as well).
Then when I asked the user to login, she could login correctly, but then I
thought maybe I should try to login using the password I set on the form,
and oh surprise, it logged in too!, is this the correct behavior or did I do
something wrong here?
I need users to login only when entering their ldap password, not their
xwiki password.
Thanks in advance.
JC
Hi all,
I did a little search on the importing/processing excel files and I am confused a little bit:
First of all, I found Excel plugin:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Excel+Plugin
but it's status is obsolete - "The Plugin technology has been replaced by Components" - so is that
functionality available out of the box in the latest versions of XWiki ?
Moreover, in the comments we can read:
$xwiki.ExcelPlugin should be updated to $xwiki.calc as this is the name of the plugin on a newer XE > 2.1.1
There is also another extension: Excel Import Scaffolding and it clearly points to the Excel plugin page.
http://extensions.xwiki.org/xwiki/bin/view/Extension/Excel+Import+Scaffoldi…
Could someone explain what is the proper way of working with excel files currently, I just don't want to tie
my code to the obsolete components.
Thanks,
Piotr
Dear all,
I'm trying to extend a FAQ application from the tutorial on xwiki site.
I would like to add some FAQ entries from the external file in an automated or semi-automated way.
In the FAQ example there are: question, answer fields for every FAQ entry. Is it possible to add new entries
basing on the external data user provided ?
like to take a data from a text area in a form like:
"question1", "answer1"
"question2", "answer2"
and then create 2 new FAQ objects ?
I've found such a code snippet and fixed it to have:
## Create an object
#set($obj = $doc.newObject("FAQ.FAQClass"))
$obj.set("question","q1")
$obj.set("answer", "a1")
## Save the object in the page
$doc.save()
Even with that it fails to add new object to the existing list. Any clues how to accomplish that ?
Just to recap, I have two questions :
1. Could someone provide a code snippet, or point me to a documentation on creating/adding new objects in
the xwiki ( like how to set parentSpace, basic fields in that object and add it to the xwiki database ).
2. Are there any scenarios on importing data in to the XWiki ( would like to inject a lot of FAQ entries at
once, tried to do that directly to the database but that failed, I guess I should do that via velocity code ? ).
Thanks a lot for any help :)
Regards,
Piotr
Hi Dumitriu,
Thanks for the reply . However,I am deploying xwiki as an exploded webapp only. xwiki.war has been exploded into the directory xwiki.war and kept inside the server/default/deploy/ directory of JBoss.
On Mon, 31 Jan 2011 03:48:26 +0530 Sergiu Dumitriu wrote
>On 01/28/2011 11:16 AM, smita srivastava wrote:
>> I am trying to deploy xwiki on JBoss 5 using HSQL database. I have
>> followed the Installation steps. When i start JBoss ,it is unable to
>> deploy xwiki.war . The other wars in the application are however
>> deployed. The error message is given below.
>
>...
>
>> Exception: could not create
>> Vfs.Dir from url, no matching UrlType was found
>> [vfszip:/F:/gid_1/jboss/server/default/deploy/xwiki-enterprise-web-2.7.war/WEB-INF/lib/xwiki-core-rendering-macro-groovy-2.7.jar/META-INF/maven/]either
>> use fromur-l(final URL url, final List<UrlType> urlTypes) or
>> use the static setDefaultURLTypes(final List<UrlType> urlTypes)
>> or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.
>
>This looks like a limitation in the Reflections library, it can only
>handle file: URLs, or standard in-jar paths containing ".jar!" in them.
>
>The problem is that JBoss tries to deploy the war as an archive,
>virtually uncompressed at runtime, thus it creates URLs with the vfszip
>protocol.
>
>Can you deploy the war as an exploded webapp?
>
>--
>Sergiu Dumitriu
>http://purl.org/net/sergiu/
>_______________________________________________
>users mailing list
>users(a)xwiki.org
>http://lists.xwiki.org/mailman/listinfo/users
>