如何在自定义内容模型中创建文件上载控件

时间:2014-09-15 06:51:06

标签: alfresco alfresco-share

我使用一些文本框和下拉控件创建自定义模型。但我想创建文件上传控件。我怎样才能在alfresco 4.2.f中做到这一点?

任何人都能帮帮我吗?如何在自定义内容模型中创建文件上传? 我创建了自定义模型:以下是我的customModel.xml文件

<?xml version="1.0" encoding="UTF-8"?>

<!-- Optional meta-data about the model -->
<description>Custom Model</description>
<author>Admin</author>
<version>1.0</version>

<imports>
    <!-- Import Alfresco Dictionary Definitions -->
    <import uri="http://www.alfresco.org/model/dictionary/1.0"
        prefix="d" />
    <!-- Import Alfresco Content Domain Model Definitions -->
    <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
    <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
</imports>
<namespaces>
    <namespace uri="http://www.healthindia.org/model/content/1.0" prefix="my" />
</namespaces>


<constraints>

    <constraint name="my:departmentcategory" type="LIST">
        <parameter name="allowedValues">
            <list>
                <value>Dep 1</value>
                <value>Dep 2</value>
            </list>
        </parameter>
    </constraint>





    <constraint name="my:billcategory" type="LIST">
        <parameter name="allowedValues">
            <list>
                <value>BillType1</value>
                <value>BillType2</value>

            </list>
        </parameter>
    </constraint>


</constraints>
<types>

    <!-- Definition of new Content Type: Press Release -->
    <type name="my:content">
        <title>My Post</title>
        <parent>cm:content</parent>
        <properties>

            <property name="my:department">
                <title>Department</title>
                <type>d:mltext</type>
                <multiple>false</multiple>
                <index enabled="false">
                    <atomic>false</atomic>
                    <stored>false</stored>
                    <tokenised>false</tokenised>
                </index>
                <constraints>
                    <constraint ref="my:departmentcategory" />

                </constraints>
            </property>





            <property name="my:subject">
                <title>Subject</title>
                <type>d:mltext</type>
            </property>


            <property name="my:billtype">
                <title>Bill Type</title>
                <type>d:mltext</type>
                <multiple>false</multiple>
                <index enabled="false">
                    <atomic>false</atomic>
                    <stored>false</stored>
                    <tokenised>false</tokenised>
                </index>
                <constraints>
                    <constraint ref="my:billcategory" />

                </constraints>
            </property>


            <property name="my:billtitle">
                <title>Bill Title</title>
                <type>d:mltext</type>
            </property>


            <property name="my:billno">
                <title>Bill No</title>
                <type>d:mltext</type>
            </property>





            <!-- <property name="my:category"> <title>Category</title> <type>d:mltext</type> 
                </property> -->

        </properties>
        <associations>


 <association name="my:files">
                <title>Files</title>
                <source>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </source>
                <target>
                    <class>cm:content</class>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </target>

            </association>
</associations> 

    </type>
    <!-- Definition of new Content Type: Press Release -->
    <type name="my:housecontent">
        <title>House Master</title>
        <parent>cm:content</parent>
        <properties>



            <property name="my:houseid">
                <title>House Id</title>
                <type>d:mltext</type>
            </property>


            <property name="my:housename">
                <title>House Name</title>
                <type>d:mltext</type>
            </property>
            <!-- <property name="my:category"> <title>Category</title> <type>d:mltext</type> 
                </property> -->

        </properties>

    </type>

</types>

在这个文件中我创建了文本框和下拉控件,我也想要文件上传(比如在alfresco explorer中添加内容)。我不知道如何做到这一点。

0 个答案:

没有答案