Cq61ConfContentUpgrade.java
1.33 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.jcr.Node
* javax.jcr.Property
* javax.jcr.RepositoryException
* javax.jcr.Session
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.day.cq.compat.codeupgrade.impl.cq61;
import com.day.cq.compat.codeupgrade.internal.api.ProgressInfoProvider;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Cq61ConfContentUpgrade
implements ProgressInfoProvider {
private final Logger log;
private String progressInfo;
public Cq61ConfContentUpgrade() {
this.log = LoggerFactory.getLogger(this.getClass());
}
@Override
public String getProgressInfo() {
return this.progressInfo;
}
void setProgressInfo(String info) {
this.progressInfo = info;
this.log.info(this.progressInfo);
}
public void doUpgrade(Session session) throws RepositoryException {
this.setProgressInfo("Adding cq:conf default references to /content");
Node content = session.getNode("/content");
if (!content.hasProperty("cq:conf")) {
content.setProperty("cq:conf", new String[]{"/libs", "/apps", "/conf/global"});
}
session.save();
}
}