本文整理汇总了Java中com.day.cq.commons.jcr.JcrConstants.JCR_CONTENT属性的典型用法代码示例。如果您正苦于以下问题:Java JcrConstants.JCR_CONTENT属性的具体用法?Java JcrConstants.JCR_CONTENT怎么用?Java JcrConstants.JCR_CONTENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.day.cq.commons.jcr.JcrConstants
的用法示例。
在下文中一共展示了JcrConstants.JCR_CONTENT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGeneratedId
private String getGeneratedId() {
String path = resource.getPath();
String inJcrContent = JcrConstants.JCR_CONTENT + "/";
int root = path.indexOf(inJcrContent);
if (root >= 0) {
path = path.substring(root + inJcrContent.length());
}
return path.replace("/", "_");
}
示例2: getPropertyPrefix
public static String getPropertyPrefix(final SlingHttpServletRequest request) {
final boolean isPage = isPage(request);
final boolean isAsset = isAsset(request);
String prefix = "";
if (isPage) {
prefix = JcrConstants.JCR_CONTENT + "/";
} else if (isAsset) {
prefix = JcrConstants.JCR_CONTENT + "/" + DamConstants.METADATA_FOLDER + "/";
}
return prefix;
}
示例3: getReplicationStatus
public String getReplicationStatus() {
Session session = resource.getResourceResolver().adaptTo(Session.class);
String path = resource.getPath();
if (path.contains(JcrConstants.JCR_CONTENT)) {
path = StringUtils.substringAfter(path, JcrConstants.JCR_CONTENT) + JcrConstants.JCR_CONTENT;
} else {
path += "/" + JcrConstants.JCR_CONTENT;
}
log.debug("Getting replication status for {}", path);
ReplicationStatus status = replicator.getReplicationStatus(session, path);
Status rStatus = Status.NOT_ACTIVATED;
if (status != null) {
if (status.isDeactivated()) {
rStatus = Status.DEACTIVATED;
} else if (status.isPending()) {
rStatus = Status.IN_PROGRESS;
} else if (status.isActivated()) {
Calendar lastModified = getLastModified(resource.getResourceResolver(), path);
if (lastModified != null && status.getLastPublished() != null
&& lastModified.after(status.getLastPublished())) {
rStatus = Status.MODIFIED;
} else {
rStatus = Status.ACTIVATED;
}
}
}
log.debug("Retrieved replication status {}", rStatus);
return rStatus.toString();
}