本文整理汇总了Java中org.apache.jackrabbit.util.ISO9075.encodePath方法的典型用法代码示例。如果您正苦于以下问题:Java ISO9075.encodePath方法的具体用法?Java ISO9075.encodePath怎么用?Java ISO9075.encodePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jackrabbit.util.ISO9075
的用法示例。
在下文中一共展示了ISO9075.encodePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearUserWidgetData
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
public void clearUserWidgetData(String widgetId) {
try {
String className = "ro.nextreports.server.domain.UserWidgetParameters";
String xpath = "/jcr:root" + ISO9075.encodePath(StorageConstants.USERS_DATA_ROOT) + "//*[@className='"
+ className + "']";
NodeIterator nodes = getTemplate().query(xpath).getNodes();
while (nodes.hasNext()) {
Node node = nodes.nextNode();
if (node.getName().equals(widgetId)) {
node.remove();
}
}
getTemplate().save();
} catch (RepositoryException e) {
throw convertJcrAccessException(e);
}
}
示例2: modifyDashboardState
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void modifyDashboardState() throws RepositoryException {
LOG.info("Modify dashboard state - add columnCount property");
String path = StorageConstants.DASHBOARDS_ROOT;
String className = "ro.nextreports.server.domain.DashboardState";
String statement = "/jcr:root" + ISO9075.encodePath(path) + "//*[@className='" + className + "']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " dashboard state nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
node.setProperty("columnCount", 2);
}
getTemplate().save();
}
示例3: addRuntimeNameProperty
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void addRuntimeNameProperty() throws RepositoryException {
String statement =
"/jcr:root" + ISO9075.encodePath(StorageConstants.REPORTS_ROOT) +
"//*[@className='ro.nextreports.server.domain.Report']" +
"//*[fn:name()='parametersValues']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("RuntimeHistory : Found " + nodes.getSize() + " parameterValues nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
NodeIterator childrenIt = node.getNodes();
while (childrenIt.hasNext()) {
Node child = childrenIt.nextNode();
child.setProperty("runtimeName", child.getName());
}
}
getTemplate().save();
}
示例4: updateTemplateNodes
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void updateTemplateNodes() throws RepositoryException {
// add shortcutType node to all report templates nodes
String statement =
"/jcr:root" + ISO9075.encodePath(StorageConstants.REPORTS_ROOT) +
"//*[@className='ro.nextreports.server.domain.Report']/templates";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Add shortcutType node to all report templates nodes : Found " + nodes.getSize() + " report nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
NodeIterator templatesForReport = node.getNodes();
while (templatesForReport.hasNext()) {
Node template = templatesForReport.nextNode();
Node shortcutTypeNode = template.addNode("shortcutType");
shortcutTypeNode.setProperty("type", 0);
shortcutTypeNode.setProperty("timeType", 0);
shortcutTypeNode.setProperty("timeUnits", 0);
}
}
getTemplate().save();
}
示例5: addAnalystUserProfile
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void addAnalystUserProfile() throws RepositoryException {
LOG.info("User profile analyst");
String path = StorageConstants.USERS_ROOT ;
String className = "ro.nextreports.server.domain.User";
String statement = "/jcr:root" + ISO9075.encodePath(path) + "//*[@className='" + className + "']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
node.setProperty("profile", "analyst");
}
getTemplate().save();
}
示例6: updateInternalSettings
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void updateInternalSettings() throws RepositoryException {
// find all internalSettings nodes from DASHBOARDS and change chartId property in entityId
String statement = "/jcr:root" + ISO9075.encodePath(StorageConstants.DASHBOARDS_ROOT) + "//*[fn:name()='internalSettings']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " internalSettings nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
try {
Property prop = node.getProperty("chartId");
node.setProperty("entityId", prop.getValue());
prop.remove();
} catch (PathNotFoundException ex) {
// if property not found we have nothing to do
}
}
}
示例7: renameChartWidgetClassName
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void renameChartWidgetClassName() throws RepositoryException {
LOG.info("Rename chart widget class name");
String path = StorageConstants.DASHBOARDS_ROOT;
String className = "ro.nextreports.server.web.chart.ChartWidget";
String newClassName = "ro.nextreports.server.web.dashboard.chart.ChartWidget";
String statement = "/jcr:root" + ISO9075.encodePath(path) + "//*[@widgetClassName='" + className + "']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
node.setProperty("widgetClassName", newClassName);
}
getTemplate().save();
}
示例8: escapeXpath
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
public static String escapeXpath(String xpath) {
final Matcher matcher = XPATH.matcher(xpath);
if (matcher.find()) {
final String path = ISO9075.encodePath(matcher.group(1));
final String props = matcher.group(2);
return String.format("/jcr:root%s//%s", path, props);
}
return xpath;
}
示例9: renamePackage
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void renamePackage(String path, String propertyName) throws RepositoryException {
String statement = "/jcr:root" + ISO9075.encodePath(path) + "//*[@" + propertyName + "]";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " entity nodes with property '" + propertyName + "'");
while (nodes.hasNext()) {
renamePackage(nodes.nextNode(), propertyName);
}
}
示例10: convertReports
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void convertReports() throws RepositoryException {
String statement =
"/jcr:root" + ISO9075.encodePath(StorageConstants.REPORTS_ROOT) +
"//*[@className='ro.nextreports.server.domain.Report' and @type='Next']" +
"//*[fn:name()='jcr:content' and @jcr:mimeType='text/xml']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Converter 5.1 : Found " + nodes.getSize() + " report nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
Node reportNode = node.getParent().getParent().getParent().getParent();
String reportName = reportNode.getName();
String reportPath = reportNode.getPath();
LOG.info(" * Start convert '" + reportPath + "'");
Property prop = node.getProperty("jcr:data");
String xml = null;
try {
xml = new Converter_5_2().convertFromInputStream(prop.getBinary().getStream(), true);
if (xml != null) {
ValueFactory valueFactory = node.getSession().getValueFactory();
Binary binaryValue = valueFactory.createBinary(new ByteArrayInputStream(xml.getBytes("UTF-8")));
node.setProperty ("jcr:data", binaryValue);
LOG.info("\t -> OK");
} else {
LOG.error("\t -> FAILED : null xml");
}
} catch (Throwable t) {
LOG.error("\t-> FAILED : " + t.getMessage(), t);
}
}
}
示例11: resetFirstUsageDates
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void resetFirstUsageDates() throws Exception {
LOG.info("Reset firstUsage.date for all users");
String statement = "/jcr:root"
+ ISO9075.encodePath(StorageConstants.USERS_ROOT)
+ "//*[@className='ro.nextreports.server.domain.UserPreferences']";
QueryResult queryResult = jcrTemplate.query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " user preferences nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
Node pNode = node.getNode("preferences");
try {
Property property = pNode.getProperty("firstUsage.date");
if (property.getValue() != null) {
LOG.info(" removed firstUsage.date = " + property.getString() + " for user " + node.getParent().getName());
String s = null;
pNode.setProperty("firstUsage.date", s);
}
} catch (PathNotFoundException ex) {
// nothing to do
}
}
jcrTemplate.save();
}
示例12: addDestinations
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void addDestinations() throws RepositoryException {
LOG.info("Add destinations to scheduler jobs");
String path = StorageConstants.SCHEDULER_ROOT ;
String className = "ro.nextreports.server.domain.SchedulerJob";
String statement = "/jcr:root" + ISO9075.encodePath(path) + "//*[@className='" + className + "']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " scheduler job nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
if (node.hasNode("mail")) {
LOG.info("Found 'mail' node for '" + node.getName() + "'");
Node mailNode = node.getNode("mail");
LOG.info("Create '" + StorageConstants.DESTINATIONS + "' node for '" + node.getName() + "'");
Node destinationsNode = node.addNode(StorageConstants.DESTINATIONS);
className = SmtpDestination.class.getName();
LOG.info("Change 'className' property for 'mail' node to '" + className + "'");
mailNode.setProperty("className", className);
LOG.info("Move '" + mailNode.getName() + "' to '" + destinationsNode.getName() + "/mail");
getTemplate().move(mailNode.getPath(), destinationsNode.getPath() + "/mail");
}
}
getTemplate().save();
}
示例13: onUpdate
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
private void onUpdate() throws RepositoryException {
String statement = "/jcr:root" + ISO9075.encodePath(StorageConstants.DATASOURCES_ROOT) + "//*[@className='ro.nextreports.server.domain.DataSource']";
QueryResult queryResult = getTemplate().query(statement);
NodeIterator nodes = queryResult.getNodes();
LOG.info("Found " + nodes.getSize() + " data sources nodes");
while (nodes.hasNext()) {
Node node = nodes.nextNode();
Node propertiesNode = node.addNode(StorageConstants.PROPERTIES);
}
getTemplate().save();
}
示例14: escapeNumber
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
public static String escapeNumber(String number) {
return ISO9075.encodePath(number);
}
示例15: getEntitiesByClassName
import org.apache.jackrabbit.util.ISO9075; //导入方法依赖的package包/类
public Entity[] getEntitiesByClassName(String path, String className) throws NotFoundException {
checkPath(path);
String statement = "/jcr:root" + ISO9075.encodePath(path) + "//*[@className='" + className + "']";
return getEntities(statement);
}