Use Case: You want to create package of all the nodes modified after certain date and time. This can be use ful in Migration Projects. If you have problem with one of the activation agent and you want to activate pages / Asset to that agent based on time.
Solution: You can use following packages to achieve this use case
You can also refer code form Here
1) Install attached package using package manager
2) Go to http://<host>:<port>/apps/tools/components/listPage.html
3) Select Date and time
4) Then click on submit
5) You can click on create package of modified pages to create package
Feel free to change the code based on your requirement
Hi Yogesh!
ReplyDeleteI recently work on a module that check the contents of CQ5 packages:
The logical is:
- when user go to CQ5 package page for example
http://localhost:4502/etc/packages/my_packages/abc.zip.html, we need
to show all which content has status is "changed", "deleted", "new"
and "ok" since the last built of this package.
- Assume that abc package has contents as below and the file contentpage.jsp is modified from last built package so status must be "changed"
----- Content ---------- status ---
- jcr_root/apps/cq5tool/components/page/
contentpage/ ok
- jcr_root/apps/cq5tool/components/page/
contentpage/.content.xml ok
- jcr_root/apps/cq5tool/components/page/contentpage/contentpage.jsp
changed
- jcr_root/apps/cq5tool/components/page/contentpage/header.jsp
- jcr_root/apps/cq5tool/components/page/contentpage/content.jsp
- jcr_root/apps/cq5tool/components/page/contentpage/headlibs.jsp
- jcr_root/apps/cq5tool/components/page/contentpage/body.jsp
- jcr_root/apps/cq5tool/components/page/contentpage/footer.jsp
I was stuck on how to chechk the content status b/w package's contents and repository's contents
Have any idea for this case?
Great thanks,
Son N
P/S: I used 'last updated' info to check but it seem not good solution.
@Son,
ReplyDeleteFor that you have to compare following property
JcrConstants.JCR_DATA
JcrConstants.JCR_LASTMODIFIED
If you see, Install package already uses that logic to decide what is new or deleted. Symbol mean following
A: Add
D: Delete
U: Updated
-:Nothing is changed
R:Replace
M:Missing
E:Error
Hi Yogesh,
ReplyDeleteThanks for your reply,
In CQ5 we can get the lastmodified info
like this node.getProperty(JcrConstants.JCR_LASTMODIFIED)
I have a question that how can we get all nodes of package (note that these nodes will be difference from CRX reposity)
I try to get nodes of package
pack.getNode().nodes();
/etc/packages/my_packages/cq5tool.zip
/etc/packages/my_packages/cq5tool.zip/jcr:content
/etc/packages/my_packages/cq5tool.zip/jcr:content/vlt:definition
/etc/packages/my_packages/cq5tool.zip/jcr:content/vlt:definition/filter
/etc/packages/my_packages/cq5tool.zip/jcr:content/vlt:definition/filter/f0
/etc/packages/my_packages/cq5tool.zip/jcr:content/vlt:definition/filter/f1
But only get at filter level.
Do you have any advice?
Thanks,
Son N
@Son,
DeleteI knew you will ask this question :) .. But answer is not simple, This information in API you get get from Artifact.
You need to check following classes for more detail
com.day.jcr.vault.fs.impl.ArtifactSetImpl
com.day.jcr.vault.fs.impl.io.FileArtifactHandler
Don't ask me where is documentation :) feel free to decompile vault-fs.jar to get more info :)
thanks alot Yogesh!
ReplyDeleteHi Yoghesh,
ReplyDeleteI have another question:
I want to change the template of the list of package on page http://localhost:4502/crx/packmgr/index.jsp
So I changed the template file in /docroot/js/CRX/packmgr/package.tpl
But it seems not work for me!
Do you have any idea?
Great thanks,
Son N
Son,
ReplyDeleteI am not sure. But I don't recommend to do that as with CQ5.5 there won't be separate war file for CRX. Also try deleting cache from /server/tmp/0/_crx before trying.
Yogesh
It works for me! (CQ5.5)
ReplyDeleteThanks
Hi Yogesh,
ReplyDeletewhen i trying to download that packages i am get "file not available" can you pls advise
thanks,
Antony
Antony,
DeleteI can download document without any problem. If download not working, you can checkout code as well and create package by your self.
Yogesh
HI Yogesh ,
ReplyDeleteis there is any way i can know what property a user has changed for an assets in dam. so that i can track the changed property for a particular dam assets
Amit you can check my reply http://forums.adobe.com/thread/1256578
DeleteYogesh