Hi,
I am trying to find how to completely remove the filter path from the content package in AEM using Java. My scenario is like, when author deactivate the page, then that particular page path in the filter of the content package has to be removed. And it has to be implemented using Java. If some have solution, Please let me know. I am using com.day.jcr.vault.fs.api.PathFilterSet, com.day.jcr.vault.fs.config.DefaultWorkspaceFilter and com.day.jcr.vault.packaging.JcrPackageManager.
Regards,
Sai
Solved! Go to Solution.
Views
Replies
Total Likes
Looking through the Javadocs - there is no remove filter method. Perhaps look at deleting the package and creating a new one with the updated filter information.
Views
Replies
Total Likes
These are the APIs you use to programmatically work with AEM packages. Here is a basic code example:
http://massapi.com/class/com/day/jcr/vault/packaging/JcrPackageManager.html
Views
Replies
Total Likes
Thank you for your response. Above one is to remove the package. Actually I am looking for the thing to remove the particular filterpath from the content package.
Regards,
Sai
Views
Replies
Total Likes
Looking through the Javadocs - there is no remove filter method. Perhaps look at deleting the package and creating a new one with the updated filter information.
Views
Replies
Total Likes
Yeah. Do you any method or do you know the way to read all filter paths in a package?. Because to implement the thing as you mentioned above, we should first read the filterpaths of a package. When, I searched the javadocs and I couldn't find it and if you know something about this, please let me know.
Regards,
Sai
Views
Replies
Total Likes
Yeah. Do you any method or do you know the way to read all filter paths in a package?. Because to implement the thing as you mentioned above, we should first read the filterpaths of a package. When, I searched the javadocs and I couldn't find it and if you know something about this, please let me know.
Regards,
Sai
Views
Replies
Total Likes
Look at this:
I agree that we need a good DEV article that shows using these APIS in detail. I am going to add this topic to a list of AEM DEV community articles.
Views
Replies
Total Likes
To get the filter paths details of the content package, we need to get metaInfo ad from there we need to get the filterpaths information in a content package.
Here is the small snippet of code:
import org.apache.jackrabbit.vault.packaging.JcrPackage;
import org.apache.jackrabbit.vault.packaging.JcrPackageDefinition;
import org.apache.jackrabbit.vault.packaging.JcrPackageManager;
WorkspaceFilter launchPackageFilter = (DefaultWorkspaceFilter) jcrPackage.getDefinition().getMetaInf().getFilter();
List<PathFilterSet> launchPackageFilterSets = launchPackageFilter.getFilterSets();
LOG.info("Size of the launchPackageFilterSets ::::::::::::::::::" + launchPackageFilterSets.size());
DefaultWorkspaceFilter newFilter = new DefaultWorkspaceFilter();
DefaultWorkspaceFilter ignoreFilter = new DefaultWorkspaceFilter();
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies