【问题标题】:AEM 6.3 create page with fileupload within cq dialogAEM 6.3 在 cq 对话框中创建带有文件上传的页面
【发布时间】:2017-08-16 11:07:54
【问题描述】:

我是 AEM 的新手,我想在 cq 对话框中创建一个带有文件上传(pdf、jpeg)的页面模板。 我只找到了缩略图的方式,但我找不到正确上传的方式。

缩略图想法/结构来自“创建集合”。

我的xml结构:

<form
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form"
    class="foundation-form content-container"
    foundationForm="{Boolean}true"
    maximized="{Boolean}true"
    method="post"
    style="vertical">
    <items jcr:primaryType="nt:unstructured">
        <thumbnail
            granite:class="share-resource-image grid"
            jcr:primaryType="nt:unstructured"
            sling:resourceType="dam/gui/coral/components/commons/thumbnail"
            asset="${empty param.item ? requestPathInfo.suffix : param.item}"
            defaultPreview="{Boolean}true">
            <actions jcr:primaryType="nt:unstructured">
                <upload
                granite:id="thumbnail-upload-button"
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/form/fileupload"
                autoStart="{Boolean}false"
                mimeTypes="[image/png,image/jpeg,application/pdf]"
                multiple="{Boolean}false"
                name="coverImage"
                renderReadOnly="{Boolean}true"
                sizeLimit="100000000"
                text="Dokument hochladen"
                uploadUrl="will_be_replaced"
                useHTML5="{Boolean}false"/>
            </actions>
        </thumbnail>
        <removemanualthumbnail
            granite:id="removemanualthumbnail"
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/form/hidden"
            name="removemanualthumbnail"
            value="false"/>
    </items>
</form>

【问题讨论】:

    标签: xml file-upload aem dam


    【解决方案1】:

    试试这个:

    <fileupload
        jcr:primaryType="nt:unstructured"
        jcr:title="files"
        sling:resourceType="granite/ui/components/foundation/form/fieldset">
        <items jcr:primaryType="nt:unstructured">
        <file
            jcr:primaryType="nt:unstructured" 
            sling:resourceType="granite/ui/components/coral/foundation/form/fileupload"
            autoStart="{Boolean}true"
            cq-msm-lockable="/file"
            fieldLabel="the label for the field"
            mimeTypes="[image/png,image/jpeg,application/pdf]"
            multiple="{Boolean}false"
            name="./file"
            sizeLimit="100000000"
            text="Dokument hochladen"
            uploadUrl="/content/dam/someurl"
            uploadUrlBuilder=""/>
        </items>
    </fileupload>
    

    【讨论】:

    • 我刚刚尝试了解决方案,但对话框中没有显示字段集和文件上传。我认为“对我来说”不可能在页面创建过程中创建文件上传。也许 AEM 6.3 会有更新
    【解决方案2】:

    我也面临这个问题。有两件事帮助了我:

    引用核心组件http://localhost:4502/crx/de/index.jsp#/apps/core/wcm/components/page/v1/page/cq%3Adialog/content/items/tabs/items/thumbnail/items/column/items/thumbnail/upload进行以下对话框...

    <upload jcr:primaryType="nt:unstructured" 
        sling:resourceType="granite/ui/components/coral/foundation/form/fileupload" 
        text="Upload Image" name="./image/file.sftmp" 
        sizeLimit="1000000"
        multiple="{Boolean}false"
        async="{Boolean}true"  
        autostart="{Boolean}false"  
        granite:class="cq-wcm-fileupload" 
        uploadUrl="will_be_replaced">
          <granite:data jcr:primaryType="nt:unstructured" cq-msm-lockable="./image" />
    </upload> 
    

    但是,如果没有 cq:dialog 节点 http://localhost:4502/crx/de/index.jsp#/apps/core/wcm/components/page/v1/page/cq%3Adialog 上的额外客户端库,上述内容将无法工作

    <jcr:root jcr:primaryType="nt:unstructured" 
      sling:resourceType="cq/gui/components/authoring/dialog"
      extraClientlibs="[cq.common.wcm,core.wcm.page.properties,cq.wcm.msm.properties]" 
     ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-11
      • 2018-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多