点击“激活”按钮,我需要调用其他一些自定义工作流程,我需要在哪里进行修改,cq5版本6中涉及的文件是哪个。
答案 0 :(得分:2)
拦截激活按钮点击非常具有侵入性,因此应该在Filter
级别上进行。您可以编写一个示例OSGi组件类:
@Component(immediate = true)
@Service
@Properties({ @Property(name = "filter.scope", value = "REQUEST") })
public class MyCustomReplicationFilter implements Filter {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) request;
if ("/bin/replicate.json".equals(slingRequest.getPathInfo())) {
List<String> paths = Lists.newArrayList(request.getParameterValues("path"));
//do magic with your paths. E.g. invoke workflow
}
}
或者,您可以更改ootb siteadmin面板(/siteadmin
)并更改Activate
按钮的行为以向您的专用servlet发送请求。