PreProcessor full page URL
Can we get full page path in Preprocessor java class ?
Can we get full page path in Preprocessor java class ?
Hi @nusrat_jahan,
When publishing a page in AEM, the process involves publishing various associated nodes, including the template policy (/conf), assets (/content/dam), content (/content), and more. To exclusively target content pages within this process, you can incorporate a filter in your code.
public class ReplicationPreprocessor implements Preprocessor {
@Override
public void preprocess(ReplicationAction action, ReplicationOptions options) throws ReplicationException {
final String path = action.getPath();
if (path.contains(CONTENT_PATH)) {
// Place your logic for content pages here
if(inValid) {
throw new ReplicationException("ERROR_MESSAGE");
}
}
}
}By using this filter, you guarantee that your logic is executed solely on nodes residing under any path specified by CONTENT_PATH.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.