Hi, I’m trying to generate a random
password string in a <xforms:setvalue> sentence. Could anybody help me ? Best regards, Denis -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
I’ve succeeded with
this code : <xforms:setvalue
ref="instance('local-data')/GeneratedPassword" value="concat(substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+=-$%!:?.',
1+xs:integer(random(true)*72), 1))"/> Do you know, if I can
xform:setvalue from javascript ? Best Regards, De : Denis Galiana
[mailto:[hidden email]] Hi, I’m trying to generate a random password
string in a <xforms:setvalue> sentence. Could anybody help me ? Best regards, Denis -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Yes, you can get/set a control from JS. http://www.orbeon.com/ops/doc/reference-xforms-extensions#xforms-javascript-get-set-value By default, password controls are also encrypted in JS. http://www.orbeon.com/ops/doc/reference-xforms-configuration#d165e1221 Regards, Hank > Ive succeeded with this code : > > > > > <xforms:setvalue ref="instance('local-data')/GeneratedPassword" > > > value="concat(substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy > z0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+= > -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+= > -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+= > -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+= > -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+= > -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+= > -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#+= > -$%!:?.', 1+xs:integer(random(true)*72), 1))"/> > > > > > > > > Do you know, if I can xform:setvalue from javascript ? > > > > Best Regards, > > > > > > De : Denis Galiana [mailto:[hidden email]] > Envoyé : jeudi 7 mai 2009 15:13 > À : [hidden email] > Objet : [ops-users] XForms/XPath expressions in 'value' of > xforms:setvalue; > how to generate a random string (to be used as password) > > > > Hi, > > > > Im trying to generate a random password string in a <xforms:setvalue> > sentence. > > Could anybody help me ? > > > > Best regards, > > Denis > > > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
In reply to this post by Denis Galiana
Denis,
I am glad you found a solution. Also, we often generate random IDs with: digest(string(random(true)), 'MD5', 'hex') Alex |
In reply to this post by Hank Ratzesberger
Thanks Hank,
In fact I would like to set/get data to/from the data model (without using a control). Is it possible ? Thanks -----Message d'origine----- De : Hank Ratzesberger [mailto:[hidden email]] Envoyé : jeudi 7 mai 2009 17:21 À : [hidden email] Objet : [ops-users] Re: RE: XForms/XPath expressions in 'value' of xforms:setvalue; how to generate a random string (to be used as password) Yes, you can get/set a control from JS. http://www.orbeon.com/ops/doc/reference-xforms-extensions#xforms-javascript- get-set-value By default, password controls are also encrypted in JS. http://www.orbeon.com/ops/doc/reference-xforms-configuration#d165e1221 Regards, Hank > Ive succeeded with this code : > > > > > <xforms:setvalue ref="instance('local-data')/GeneratedPassword" > > > value="concat(substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs > tuvwxy z0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 > 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 > 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 > 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 > 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 > 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 > 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), > > > substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 > 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1))"/> > > > > > > > > Do you know, if I can xform:setvalue from javascript ? > > > > Best Regards, > > > > > > De : Denis Galiana [mailto:[hidden email]] > Envoyé : jeudi 7 mai 2009 15:13 > À : [hidden email] > Objet : [ops-users] XForms/XPath expressions in 'value' of > xforms:setvalue; how to generate a random string (to be used as > password) > > > > Hi, > > > > Im trying to generate a random password string in a <xforms:setvalue> > sentence. > > Could anybody help me ? > > > > Best regards, > > Denis > > > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Denis, Without using an intermediate control, it is complicated, I am not sure how you can do this. If you had a web service for your JavaScript and your web page to get the instance data from... It might be possible to use the default submission to update (from javascript) instance data. There would be side effects like what xforms events are fired (or not), the page might refresh. One instance containing the serialized text of another, plus a hidden control to hold the text, plus a way to create a DOM object in javascript from the text is the solution Orbeon designed. Regards, Hank On May 11, 2009, at 12:52 AM, Denis Galiana wrote: > Thanks Hank, > > In fact I would like to set/get data to/from the data model > (without using a > control). > Is it possible ? > > Thanks > > > -----Message d'origine----- > De : Hank Ratzesberger [mailto:[hidden email]] > Envoyé : jeudi 7 mai 2009 17:21 > À : [hidden email] > Objet : [ops-users] Re: RE: XForms/XPath expressions in 'value' of > xforms:setvalue; how to generate a random string (to be used as > password) > > > Yes, you can get/set a control from JS. > > http://www.orbeon.com/ops/doc/reference-xforms-extensions#xforms- > javascript- > get-set-value > > By default, password controls are also encrypted in JS. > > http://www.orbeon.com/ops/doc/reference-xforms-configuration#d165e1221 > > Regards, > Hank > > > >> I’ve succeeded with this code : >> >> >> >> >> <xforms:setvalue ref="instance('local-data')/GeneratedPassword" >> >> >> value="concat(substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs >> tuvwxy z0123456789#+=-$%!:?.', 1+xs:integer(random(true)*72), 1), >> >> >> substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 >> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), >> >> >> substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 >> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), >> >> >> substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 >> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), >> >> >> substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 >> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), >> >> >> substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 >> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), >> >> >> substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 >> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1), >> >> >> substring >> ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456 >> 789#+= -$%!:?.', 1+xs:integer(random(true)*72), 1))"/> >> >> >> >> >> >> >> >> Do you know, if I can xform:setvalue from javascript ? >> >> >> >> Best Regards, >> >> >> >> >> >> De : Denis Galiana [mailto:[hidden email]] >> Envoyé : jeudi 7 mai 2009 15:13 >> À : [hidden email] >> Objet : [ops-users] XForms/XPath expressions in 'value' of >> xforms:setvalue; how to generate a random string (to be used as >> password) >> >> >> >> Hi, >> >> >> >> I’m trying to generate a random password string in a >> <xforms:setvalue> >> sentence. >> >> Could anybody help me ? >> >> >> >> Best regards, >> >> Denis >> >> >> >> > > > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hank, Denis,
That's right: at this point you need to use a control for this, and hide it with "display: none". You can already dispatch events from JavaScript, and we plan to add support for context events (just as you can now on the XForms side with <xxforms:context name="my:control" select="my/control"/>, see: http://www.orbeon.com/ops/doc/reference-xforms-extensions#dispatch-context). When this is done, you will have another option. Alex |
Free forum by Nabble | Edit this page |