TranslateResourceProcess.java
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.commons.LanguageUtil
* com.day.cq.workflow.WorkflowException
* com.day.cq.workflow.WorkflowSession
* com.day.cq.workflow.exec.WorkItem
* com.day.cq.workflow.exec.WorkflowProcess
* com.day.cq.workflow.metadata.MetaDataMap
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Properties
* org.apache.felix.scr.annotations.Property
* org.apache.felix.scr.annotations.Service
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ResourceResolver
*/
package com.adobe.cq.wcm.translation.impl.process;
import com.adobe.cq.wcm.translation.impl.process.TranslateLanguageCopyProcess;
import com.day.cq.commons.LanguageUtil;
import com.day.cq.workflow.WorkflowException;
import com.day.cq.workflow.WorkflowSession;
import com.day.cq.workflow.exec.WorkItem;
import com.day.cq.workflow.exec.WorkflowProcess;
import com.day.cq.workflow.metadata.MetaDataMap;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
@Component
@Service(value={WorkflowProcess.class})
@Properties(value={@Property(name="service.description", value={"Translate Resource Properties Workflow Process"}), @Property(name="service.vendor", value={"Adobe"}), @Property(name="process.label", value={"WCM: Translate Resource Properties Process"})})
public class TranslateResourceProcess
extends TranslateLanguageCopyProcess {
public static final String TYPE_JCR_PATH = "JCR_PATH";
private static final String CONFIG_FILE_PATH = "/etc/workflow/models/translation/resource.properties";
@Override
public void execute(WorkItem item, WorkflowSession workflowSession, MetaDataMap args) throws WorkflowException {
super.execute(item, workflowSession, args);
}
@Override
protected String getResourceLanguage(ResourceResolver resourceResolver, Resource resource) {
String langRoot = LanguageUtil.getLanguageRoot((String)resource.getPath());
return langRoot.substring(langRoot.lastIndexOf(47) + 1);
}
@Override
protected String getConfigFilePath() {
return "/etc/workflow/models/translation/resource.properties";
}
}