Hi All,
I am trying to create replication preprocessor, which will restrict particular types of template from been replicated. For this I want to check the resource type of page been replicated and I need resource resolver object for it. I wanted to avoid resourceResolverFactory.getAdministrativeResourceResolver(null); rather use param.put(ResourceResolverFactory.SUBSERVICE, "readService"); but it is throwing a login exception any idea how to get resource using subservice?
@Reference
private transient ResourceResolverFactory resourceResolverFactory;
@Override
public void preprocess(ReplicationAction action, ReplicationOptions options) throws ReplicationException
{
Map<String, Object> param = new HashMap<String, Object>();
param.put(ResourceResolverFactory.SUBSERVICE, "readService");
try
{
ResourceResolver resolver = resourceResolverFactory.getServiceResourceResolver(param);
} catch (LoginException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Thanks!
Shehjad
Solved! Go to Solution.
Hi,
Have you mapped this service in OSGI ? Which version of AEM you are using?
Please take a look at some code base for this :
Hi,
Have you mapped this service in OSGI ? Which version of AEM you are using?
Please take a look at some code base for this :
Hey Praveen,
Thank you I was missing the felix configuration. I am using AEM 6.0 Sp2.
Thanks again for your quick and accurate reply.
Regards,
Shehjad
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies