1.在ext-impl/src/com/ext/portlet 新建文件夹hello,编写service.xml
2.<service-builder package-path="com.ext.portlet.hello"> 扫描包要对
<namespace>Book</namespace>
<entity name="Book" local-service="false" remote-service="true" >
<!-- PK fields -->
<column name="entryId" type="String" primary="true" /> 实体类的字段
<!-- Audit fields -->
<column name="name" type="String" />
<column name="price" type="int" />
<!-- Order -->
<order by="asc">
<order-column name="name" case-sensitive="false" />
</order>
</entity>
<exceptions>
<exception>EntryName</exception>
</exceptions>
3.在ext中的build-parent.xml中
添加命令
<target name="build-service-portlet-hello">
<antcall target="build-service">
<param name="service.file" value="src/com/ext/portlet/hello/service.xml" /> value对应之前的service.xml的路径
</antcall>
</target>
<target name="build-services">
<antcall target="build-service-portlet-reports" />
<antcall target="build-service-portlet-hello" /> 添加上面的命令
</target>