Alfresco自定义数据列表布局

时间:2015-06-04 16:50:15

标签: layout alfresco datalist alfresco-share

我在Alfresco中创建了一个自定义数据列表,并使用所需的数据列填充了其模型。但是,当我在Alfresco共享中查看列表时,订单完全关闭,并且我在模型中没有定义元素。

我已经广泛搜索过如何解决这个问题,并且没有成功。根据我的理解,我需要在share-config-custom.xml中定义布局,我在下面尝试过这个布局(仅我添加的内容片段):

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

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

	<!-- Imports are required to allow references to definitions in other models -->
	<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" />
		<import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" />
	</imports>

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

此代码的目标是仅显示programName文本框。但这就是我所看到的:

Datalist

我错过了什么?

1 个答案:

答案 0 :(得分:2)

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

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

应更换为

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

这也适用于node-type

enter image description here