Improved: Converted all TechDataCalendarExcDay related CRUD services from simple to entity-auto (#96)
Improved: Converted all TechDataCalendarExcDay related CRUD services from simple to entity-auto (OFBIZ-11622) Also, added a permission service for MANUFACTURING related base permission.
This commit is contained in:
@@ -144,48 +144,6 @@ under the License.
|
||||
<remove-value value-field="lookedUpValue"/>
|
||||
</if-not-empty>
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="createCalendarExceptionDay" short-description="Create Calendar Exception Day">
|
||||
<check-permission permission="MANUFACTURING" action="_CREATE"><fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarPermissionError"/></check-permission>
|
||||
<check-errors/>
|
||||
<make-value entity-name="TechDataCalendarExcDay" value-field="lookupPKMap"/>
|
||||
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
|
||||
<find-by-primary-key entity-name="TechDataCalendarExcDay" map="lookupPKMap" value-field="newEntity"/>
|
||||
<if-not-empty field="newEntity.calendarId">
|
||||
<add-error>
|
||||
<fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarExceptionDayIdAlreadyExist"/>
|
||||
</add-error>
|
||||
<check-errors/>
|
||||
<else>
|
||||
<make-value entity-name="TechDataCalendarExcDay" value-field="newEntity"/>
|
||||
<set-pk-fields map="parameters" value-field="newEntity"/>
|
||||
<set-nonpk-fields map="parameters" value-field="newEntity"/>
|
||||
<create-value value-field="newEntity"/>
|
||||
</else>
|
||||
</if-not-empty>
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="updateCalendarExceptionDay" short-description="Update CalendarExceptionDay">
|
||||
<check-permission permission="MANUFACTURING" action="_UPDATE"><fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarPermissionError"/></check-permission>
|
||||
<check-errors/>
|
||||
<make-value entity-name="TechDataCalendarExcDay" value-field="lookupPKMap"/>
|
||||
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
|
||||
<find-by-primary-key entity-name="TechDataCalendarExcDay" map="lookupPKMap" value-field="lookedUpValue"/>
|
||||
<set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
|
||||
<store-value value-field="lookedUpValue"/>
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="removeCalendarExceptionDay" short-description="Remove CalendarExceptionDay">
|
||||
<check-permission permission="MANUFACTURING" action="_DELETE"><fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarPermissionError"/></check-permission>
|
||||
<check-errors/>
|
||||
<make-value entity-name="TechDataCalendarExcDay" value-field="lookupPKMap"/>
|
||||
<set-pk-fields map="parameters" value-field="lookupPKMap"/>
|
||||
<find-by-primary-key entity-name="TechDataCalendarExcDay" map="lookupPKMap" value-field="lookedUpValue"/>
|
||||
<if-not-empty field="lookedUpValue.calendarId">
|
||||
<remove-value value-field="lookedUpValue"/>
|
||||
</if-not-empty>
|
||||
</simple-method>
|
||||
|
||||
<simple-method method-name="createCalendarExceptionWeek" short-description="Create Calendar Exception Week">
|
||||
<check-permission permission="MANUFACTURING" action="_CREATE"><fail-property resource="ManufacturingUiLabels" property="ManufacturingCalendarPermissionError"/></check-permission>
|
||||
<check-errors/>
|
||||
|
||||
@@ -41,7 +41,7 @@ under the License.
|
||||
<description>Remove a calendar</description>
|
||||
<auto-attributes include="pk" mode="IN" optional="false"/>
|
||||
</service>
|
||||
|
||||
<!-- TechDataCalendarWeek services -->
|
||||
<service name="createCalendarWeek" engine="simple" default-entity-name="TechDataCalendarWeek"
|
||||
location="component://manufacturing/minilang/techdata/RoutingSimpleServices.xml" invoke="createCalendarWeek">
|
||||
<description>Create a Calendar Week</description>
|
||||
@@ -59,24 +59,32 @@ under the License.
|
||||
<description>Remove a Calendar Week</description>
|
||||
<auto-attributes include="pk" mode="IN" optional="false"/>
|
||||
</service>
|
||||
|
||||
<service name="createCalendarExceptionDay" engine="simple" default-entity-name="TechDataCalendarExcDay"
|
||||
location="component://manufacturing/minilang/techdata/RoutingSimpleServices.xml" invoke="createCalendarExceptionDay">
|
||||
<!-- manufacturing permission service -->
|
||||
<service name="manufacturingPermissionService" engine="simple"
|
||||
location="component://common/minilang/permission/CommonPermissionServices.xml" invoke="genericBasePermissionCheck">
|
||||
<implements service="permissionInterface"/>
|
||||
<attribute name="primaryPermission" type="String" mode="IN" optional="true" default-value="MANUFACTURING"/>
|
||||
<attribute name="altPermission" type="String" mode="IN" optional="true"/>
|
||||
</service>
|
||||
<!-- TechDataCalendarExcDay services -->
|
||||
<service name="createCalendarExceptionDay" engine="entity-auto" default-entity-name="TechDataCalendarExcDay" invoke="create">
|
||||
<description>Create a calendar ExceptionDay</description>
|
||||
<permission-service service-name="manufacturingPermissionService" main-action="CREATE"/>
|
||||
<auto-attributes include="pk" mode="IN" optional="false"/>
|
||||
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
||||
</service>
|
||||
<service name="updateCalendarExceptionDay" engine="simple" default-entity-name="TechDataCalendarExcDay"
|
||||
location="component://manufacturing/minilang/techdata/RoutingSimpleServices.xml" invoke="updateCalendarExceptionDay">
|
||||
<service name="updateCalendarExceptionDay" engine="entity-auto" default-entity-name="TechDataCalendarExcDay" invoke="update">
|
||||
<description>Update a calendar ExceptionDay</description>
|
||||
<permission-service service-name="manufacturingPermissionService" main-action="UPDATE"/>
|
||||
<auto-attributes include="pk" mode="IN" optional="false"/>
|
||||
<auto-attributes include="nonpk" mode="IN" optional="true"/>
|
||||
</service>
|
||||
<service name="removeCalendarExceptionDay" engine="simple" default-entity-name="TechDataCalendarExcDay"
|
||||
location="component://manufacturing/minilang/techdata/RoutingSimpleServices.xml" invoke="removeCalendarExceptionDay">
|
||||
<service name="removeCalendarExceptionDay" engine="entity-auto" default-entity-name="TechDataCalendarExcDay" invoke="delete">
|
||||
<description>Update a calendar ExceptionDay</description>
|
||||
<permission-service service-name="manufacturingPermissionService" main-action="DELETE"/>
|
||||
<auto-attributes include="pk" mode="IN" optional="false"/>
|
||||
</service>
|
||||
<!-- TechDataCalendarExcWeek services -->
|
||||
<service name="createCalendarExceptionWeek" engine="simple" default-entity-name="TechDataCalendarExcWeek"
|
||||
location="component://manufacturing/minilang/techdata/RoutingSimpleServices.xml" invoke="createCalendarExceptionWeek">
|
||||
<description>Create a Calendar Exception Week</description>
|
||||
|
||||
Reference in New Issue
Block a user