Adobe CQ Image Coponent文件名 [英] Adobe CQ Image Coponent fileName

查看:164
本文介绍了Adobe CQ Image Coponent文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Maven原型创建了一个新的Adobe CQ 5.6.1项目,然后创建了一个页面组件,以及一个 cq:Page 使用该页面组件作为 sling:resourceType 。页面组件具有

I created a new Adobe CQ 5.6.1 Project using the Maven archetype, then created a page component, and a cq:Page that uses that page component as the sling:resourceType. The page component has a

<cq:include path="par" resourceType="foundation/components/parsys" />

该票面的设计具有属性

components="[/libs/foundation/components/image,/libs/foundation/components/download]"

一切都很好,我可以加载页面,在助手中,我看到了图像和下载组件,并能够将它们拖入标准值。

Everything is fine, I can load the page, in the sidekick I see the Image and Download components and am able to drag them into the par.

编辑下载组件时,我从文件系统中选择一个文件,该文件被上传到CRX并成为 file 节点。该文件节点的父节点获得一个名为 fileName 的属性,该属性反映了上载文件的文件名。

When I edit the Download component, I select a file from my file system which gets uploaded to the CRX into a file node. The parent of this file node gets a property called fileName which reflects the file name of the uploaded file.

何时我编辑Image组件,它的行为与从我的文件系统中选择的文件并将其上载到 file 节点的方式相同,但是没有 fileName 属性集。

When I edit the Image component, it behaves the same way by taking the file I selected from my file system and uploading it to a file node, however there is not fileName property set.

在查看每个基础组件的对话框时,我看到它们都有一个 fileNameParameter ,但是对于 foundation / components / image 只是被忽略。我需要保留原始上传的 fileName ,如何使用 foundation / components / image 做到这一点。

Looking at the dialog for each of those foundation components, I see they have a fileNameParameter, however in the case of the foundation/components/image that is just ignored. I need to persist the original upload fileName, how can I do this with foundation/components/image.

推荐答案

我通过将此JS脚本放入clientlib中扩展了 html5smartimage xtype。 p>

I extended the html5smartimage xtype by putting this JS script into a clientlib

var MyAppLib = MyAppLib || {};

MyAppLib.NamedHtml5SmartImage = CQ.Ext.extend(CQ.html5.form.SmartImage, {

    constructor : function(config) {

        config = config || {};
        var defaults = {
            "transferFileName" : true
        };

        CQ.Util.applyDefaults(config, defaults);
        MyAppLib.NamedHtml5SmartImage.superclass.constructor.call(this, config);
    }
});

CQ.Ext.reg("namedhtml5smartimage", MyAppLib.NamedHtml5SmartImage);

,然后根据 foundation / components / image创建一个新的组件并取消我的xtype namedhtml5smartimage 的位置,代替对话框标签配置中的 html5smartimage

and then created a new component based on foundation/components/image and unsed my xtype namedhtml5smartimage in place of the html5smartimage in the dialog tab configuration.

这篇关于Adobe CQ Image Coponent文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆