本文整理匯總了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();