You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by Suresh Ajja <su...@gmail.com> on 2014/08/05 07:55:23 UTC

Date format change JEXL required for derived attribute for propagation into Target

Hi,
Can somebody provide me date format expression to be used in the derived
attribute for propagation into target.

Syncope format mm/dd/yy
and target application date format is "yyyy-mm-dd hh:mm:ss" e.g.
"2014-08-04 23:36:23"

Regards,
Suresh Ajja

Re: Date format change JEXL required for derived attribute for propagation into Target

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 05/08/2014 10:05, Francesco Chicchiriccò wrote:
> On 05/08/2014 07:55, Suresh Ajja wrote:
>> Hi,
>> Can somebody provide me date format expression to be used in the 
>> derived attribute for propagation into target.
>>
>> Syncope format mm/dd/yy
>> and target application date format is "yyyy-mm-dd hh:mm:ss" e.g. 
>> "2014-08-04 23:36:23"
>
> Hi Suresh,
> providing a derived attribute schema able to perform date format 
> conversion would require the ability to use Java classes in JEXL 
> expressions; however, this feature was disabled for security reasons 
> as consequence of CVE-2014-0111 (more details [1]).
>
> For your needs I would instead suggest to create a simple propagation 
> actions class [2] that in the before() method converts the value in 
> the required format.

It seems I've been too quick: you can anyway empower some string 
manipulation for changing the format in the way you like; given the 
formats above, you can define the JEXL expression for the derived 
attribute as

aDate.split('/').2 + '-' + aDate.split('/').1 + '-' + aDate.split('/').0

where 'aDate' is the Date attribute with conversion pattern 'MM/dd/yy'.

Given such schema definitions, an user with aDate value '08/05/14' will 
also feature a derived value '14-05-08'.

HTH
Regards.

> [1] 
> http://syncope.apache.org/security.html#CVE-2014-0111:_Remote_code_execution_by_an_authenticated_administrator
> [2] 
> https://cwiki.apache.org/confluence/display/SYNCOPE/PropagationActionsClass

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Re: Date format change JEXL required for derived attribute for propagation into Target

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 05/08/2014 07:55, Suresh Ajja wrote:
> Hi,
> Can somebody provide me date format expression to be used in the 
> derived attribute for propagation into target.
>
> Syncope format mm/dd/yy
> and target application date format is "yyyy-mm-dd hh:mm:ss" e.g. 
> "2014-08-04 23:36:23"

Hi Suresh,
providing a derived attribute schema able to perform date format 
conversion would require the ability to use Java classes in JEXL 
expressions; however, this feature was disabled for security reasons as 
consequence of CVE-2014-0111 (more details [1]).

For your needs I would instead suggest to create a simple propagation 
actions class [2] that in the before() method converts the value in the 
required format.

HTH
Regards.

[1] 
http://syncope.apache.org/security.html#CVE-2014-0111:_Remote_code_execution_by_an_authenticated_administrator
[2] 
https://cwiki.apache.org/confluence/display/SYNCOPE/PropagationActionsClass

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/