本文整理汇总了Java中com.day.cq.wcm.api.Page.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Page.getProperties方法的具体用法?Java Page.getProperties怎么用?Java Page.getProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.day.cq.wcm.api.Page
的用法示例。
在下文中一共展示了Page.getProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getThumbnailUrl
import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
private String getThumbnailUrl(Page page, int width, int height) {
String ck = "";
ValueMap metadata = page.getProperties(PN_IMAGE_FILE_JCR_CONTENT);
if (metadata != null) {
Calendar imageLastModified = metadata.get(JcrConstants.JCR_LASTMODIFIED, Calendar.class);
Calendar pageLastModified = page.getLastModified();
if (pageLastModified != null && pageLastModified.after(imageLastModified)) {
ck += pageLastModified.getTimeInMillis() / 1000;
} else if (imageLastModified != null) {
ck += imageLastModified.getTimeInMillis() / 1000;
} else if (pageLastModified != null) {
ck += pageLastModified.getTimeInMillis() / 1000;
}
}
return page.getPath() + ".thumb." + width + "." + height + ".png?ck=" + ck;
}
示例2: getPageProperty
import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
/**
* Allows the developer to directly get a page property from a page object (Supports null parameters).
*
* @param page AEM page object
* @param propertyName Property name
* @return The property value or a blank string if the property is not present.
*/
public static String getPageProperty(Page page, String propertyName) {
String pageProperty = BLANK;
if (page != null) {
ValueMap pageProperties = page.getProperties();
if ((pageProperties != null) && (propertyName != null)) {
pageProperty = pageProperties.get(propertyName, BLANK);
}
}
return pageProperty;
}
示例3: getPropertiesWithValuePageReturnsValidDefaultProperties
import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Test
public void getPropertiesWithValuePageReturnsValidDefaultProperties() throws Exception {
Page target = aPage("/content/test/ko");
ValueMap actual = target.getProperties("");
assertNotNull(actual.get(ResourceProperty.CREATED));
assertEquals("admin", actual.get(ResourceProperty.CREATED_BY));
assertEquals("ko", actual.get(ResourceProperty.TITLE));
assertEquals(ResourceType.PAGE_CONTENT_TYPE, actual.get(ResourceProperty.PRIMARY_TYPE));
assertEquals(PageType.DEFAULT_TEMPLATE.getTemplate().getName(), actual.get(ResourceProperty.TEMPLATE));
}
示例4: getPropertiesWithValuePageReturnsValidDefaultProperties
import com.day.cq.wcm.api.Page; //导入方法依赖的package包/类
@Test
public void getPropertiesWithValuePageReturnsValidDefaultProperties() throws Exception {
Page target = aPage("/content/test/ko");
ValueMap actual = target.getProperties("");
assertEquals("ko", actual.get(ResourceProperty.TITLE));
assertEquals(ResourceType.PAGE_CONTENT_TYPE, actual.get(ResourceProperty.PRIMARY_TYPE));
assertEquals(PageType.DEFAULT_TEMPLATE.getTemplate().getName(), actual.get(ResourceProperty.TEMPLATE));
}