ApplyProcessingProfileProcess.java
2.21 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.dam.api.Asset
* com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess
* com.day.cq.workflow.WorkflowException
* com.day.cq.workflow.WorkflowSession
* com.day.cq.workflow.exec.WorkItem
* com.day.cq.workflow.metadata.MetaDataMap
* javax.jcr.RepositoryException
* javax.jcr.Session
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Property
* org.apache.felix.scr.annotations.Service
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.day.cq.dam.core.process;
import com.day.cq.dam.api.Asset;
import com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess;
import com.day.cq.dam.core.process.ProcessingProfileApplier;
import com.day.cq.workflow.WorkflowException;
import com.day.cq.workflow.WorkflowSession;
import com.day.cq.workflow.exec.WorkItem;
import com.day.cq.workflow.metadata.MetaDataMap;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Deprecated
@Component(metatype=0)
@Service
@Property(name="process.label", value={"Apply Metadata Processing Profile"})
public class ApplyProcessingProfileProcess
extends AbstractAssetWorkflowProcess {
private static final Logger log = LoggerFactory.getLogger(ApplyProcessingProfileProcess.class);
private static final String JCR_CONTENT_METADATA = "jcr:content/metadata";
private ProcessingProfileApplier profileApplier = new ProcessingProfileApplier();
public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap args) throws WorkflowException {
try {
Session session = workflowSession.getSession();
Asset asset = this.getAssetFromPayload(workItem, session);
this.profileApplier.applyProcessingProfile(session, asset);
session.save();
}
catch (RepositoryException e) {
log.warn("unexpected error occurred during metadata extraction. Cause: {}", (Object)e.getMessage(), (Object)e);
}
}
}