当前位置: 首页>>代码示例>>Java>>正文


Java WCMMode.EDIT属性代码示例

本文整理汇总了Java中com.day.cq.wcm.api.WCMMode.EDIT属性的典型用法代码示例。如果您正苦于以下问题:Java WCMMode.EDIT属性的具体用法?Java WCMMode.EDIT怎么用?Java WCMMode.EDIT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.day.cq.wcm.api.WCMMode的用法示例。


在下文中一共展示了WCMMode.EDIT属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

@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);
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:33,代码来源:InitScriptHelperFunction.java

示例2: doTag

@Override
public void doTag() throws JspException, IOException {

    wcmEdit = WCMMode.fromRequest(getRequest()) == WCMMode.EDIT;
    wcmDesign = WCMMode.fromRequest(getRequest()) == WCMMode.DESIGN;
    wcmAuthor = !(WCMMode.fromRequest(getRequest()) == WCMMode.DISABLED);

    getPageContext().setAttribute(JSP_ATTR_WCM_EDIT, wcmEdit);
    getPageContext().setAttribute(JSP_ATTR_WCM_DESIGN, wcmDesign);
    getPageContext().setAttribute(JSP_ATTR_WCM_AUTHOR, wcmAuthor);
}
 
开发者ID:headwirecom,项目名称:aem-solr-search,代码行数:11,代码来源:WcmModeTag.java

示例3: isEdit

/**
 * Determine if the current WCMMode is edit mode.
 * 
 * @param pageContext the current page context
 * @return true if the WCMMode is edit
 */
@Function
public static boolean isEdit(PageContext pageContext) {
    if (pageContext == null) {
        return false;
    }
    final ServletRequest request = pageContext.getRequest();
    if (request == null) {
        return false;
    }
    return WCMMode.fromRequest(request) == WCMMode.EDIT;
}
 
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-commons,代码行数:17,代码来源:WCMModeFunctions.java

示例4: getWrongMode

WCMMode getWrongMode() {
    if (getCorrectMode() == WCMMode.EDIT) {
        return WCMMode.DISABLED;
    } else {
        return WCMMode.EDIT;
    }
}
 
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-commons,代码行数:7,代码来源:AbstractModeTest.java

示例5: getMode

@Override
protected WCMMode getMode() {
    return WCMMode.EDIT;
}
 
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-commons,代码行数:4,代码来源:EditMode.java

示例6: getCorrectMode

@Override
WCMMode getCorrectMode() {
    return WCMMode.EDIT;
}
 
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-commons,代码行数:4,代码来源:EditModeTest.java

示例7: isEdit

/**
 * Checks if the request is in mode {@link WCMMode#EDIT}
 * 
 * @param request
 *            request to check
 * @return true if the request is in edit mode
 */
public static boolean isEdit(SlingHttpServletRequest request) {
    return WCMMode.EDIT == WCMMode.fromRequest(request);
}
 
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-commons,代码行数:10,代码来源:ModeUtil.java


注:本文中的com.day.cq.wcm.api.WCMMode.EDIT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。