Validation Problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Validation Problem

Thomas Fuerer
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Team,

I need some help once again.

I have published a new plugin (thinBackup) in a first version. What I
want to do next ist to add some valitation of the user input. I know
there is some documentation and a red it already. Also I have done some
validation work in another plugin already, but I think this is something
different.

I have a ManagementLink with directs to a page with three links. soem of
these links (two of these) directs to another page.
e.g. thinBackup (mgmtLink) -> Settings(link) -> backupSettings.jelly

My problem is now, that a ManagementLink is not Discribable (so I have
no Descriptor). But the ManagementLink class binds with the jelly
script, so I thought that i should also holds the doCheck methods.
But First I do not know how I need to change the jelly script to call
these methodes, because I need to use the attributes name and value and
not field (it doesn't work)?
e.g.
<f:entry title="Backup schedule for differential backups"
     help="/plugin/thinBackup/help/help-diffBackupSchedule.html">
   <f:textbox value="${it.configuration.diffBackupSchedule}"
      name="diffBackupSchedule"/>
</f:entry>

can anyone help me out with this problem, please?

thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNNygsAAoJEMIrIJt+IWiiKcwH/3INWtBv9l7mvm7wjLFjO83W
hdxXMPHPKI8zmX5LADWtuhMc9gWArqkSCfYEKQ4ZDfL3T1MFQjLyTlGBvud/npgd
MKtE8AraD/xgA117A3cvEnjnV9rPHGmnhSVhLq7V2OqUb/xySSe/E/ngqqOE0bCD
mfqksSPWTMhUUuwTzLH2U0crnPYNIuxw84vrjJ7R4JM0upxrBdKgxsselMx5iiJf
xAeXEmSYFoO8AZH6LzskM/dwq3+GMQmh40ZlbljkRspXX/YHaaXoj3lVrSMTkbnw
sagAVhcRcoqQdCvuAY2eAWuqbA1R3AlZdhtEdZ4pqUBgMI6CSWUaXfELUzJ3EEs=
=lugW
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Validation Problem

Ulli Hafner
I think validation is currently not supported for pages that don't have
a descriptor. I also tried that some time ago without success. If I
remember correctly the Java Script code requires that a $descriptor
variable is bound to an object. Maybe assigning that variable in your
jelly script will help.

See:
http://hudson.361315.n4.nabble.com/FormValidation-Problems-tp392758p392758.html

Ulli


On 01/19/2011 07:06 PM, Thomas Fürer wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Team,
>
> I need some help once again.
>
> I have published a new plugin (thinBackup) in a first version. What I
> want to do next ist to add some valitation of the user input. I know
> there is some documentation and a red it already. Also I have done some
> validation work in another plugin already, but I think this is something
> different.
>
> I have a ManagementLink with directs to a page with three links. soem of
> these links (two of these) directs to another page.
> e.g. thinBackup (mgmtLink) ->  Settings(link) ->  backupSettings.jelly
>
> My problem is now, that a ManagementLink is not Discribable (so I have
> no Descriptor). But the ManagementLink class binds with the jelly
> script, so I thought that i should also holds the doCheck methods.
> But First I do not know how I need to change the jelly script to call
> these methodes, because I need to use the attributes name and value and
> not field (it doesn't work)?
> e.g.
> <f:entry title="Backup schedule for differential backups"
>       help="/plugin/thinBackup/help/help-diffBackupSchedule.html">
>     <f:textbox value="${it.configuration.diffBackupSchedule}"
>        name="diffBackupSchedule"/>
> </f:entry>
>
> can anyone help me out with this problem, please?
>
> thomas
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNNygsAAoJEMIrIJt+IWiiKcwH/3INWtBv9l7mvm7wjLFjO83W
> hdxXMPHPKI8zmX5LADWtuhMc9gWArqkSCfYEKQ4ZDfL3T1MFQjLyTlGBvud/npgd
> MKtE8AraD/xgA117A3cvEnjnV9rPHGmnhSVhLq7V2OqUb/xySSe/E/ngqqOE0bCD
> mfqksSPWTMhUUuwTzLH2U0crnPYNIuxw84vrjJ7R4JM0upxrBdKgxsselMx5iiJf
> xAeXEmSYFoO8AZH6LzskM/dwq3+GMQmh40ZlbljkRspXX/YHaaXoj3lVrSMTkbnw
> sagAVhcRcoqQdCvuAY2eAWuqbA1R3AlZdhtEdZ4pqUBgMI6CSWUaXfELUzJ3EEs=
> =lugW
> -----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: Validation Problem

Romain Seguy
Do you have another descriptor in your plugin that can carry the
doCheck methods?

If yes, you can use the checkUrl attribute in your jelly as follow:

<f:entry field="name" title="${%Name}">
  <f:textbox field="name"
    checkUrl="'${rootURL}/descriptorByName/SomeClassWithDescriptor/checkName?value='+escape(this.value)"/>
 </f:entry>

If you don't have a descriptor, you can still define, for example, a
new Builder. As I said, the descriptor for this builder will carry the
doCheck methods. And if you define the isApplicable method of the
builder descriptor so that it always returns false, nobody will see
it.

HTH,
Romain

2011/1/20 Ullrich Hafner <[hidden email]>:

> I think validation is currently not supported for pages that don't have a
> descriptor. I also tried that some time ago without success. If I remember
> correctly the Java Script code requires that a $descriptor variable is bound
> to an object. Maybe assigning that variable in your jelly script will help.
>
> See:
> http://hudson.361315.n4.nabble.com/FormValidation-Problems-tp392758p392758.html
>
> Ulli
>
>
> On 01/19/2011 07:06 PM, Thomas Fürer wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi Team,
>>
>> I need some help once again.
>>
>> I have published a new plugin (thinBackup) in a first version. What I
>> want to do next ist to add some valitation of the user input. I know
>> there is some documentation and a red it already. Also I have done some
>> validation work in another plugin already, but I think this is something
>> different.
>>
>> I have a ManagementLink with directs to a page with three links. soem of
>> these links (two of these) directs to another page.
>> e.g. thinBackup (mgmtLink) ->  Settings(link) ->  backupSettings.jelly
>>
>> My problem is now, that a ManagementLink is not Discribable (so I have
>> no Descriptor). But the ManagementLink class binds with the jelly
>> script, so I thought that i should also holds the doCheck methods.
>> But First I do not know how I need to change the jelly script to call
>> these methodes, because I need to use the attributes name and value and
>> not field (it doesn't work)?
>> e.g.
>> <f:entry title="Backup schedule for differential backups"
>>      help="/plugin/thinBackup/help/help-diffBackupSchedule.html">
>>    <f:textbox value="${it.configuration.diffBackupSchedule}"
>>       name="diffBackupSchedule"/>
>> </f:entry>
>>
>> can anyone help me out with this problem, please?
>>
>> thomas
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iQEcBAEBAgAGBQJNNygsAAoJEMIrIJt+IWiiKcwH/3INWtBv9l7mvm7wjLFjO83W
>> hdxXMPHPKI8zmX5LADWtuhMc9gWArqkSCfYEKQ4ZDfL3T1MFQjLyTlGBvud/npgd
>> MKtE8AraD/xgA117A3cvEnjnV9rPHGmnhSVhLq7V2OqUb/xySSe/E/ngqqOE0bCD
>> mfqksSPWTMhUUuwTzLH2U0crnPYNIuxw84vrjJ7R4JM0upxrBdKgxsselMx5iiJf
>> xAeXEmSYFoO8AZH6LzskM/dwq3+GMQmh40ZlbljkRspXX/YHaaXoj3lVrSMTkbnw
>> sagAVhcRcoqQdCvuAY2eAWuqbA1R3AlZdhtEdZ4pqUBgMI6CSWUaXfELUzJ3EEs=
>> =lugW
>> -----END PGP SIGNATURE-----
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Validation Problem

Alan Harder-2
Perhaps another option is to use a Plugin class, and use
/plugin/plugin-id/checkSomething in checkUrl, pointing to the
doCheckSomething method in the "extends Plugin" class.

     - Alan


On 01/20/11 00:55, Romain Seguy wrote:

> Do you have another descriptor in your plugin that can carry the
> doCheck methods?
>
> If yes, you can use the checkUrl attribute in your jelly as follow:
>
> <f:entry field="name" title="${%Name}">
>    <f:textbox field="name"
>      checkUrl="'${rootURL}/descriptorByName/SomeClassWithDescriptor/checkName?value='+escape(this.value)"/>
>   </f:entry>
>
> If you don't have a descriptor, you can still define, for example, a
> new Builder. As I said, the descriptor for this builder will carry the
> doCheck methods. And if you define the isApplicable method of the
> builder descriptor so that it always returns false, nobody will see
> it.
>
> HTH,
> Romain
>
> 2011/1/20 Ullrich Hafner<[hidden email]>:
>> I think validation is currently not supported for pages that don't have a
>> descriptor. I also tried that some time ago without success. If I remember
>> correctly the Java Script code requires that a $descriptor variable is bound
>> to an object. Maybe assigning that variable in your jelly script will help.
>>
>> See:
>> http://hudson.361315.n4.nabble.com/FormValidation-Problems-tp392758p392758.html
>>
>> Ulli
>>
>>
>> On 01/19/2011 07:06 PM, Thomas Fürer wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Hi Team,
>>>
>>> I need some help once again.
>>>
>>> I have published a new plugin (thinBackup) in a first version. What I
>>> want to do next ist to add some valitation of the user input. I know
>>> there is some documentation and a red it already. Also I have done some
>>> validation work in another plugin already, but I think this is something
>>> different.
>>>
>>> I have a ManagementLink with directs to a page with three links. soem of
>>> these links (two of these) directs to another page.
>>> e.g. thinBackup (mgmtLink) ->    Settings(link) ->    backupSettings.jelly
>>>
>>> My problem is now, that a ManagementLink is not Discribable (so I have
>>> no Descriptor). But the ManagementLink class binds with the jelly
>>> script, so I thought that i should also holds the doCheck methods.
>>> But First I do not know how I need to change the jelly script to call
>>> these methodes, because I need to use the attributes name and value and
>>> not field (it doesn't work)?
>>> e.g.
>>> <f:entry title="Backup schedule for differential backups"
>>>       help="/plugin/thinBackup/help/help-diffBackupSchedule.html">
>>>     <f:textbox value="${it.configuration.diffBackupSchedule}"
>>>        name="diffBackupSchedule"/>
>>> </f:entry>
>>>
>>> can anyone help me out with this problem, please?
>>>
>>> thomas
>>>
>>> -----BEGIN PGP SIGNATURE-----
>>> Version: GnuPG v1.4.10 (MingW32)
>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>>
>>> iQEcBAEBAgAGBQJNNygsAAoJEMIrIJt+IWiiKcwH/3INWtBv9l7mvm7wjLFjO83W
>>> hdxXMPHPKI8zmX5LADWtuhMc9gWArqkSCfYEKQ4ZDfL3T1MFQjLyTlGBvud/npgd
>>> MKtE8AraD/xgA117A3cvEnjnV9rPHGmnhSVhLq7V2OqUb/xySSe/E/ngqqOE0bCD
>>> mfqksSPWTMhUUuwTzLH2U0crnPYNIuxw84vrjJ7R4JM0upxrBdKgxsselMx5iiJf
>>> xAeXEmSYFoO8AZH6LzskM/dwq3+GMQmh40ZlbljkRspXX/YHaaXoj3lVrSMTkbnw
>>> sagAVhcRcoqQdCvuAY2eAWuqbA1R3AlZdhtEdZ4pqUBgMI6CSWUaXfELUzJ3EEs=
>>> =lugW
>>> -----END PGP SIGNATURE-----
>>