AbstractWorkflowView.java
1.31 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.crx.statistics.Entry
* javax.jcr.Item
* javax.jcr.Node
* javax.jcr.Property
* javax.jcr.RepositoryException
* javax.jcr.Session
*/
package com.day.cq.workflow.impl.statistics;
import com.day.crx.statistics.Entry;
import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
public abstract class AbstractWorkflowView
extends Entry {
public AbstractWorkflowView(String pathPrefix) {
super(pathPrefix);
}
protected long get(Session session, String propertyName) {
Node node = this.getNode(session);
try {
if (node != null && node.hasProperty(propertyName)) {
return node.getProperty(propertyName).getLong();
}
}
catch (RepositoryException re) {
// empty catch block
}
return 0;
}
protected Node getNode(Session session) {
try {
Item item;
if (session.itemExists(this.getPath()) && (item = session.getItem(this.getPath())).isNode()) {
return (Node)item;
}
}
catch (RepositoryException e) {
// empty catch block
}
return null;
}
}