sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suren Konathala (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SLING-7748) Value of Month from jcr:lastModified is INCORRECT when org.apache.sling.api.resource.Resource.getValueMap() is used
Date Wed, 20 Jun 2018 17:58:00 GMT

    [ https://issues.apache.org/jira/browse/SLING-7748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16518407#comment-16518407
] 

Suren Konathala commented on SLING-7748:
----------------------------------------

I ran teh query to get th results and also tok screenshots of the data as saved on jcr:content
node. The data that is being written to jcr:content node is correct. Because the last modified
time stamp is correct after we make changes to the asset. But when we retrieve the data from
the API we see the difference.

Attached the screenshots.

Having said the above, wonder what AEM maybe using internally to display the data on the jcr:content
node show via crx/de? This seems to be correct.

 

!service-result.png!

 

!indy.png!

 

!indy2.png!

 

!how-to-create.png!

 

!sand.png!

> Value of Month from jcr:lastModified is INCORRECT when org.apache.sling.api.resource.Resource.getValueMap()
is used
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-7748
>                 URL: https://issues.apache.org/jira/browse/SLING-7748
>             Project: Sling
>          Issue Type: Bug
>          Components: API
>    Affects Versions: API 2.16.2
>            Reporter: Suren Konathala
>            Priority: Major
>         Attachments: Screen Shot 2018-06-19 at 4.09.38 PM.png, Screen Shot 2018-06-19
at 4.09.56 PM.png, how-to-create.png, how-to-create.png, indy.png, indy2.png, sand.png, sand.png,
service-result.png, service-result.png
>
>
> When using *org.apache.sling.api.resource.Resource* , the method *getValueMap (* [https://sling.apache.org/apidocs/sling9/org/apache/sling/api/resource/Resource.html#getValueMap--] ),
returns a ValueMap of all the properties. 
> We observed that the "*month*" in "*jcr:lastModified*" is off by 1 month. While Year,
Day, Hour, Min, Seconds are all correct. Please see the attachments. And this is the same
for all Nodes.
> The last date modified was "2018-*{color:#d04437}05{color}*-29T10:31:49.123-05:00" while
the value from the above method returned as below:
> {color:#333333}jcr:lastModified\"{\"year\":2018,*{color:#d04437}\"month\":4,\{color}*"dayOfMonth\":29,\"hourOfDay\":10,\"minute\":31,\"second\":49}{color}
> We did not test this on all nodes though.
>  
> Sample code:
> {code:java}
> Resource jcrdataResource = resource.getChild("jcr:content");
> ValueMap jcrProperties = ResourceUtil.getValueMap(jcrdataResource);
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message