2015-06-04 51 views
1

我已经在Alfresco中创建了一个自定义数据列表,并且已经用所需的数据列填充了它的模型。但是,当我在Alfresco共享中查看列表时,该订单完全关闭,并且存在我尚未在模型中定义的元素。Alfresco自定义数据列表布局

我已经广泛搜索了如何解决这个问题,并没有成功。据我了解,我需要定义的共享配置,custom.xml布局,这是我尝试以下(仅片断我加的):

<config evaluator="model-type" condition="orpdl:orpList"> 
 
\t \t <forms> 
 
\t \t \t <form> 
 
\t \t \t \t <field-visibility> 
 
\t \t \t \t \t <show id="orpdl:programName" /> 
 
\t \t \t \t </field-visibility> 
 
\t \t \t \t <create-form template="../data-lists/forms/dataitem.ftl" /> 
 
\t \t \t \t <appearance> 
 
\t \t \t \t \t <field id="orpdl:programName"> 
 
         <control template="/org/alfresco/components/form/controls/textarea.ftl" /> 
 
\t \t \t \t \t </field> 
 
       </appearance> 
 
\t \t \t </form> 
 
\t \t </forms> 
 
\t </config> 
 
\t 
 
\t <config evaluator="node-type" condition="orpdl:orpList"> 
 
\t \t <forms> 
 
\t \t \t <form> 
 
\t \t \t \t <field-visibility> 
 
\t \t \t \t \t <show id="orpdl:programName" /> 
 
\t \t \t \t </field-visibility> 
 
\t \t \t \t <create-form template="../data-lists/forms/dataitem.ftl" /> 
 
\t \t \t \t <appearance> 
 
\t \t \t \t \t <field id="orpdl:programName"> 
 
         <control template="/org/alfresco/components/form/controls/textarea.ftl" /> 
 
\t \t \t \t \t </field> 
 
       </appearance> 
 
\t \t \t </form> 
 
\t \t </forms> 
 
\t </config>

内容模型:

<?xml version="1.0" encoding="UTF-8"?> 
 
<!-- Definition of new Model --> 
 
<model name="orpdl:orpDataListModel" xmlns="http://www.alfresco.org/model/dictionary/1.0"> 
 

 
\t <!-- Optional meta-data about the model --> 
 
\t <description>Information retrieved from the Opportunity Registration Process workflow form.</description> 
 
\t <author>Alan George</author> 
 
\t <version>1.0</version> 
 

 
\t <!-- Imports are required to allow references to definitions in other models --> 
 
\t <imports> 
 
\t \t <!-- Import Alfresco Dictionary Definitions --> 
 
\t \t <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" /> 
 
\t \t <!-- Import Alfresco Content Domain Model Definitions --> 
 
\t \t <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" /> 
 
\t \t <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" /> 
 
\t \t <import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" /> 
 
\t </imports> 
 

 
\t <!-- Introduction of new namespaces defined by this model --> 
 
\t <namespaces> 
 
\t \t <namespace uri="http://www.test.com/model/orpDataListModel/1.0" prefix="orpdl" /> 
 
\t </namespaces> 
 
\t 
 
\t <constraints> 
 
     <constraint name="orpdl:contractTypeList" type="LIST"> 
 
\t \t \t <parameter name="allowedValues"> 
 
\t \t \t \t <list> 
 
\t \t \t \t   <value>T&amp;M</value> 
 
\t \t \t \t   <value>FFP</value> 
 
\t \t \t \t   <value>CPFF</value> 
 
\t \t \t \t   <value>CPIF</value> 
 
\t \t \t \t </list> 
 
\t   </parameter> 
 
\t \t </constraint> 
 
\t </constraints> 
 
\t 
 
\t <types> 
 
\t \t <type name="orpdl:orpList"> 
 
\t \t \t <title>Opportunity Registration Process</title> 
 
\t \t \t <description>Information retrieved from the Opportunity Registration Process workflow form.</description> 
 
\t \t \t <parent>dl:dataListItem</parent> 
 
\t \t \t <properties> 
 
\t \t \t \t <property name="orpdl:programName"> 
 
\t \t \t \t \t <title>Program Name</title> 
 
\t \t \t \t \t <type>d:text</type> 
 
\t \t \t \t \t <mandatory>true</mandatory> 
 
\t \t \t \t </property> 
 
\t \t \t \t <property name="orpdl:programDescription"> 
 
\t \t \t \t \t <title>Program Description</title> 
 
\t \t \t \t \t <type>d:text</type> 
 
\t \t \t \t \t <mandatory>true</mandatory> 
 
\t \t \t \t </property> 
 
\t \t \t \t <property name="orpdl:client"> 
 
\t \t \t \t \t <title>Client</title> 
 
\t \t \t \t \t <type>d:text</type> 
 
\t \t \t \t \t <mandatory>true</mandatory> 
 
\t \t \t \t </property> 
 
\t \t \t \t <property name="orpdl:contractType"> 
 
\t \t \t \t \t <title>Contract Type</title> 
 
\t \t \t \t \t <type>d:text</type> 
 
\t \t \t \t \t <mandatory>true</mandatory> 
 
\t \t \t \t \t <constraints> 
 
\t \t \t \t \t \t <constraint ref="orpdl:contractTypeList" /> 
 
\t \t \t \t \t </constraints> 
 
\t \t \t \t </property> 
 
\t \t \t \t <property name="orpdl:value"> 
 
\t \t \t \t \t <title>Value</title> 
 
\t \t \t \t \t <type>d:text</type> 
 
\t \t \t \t \t <mandatory>true</mandatory> 
 
\t \t \t \t </property> 
 
\t \t \t </properties> 
 
\t \t </type> 
 
\t </types> 
 
</model>

这段代码的目的是让只有p出现rogramName文本框。但是,这是我所看到的:

Datalist

我缺少什么?

+0

请添加内容模型(如果您已经定义了数据列表)为好。 –

+0

@KrutikJayswal刚刚添加。 – Alan

回答

2

您在<config>标签中输入了错误的条件。
下面

<config evaluator="model-type" condition="orpdl:orpDataListModel">



<config evaluator="model-type" condition="orpdl:issuesList">

这也将适用于node-type取代。

enter image description here

+0

感谢您的帮助,但是,这只是我的错误。我更新了示例代码以反映我当前的代码,并将类型和配置名称更新为“orpList”。我仍然在我的数据列表中看到不需要的元素。 – Alan

+0

请参阅image.I部署了http://pastebin.com/LVWhLEBd链接中的代码 –

+0

service-context.xml文件是否不属于/ alfresco/module//context?否则,我的代码与您的代码完全一样,而且我仍然没有看到您所看到的内容。我赞成你的努力。 – Alan