AutoAssignRule.java
2.08 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.workflow.WorkflowException
* com.day.cq.workflow.WorkflowSession
* com.day.cq.workflow.model.WorkflowModel
* javax.jcr.Node
* javax.jcr.Property
* javax.jcr.RepositoryException
*/
package com.day.cq.wcm.workflow.impl;
import com.day.cq.workflow.WorkflowException;
import com.day.cq.workflow.WorkflowSession;
import com.day.cq.workflow.model.WorkflowModel;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.RepositoryException;
public class AutoAssignRule {
public static final String GLOBBING = "globbing";
public static final String WORKFLOW_MODEL = "workflowModel";
public static final String TEMPLATE_PATH = "templatePath";
public static final String TEMPLATE_RESOURCE_TYPE = "templResourceType";
private Node node;
private WorkflowSession session;
public AutoAssignRule(Node node, WorkflowSession session) {
this.session = session;
this.node = node;
}
public WorkflowModel getWorkflowModel() {
try {
String modelId = this.node.getProperty("workflowModel").getString();
return this.session.getModel(modelId);
}
catch (RepositoryException re) {
}
catch (WorkflowException we) {
// empty catch block
}
return null;
}
public String getTemplatePath() {
try {
return this.node.getParent().getProperty("templatePath").getString();
}
catch (RepositoryException re) {
return null;
}
}
public String getTemplResourceType() {
try {
return this.node.getParent().getProperty("templResourceType").getString();
}
catch (RepositoryException re) {
return null;
}
}
public String getGlobbing() {
try {
return this.node.getProperty("globbing").getString();
}
catch (RepositoryException re) {
return null;
}
}
public Node getNode() {
return this.node;
}
}