清单 1. 代表资源(或用户)结构的示例代码
Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ <?xml version="1.0"?> <object class="sample.Resource" abstract="false" extends="sample.BaseObject" testready="false" documentation="A resource represents a user of the system."> <rule type="create" documentation="To create a resource, the user must have the administrator security rights" /> <rule type="update" documentation="A resource has the right to modify itself. Only administrators have the right to modify resources otherwise." /> <rule type="delete" documentation="Administrators have the right to delete a resouce." /> <field name="active" label="Active" type="java.lang.Boolean" default="true" /> <field name="calendar" label="Calendar" type="sample.WorkCalendar" composite="false" /> <field name="contactGroupAssignments" type="sample.ContactGroupAssignment[]" composite="true"> <valid-type class="sample.ContactGroupAssignment" /> </field> <field name="name" label="Full Name" type="java.lang.String" mandatory="true" max="35" /> <field name="password" label="Password" type="java.lang.String" min="3" max="16" readable="false" /> <!-- BaseObject --> <inherited name="parent" mandatory="true"> <valid-type class="sample.ResourceFolder" /> <invalid-type class="sample.Project" /> </inherited> </object> |