本文整理汇总了Java中com.day.cq.wcm.api.components.EditContext类的典型用法代码示例。如果您正苦于以下问题:Java EditContext类的具体用法?Java EditContext怎么用?Java EditContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EditContext类属于com.day.cq.wcm.api.components包,在下文中一共展示了EditContext类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.day.cq.wcm.api.components.EditContext; //导入依赖的package包/类
@Override
public CharSequence execute(final Object valueObj)
throws Exception {
StringBuffer buffer = new StringBuffer();
TemplateContentModelImpl contentModel = contentModel();
SlingHttpServletRequest slingRequest = contentModel.request();
WCMMode wcmMode = WCMMode.fromRequest(slingRequest);
ClientLibraryUtil clientLibUtil = new ClientLibraryUtil(htmlLibraryManager, slingRequest);
clientLibUtil.setOptions(true, true, false, false, false, BLANK);
if (wcmMode != WCMMode.DISABLED) {
ComponentContext componentContext = WCMUtils.getComponentContext(slingRequest);
EditContext editContext = componentContext.getEditContext();
String dlgPath = null;
if (editContext != null && editContext.getComponent() != null) {
dlgPath = editContext.getComponent().getDialogPath();
}
if (AuthoringUIMode.fromRequest(slingRequest) == AuthoringUIMode.TOUCH) {
buffer.append(clientLibUtil.generateClientLibrariesPristine("cq.authoring.page"));
} else
if (AuthoringUIMode.fromRequest(slingRequest) == AuthoringUIMode.CLASSIC) {
buffer.append(clientLibUtil.generateClientLibrariesPristine("cq.wcm.edit"));
boolean isEditMode = (wcmMode == WCMMode.EDIT) ? true : false;
String dialogPath = dlgPath == null ? "" : dlgPath;
buffer.append(this.getJavaScript(slingRequest, isEditMode, dialogPath));
}
}
return new Handlebars.SafeString(buffer);
}
示例2: getEditContext
import com.day.cq.wcm.api.components.EditContext; //导入依赖的package包/类
public EditContext getEditContext() {
return this.get(EDIT_CONTEXT, EditContext.class);
}
示例3: getEditContext
import com.day.cq.wcm.api.components.EditContext; //导入依赖的package包/类
/**
* Gets the edit context for the current component.
*
* @return the edit context
*/
EditContext getEditContext();