<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
  -->

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
    <description>Content Component Content Services</description>
    <vendor>OFBiz</vendor>

    <!-- create content services -->
    <service name="createContent" default-entity-name="Content" engine="entity-auto" invoke="create" auth="true">
        <description>Create a Content</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="nonpk" mode="INOUT" optional="true" entity-name="ContentAssoc"/><!--useful to forward some fields waiting by some seca present
                                                                                                      for historic reason but need refactoring it to isolate
                                                                                                      correctly this functionality-->
        <attribute name="contentAssocTypeId" type="String" mode="INOUT" optional="true"/>
        <attribute name="contentIdFrom" type="String" mode="INOUT" optional="true"/>
        <attribute name="contentIdTo" type="String" mode="INOUT" optional="true"/>
        <!-- TODO: the following fields are deprecated; but will not be removed until all services and callers are updated -->
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="targetOperationString" optional="true" type="String"/>
        <attribute mode="IN" name="contentPurposeList" optional="true" type="List"/>
        <attribute mode="IN" name="contentPurposeString" optional="true" type="String"/>
        <attribute mode="IN" name="skipPermissionCheck" optional="true" type="String"/>
        <attribute mode="IN" name="displayFailCond" optional="true" type="Boolean"/>
        <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
        <!-- end of deprecated fields -->
        <override name="contentTypeId" default-value="DOCUMENT"/>
        <override name="statusId" default-value="CTNT_IN_PROGRESS"/>
        <override name="contentName" allow-html="safe"/>
        <override name="description" allow-html="safe"/>
    </service>

    <service name="createTextAndUploadedContent" engine="simple" auth="true"
            location="component://content/minilang/content/ContentServices.xml" invoke="createTextAndUploadedContent">
        <description>Creates text content and optional uploaded sub-content</description>
        <implements service="createTextContent"/>
        <implements service="uploadFileInterface" optional="true"/>
        <implements service="createContentFromUploadedFile" optional="true"/>
    </service>

    <service name="createTextContent" engine="group" auth="true">
        <description>Creates a Text Document DataResource and Content Records</description>
        <!-- uses createContent internally; additonal permission(s) not necessary -->
        <group>
            <invoke name="createDataText" result-to-context="true"/>
            <invoke name="createContent" result-to-context="true"/>
        </group>
    </service>

    <service name="createContentFromDataResource" engine="simple"
             location="component://content/minilang/content/ContentServices.xml" invoke="createContentFromDataResource">
        <description>Creates content record from data resource and allows all content fields to be set</description>
        <!-- uses createContent internally; additonal permission(s) not necessary -->
        <implements service="createContent" optional="true"/>
        <attribute name="dataResourceId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingDataResourceId"/>
            </type-validate>
        </attribute>
        <attribute name="contentId" type="String" mode="OUT" optional="false"/>
        <attribute name="uploadedFile" type="java.nio.ByteBuffer" mode="IN" optional="true"/>
    </service>

    <service name="attachUploadToDataResource" engine="simple" transaction-timeout="300"
             location="component://content/minilang/data/DataServices.xml" invoke="attachUploadToDataResource">
        <description>Accepts uploaded content and attaches to an existing data resource</description>
        <!-- uses createContent internally; additonal permission(s) not necessary -->
        <implements service="uploadFileInterface"/>
        <attribute name="dataResourceId" type="String" mode="INOUT" optional="false">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingDataResourceId"/>
            </type-validate>
        </attribute>
        <attribute name="dataResourceTypeId" type="String" mode="IN" optional="true"/>
        <!-- mimetype is set from the uploaded file (contentType) when empty -->
        <attribute name="mimeTypeId" type="String" mode="INOUT" optional="true"/>
        <attribute mode="IN" name="rootDir" optional="true" type="String"/>
    </service>

    <service name="createContentFromUploadedFile" engine="group" transaction-timeout="300">
        <description>Accepts file upload, creates DataResource and Content records.</description>
        <!-- uses createContent internally; additonal permission(s) not necessary -->
        <group>
            <invoke name="createDataResource" parameters="preserve" result-to-context="true"/>
            <invoke name="attachUploadToDataResource" parameters="preserve" result-to-context="true"/>
            <invoke name="createContentFromDataResource"/>
        </group>
    </service>

    <service name="updateContentAndUploadedFile" engine="group" transaction-timeout="300">
        <description>Accepts file upload, updates DataResource and Content records.</description>
        <group>
            <invoke name="updateDataResource" parameters="preserve" result-to-context="true"/>
            <invoke name="attachUploadToDataResource" parameters="preserve" result-to-context="true"/>
            <invoke name="updatePartyContent"/>
            <invoke name="updateContent"/>
        </group>
    </service>

    <service name="copyContentAndElectronicTextandAssoc" default-entity-name="Content" engine="simple"
        location="component://content/minilang/content/ContentServices.xml" invoke="copyContentAndElectronicTextandAssoc" auth="true" >
        <description>Copy a Content, e;ectronic text and assocs</description>
        <!-- uses createContent internally; additonal permission(s) not necessary -->
        <auto-attributes include="pk" mode="INOUT" optional="false"/>
    </service>

    <!-- update content services -->
    <service name="updateContent" default-entity-name="Content" engine="entity-auto" auth="true" invoke="update">
        <description>Update a Content</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <implements service="updateContentAssoc" optional="true"/>
        <auto-attributes entity-name="Content" include="pk" mode="INOUT" optional="false"/>
        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
        <attribute name="contentPurposeTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="contentIdFrom" type="String" mode="IN" optional="true" />
        <!-- TODO: the following fields are depricated; but will not be removed until all services and callers are updated -->
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="skipPermissionCheck" optional="true" type="String"/>
        <attribute mode="IN" name="displayFailCond" optional="true" type="Boolean"/>
        <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
        <!-- end of deprecated fields -->
        <override name="contentName" allow-html="safe"/>
        <override name="description" allow-html="safe"/>
    </service>

    <service name="updateTextContent" engine="group" auth="true">
        <description>Updates a Text Document DataResource and Content Records</description>
        <!-- uses updateContent internally; additional permission(s) not necessary -->
        <group>
            <invoke name="updateDataText" result-to-context="true"/>
            <invoke name="updateContent" result-to-context="true"/>
        </group>
    </service>

    <service name="removeContent" default-entity-name="Content" engine="entity-auto" invoke="delete" auth="true">
        <description>Remove Content</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="contentPurposeTypeId" optional="true" type="String"/>
        <attribute mode="IN" name="userLogin" optional="true" type="org.apache.ofbiz.entity.GenericValue"/>
        <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
    </service>

    <service name="removeContentAndRelated" default-entity-name="Content" engine="simple"
            location="component://content/minilang/content/ContentServices.xml" invoke="removeContentAndRelated" auth="true">
        <description>Remove Content</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="contentPurposeTypeId" optional="true" type="String"/>
        <attribute mode="IN" name="userLogin" optional="true" type="org.apache.ofbiz.entity.GenericValue"/>
        <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
    </service>

    <!-- TODO: old permission service; being replaced with genericContentPermission -->
    <service name="checkContentPermission"
        transaction-timeout="7200"
        auth="false" engine="java" invoke="checkContentPermission"
        location="org.apache.ofbiz.content.content.ContentPermissionServices">
        <description>Check for permission to perform operation on Content</description>
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="contentPurposeList" optional="true" type="List"/>
        <!-- it was a mistake to pass in List objects because it makes it difficult to use
             the service in a request event, so I added new ones without removing lists -->
        <attribute mode="IN" name="targetOperationString" optional="true" type="String"/>
        <attribute mode="IN" name="contentPurposeString" optional="true" type="String"/>
        <attribute mode="IN" name="roleTypeString" optional="true" type="String"/>
        <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
        <attribute mode="IN" name="currentContent" optional="true" type="org.apache.ofbiz.entity.GenericValue"/>
        <attribute mode="IN" name="fromDate" optional="true" type="String"/>
        <attribute mode="IN" name="thruDate" optional="true" type="String"/>
        <!-- NOTE: entityOperation should be "_VIEW", "_ADMIN", etc. -->
        <attribute mode="IN" name="entityOperation" optional="true" type="String"/>
        <attribute mode="IN" name="statusId" optional="true" type="String"/>
        <attribute mode="IN" name="privilegeEnumId" optional="true" type="String"/>
        <attribute mode="IN" name="quickCheckContentId" optional="true" type="String"/>
        <attribute mode="IN" name="displayFailCond" optional="true" type="Boolean"/>
        <attribute mode="IN" name="displayPassCond" optional="true" type="Boolean"/>
        <attribute mode="IN" name="partyId" optional="true" type="String"/>
        <attribute mode="IN" name="userLoginId" optional="true" type="String"/>
        <attribute mode="OUT" name="permissionStatus" optional="true" type="String"/>
        <attribute mode="OUT" name="permissionRecorder" optional="true" type="org.apache.ofbiz.content.content.PermissionRecorder"/>
    </service>

    <service name="findRelatedContent" default-entity-name="Content" engine="java"
            location="org.apache.ofbiz.content.content.ContentServices" invoke="findRelatedContent" auth="true">
        <description>Create a Content</description>
        <attribute mode="IN" name="currentContent" optional="false" type="org.apache.ofbiz.entity.GenericValue">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingCurrentContent"/>
            </type-validate>
        </attribute>
        <attribute mode="IN" name="toFrom" optional="true" type="String"/>
        <attribute mode="IN" name="fromDate" optional="true" type="String"/>
        <attribute mode="IN" name="thruDate" optional="true" type="String"/>
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="userLogin" optional="true" type="org.apache.ofbiz.entity.GenericValue"/>
        <attribute mode="IN" name="contentAssocTypeList" optional="true" type="List"/>
        <attribute mode="IN" name="contentTypeList" optional="true" type="List"/>
        <attribute mode="IN" name="entityOperation" optional="true" type="String"/>
        <attribute mode="OUT" name="contentList" optional="false" type="List"/>
    </service>

    <!--Content Assoc services.-->
    <!-- TODO: old permission service; being replaced with genericContentPermission -->
    <service name="checkAssocPermission" engine="java" transaction-timeout="7200" auth="true"
            location="org.apache.ofbiz.content.content.ContentPermissionServices" invoke="checkAssocPermission">
        <description>Check for permission to perform operation on Content</description>
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="contentPurposeList" optional="true" type="List"/>
        <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
        <attribute mode="IN" name="userLogin" optional="true" type="GenericValue"/>
        <attribute mode="IN" name="contentIdTo" optional="true" type="String"/>
        <attribute mode="IN" name="contentIdFrom" optional="true" type="String"/>
        <attribute mode="IN" name="fromDate" optional="true" type="String"/>
        <attribute mode="IN" name="thruDate" optional="true" type="String"/>
        <attribute mode="IN" name="statusId" optional="true" type="String"/>
        <attribute mode="IN" name="privilegeEnumId" optional="true" type="String"/>
        <attribute mode="IN" name="entityOperation" optional="true" type="String"/>
        <attribute mode="IN" name="contentAssocTypeId" optional="true" type="String"/>
        <attribute mode="IN" name="contentAssocPredicateId" optional="true" type="String"/>
        <attribute mode="IN" name="displayFailCond" optional="true" type="Boolean"/>
        <attribute mode="OUT" name="permissionStatus" optional="true" type="String"/>
        <attribute mode="OUT" name="permissionRecorderTo" optional="true" type="org.apache.ofbiz.content.content.PermissionRecorder"/>
        <attribute mode="OUT" name="permissionRecorder" optional="true" type="org.apache.ofbiz.content.content.PermissionRecorder"/>
    </service>

    <service name="assocContent" engine="simple" default-entity-name="ContentAssoc"  auth="true"
            location="component://content/minilang/content/ContentServices.xml" invoke="assocContent">
        <description>Check for permission to perform operation on Content</description>
        <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
        <attribute mode="IN" name="contentPurposeList" optional="true" type="List"/>
        <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
        <attribute mode="IN" name="userLogin" optional="true" type="org.apache.ofbiz.entity.GenericValue"/>
        <attribute mode="IN" name="contentIdTo" optional="true" type="String"/>
        <attribute mode="IN" name="contentIdFrom" optional="true" type="String"/>
        <attribute mode="IN" name="statusId" optional="true" type="String"/>
        <attribute mode="IN" name="fromDate" optional="true" type="String"/>
        <attribute mode="IN" name="thruDate" optional="true" type="String"/>
        <attribute mode="IN" name="entityOperation" optional="true" type="String"/>
        <attribute mode="IN" name="contentAssocTypeId" optional="false" type="String">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingContentAssocTypeId"/>
            </type-validate>
        </attribute>
    </service>

    <!-- content assoc services -->
    <service name="createContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="create">
        <description>Create a ContentAssoc</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="fromDate" mode="INOUT" optional="true"/>
    </service>
    <service name="updateContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="update">
        <description>Update a ContentAssoc</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="expireContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="expire">
        <description>Expire a ContentAssoc</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
    <service name="removeContentAssoc" default-entity-name="ContentAssoc" engine="entity-auto" auth="true" invoke="delete">
        <description>Remove ContentAssoc</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- content status services -->
    <service name="setContentStatus" engine="simple" auth="true"
            location="component://content/minilang/content/ContentServices.xml" invoke="setContentStatus">
        <description>Set the Content Status</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <attribute name="contentId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingContentId"/>
            </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingStatusId"/>
            </type-validate>
        </attribute>
        <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/>
    </service>

    <!-- ContentRole services -->
    <service name="createContentRole" engine="entity-auto" default-entity-name="ContentRole" auth="true" invoke="create">
        <description>Create a ContentRole</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="fromDate" optional="true"/>
    </service>
    <service name="updateContentRole" engine="entity-auto" default-entity-name="ContentRole" auth="true" invoke="update">
        <description>Update a ContentRole</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deactivateAllContentRoles" engine="simple" default-entity-name="ContentRole" auth="true"
            location="component://content/minilang/content/ContentServices.xml" invoke="deactivateAllContentRoles">
        <description>Deactivate all ContentRoles</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <attribute mode="IN" name="contentId" optional="false" type="String">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingContentId"/>
            </type-validate>
        </attribute>
        <attribute mode="IN" name="roleTypeId" optional="false" type="String">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingRoleTypeId"/>
            </type-validate>
        </attribute>
        <attribute mode="IN" name="partyId" optional="false" type="String">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingPartyId"/>
            </type-validate>
        </attribute>
    </service>
    <service name="removeContentRole" engine="entity-auto" default-entity-name="ContentRole" auth="true" invoke="delete">
        <description>Remove ContentRole</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes entity-name="ContentRole" include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Alternative URLs services -->
    <service name="createMissingContentAltUrls" engine="simple"
                location="component://content/minilang/content/ContentServices.xml" invoke="createMissingContentAltUrls" auth="true" use-transaction="false">
        <description>Create missing Content Alternative URLs</description>
        <attribute name="prodCatalogId" mode="IN" type="String" optional="true"/>
        <attribute name="webSiteId" mode="IN" type="String" optional="true"/>
        <attribute name="contentsNotUpdated" mode="OUT" type="Integer" optional="true"/>
        <attribute name="contentsUpdated" mode="OUT" type="Integer" optional="true"/>
    </service>

    <!-- ContentMetaData services -->
    <service name="createContentMetaData" engine="entity-auto" default-entity-name="ContentMetaData" auth="true" invoke="create">
        <description>Create a ContentMetaData</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentMetaData" engine="entity-auto" default-entity-name="ContentMetaData" auth="true" invoke="update">
        <description>Update a ContentMetaData</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentMetaData" engine="entity-auto" default-entity-name="ContentMetaData" auth="true" invoke="delete">
        <description>Remove ContentMetaData</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- ContentOperation services -->
    <service name="createContentOperation" engine="entity-auto" default-entity-name="ContentOperation" auth="true" invoke="create">
        <description>Create a ContentOperation</description>
        <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentOperation" engine="entity-auto" default-entity-name="ContentOperation" auth="true" invoke="update">
        <description>Update a ContentOperation</description>
        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentOperation" engine="entity-auto" default-entity-name="ContentOperation" auth="true" invoke="delete">
        <description>Remove ContentOperation</description>
        <permission-service service-name="contentManagerPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- ContentPurpose services -->
    <service name="createContentPurpose" engine="entity-auto" default-entity-name="ContentPurpose" auth="true" invoke="create">
        <description>Create a ContentPurpose</description>
        <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentPurpose" engine="entity-auto" default-entity-name="ContentPurpose" auth="true" invoke="update">
        <description>Update a ContentPurpose</description>
        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentPurpose" engine="entity-auto" default-entity-name="ContentPurpose" auth="true"
            location="component://content/minilang/content/ContentServices.xml" invoke="delete">
        <description>Remove ContentPurpose</description>
        <permission-service service-name="contentManagerPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
    <service name="updateSingleContentPurpose" engine="simple" default-entity-name="ContentPurpose" auth="true"
            location="component://content/minilang/content/ContentServices.xml" invoke="updateSingleContentPurpose">
        <description>Removes content purposes and creates a new one</description>
        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>

    <!-- ContentPurposeOperation services -->
    <service name="createContentPurposeOperation" engine="entity-auto" default-entity-name="ContentPurposeOperation" auth="true" invoke="create">
        <description>Create a ContentPurposeOperation</description>
        <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentPurposeOperation" engine="entity-auto" default-entity-name="ContentPurposeOperation" auth="true" invoke="update">
        <description>Update a ContentPurposeOperation</description>
        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentPurposeOperation" engine="entity-auto" default-entity-name="ContentPurposeOperation" auth="true" invoke="delete">
        <description>Remove ContentPurposeOperation</description>
        <permission-service service-name="contentManagerPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- ContentAttribute services -->
    <service name="createContentAttribute" engine="entity-auto" default-entity-name="ContentAttribute" auth="true" invoke="create">
        <description>Create a ContentAttribute</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentAttribute" engine="entity-auto" default-entity-name="ContentAttribute" auth="true" invoke="update">
        <description>Update a ContentAttribute</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentAttribute" engine="entity-auto" default-entity-name="ContentAttribute" auth="true" invoke="delete">
        <description>Remove ContentAttribute</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Content Keyword Services -->
    <service name="createContentKeyword" engine="entity-auto" default-entity-name="ContentKeyword" invoke="create" auth="true">
        <description>Create a ContentKeyword</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentKeyword" engine="entity-auto" default-entity-name="ContentKeyword" invoke="update" auth="true">
        <description>Update a ContentKeyword</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteContentKeyword" engine="entity-auto" default-entity-name="ContentKeyword"
            location="component://content/minilang/content/ContentServices.xml" invoke="delete" auth="true">
        <description>Delete a ContentKeyword</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
    <service name="deleteContentKeywords" engine="simple"
            location="component://content/minilang/content/ContentServices.xml" invoke="deleteContentKeywords" auth="true">
        <description>Delete all the keywords of a content</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <attribute name="contentId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingContentId"/>
            </type-validate>
        </attribute>
    </service>
    <service name="indexContentKeywords" engine="simple"
                location="component://content/minilang/content/ContentServices.xml" invoke="indexContentKeywords" auth="false">
        <description>Index the Keywords for a Content</description>
        <attribute name="contentId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingContentId"/>
            </type-validate>
        </attribute>
        <attribute name="contentInstance" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
    </service>
    <service name="forceIndexContentKeywords" engine="simple"
            location="component://content/minilang/content/ContentServices.xml" invoke="forceIndexContentKeywords" auth="true">
        <description>Induce all the keywords of a content, ignoring the flag in the Content.</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <attribute name="contentId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingContentId"/>
            </type-validate>
        </attribute>
    </service>

    <!-- Content Revision services -->
    <service name="createContentRevision" engine="entity-auto" default-entity-name="ContentRevision" auth="true" invoke="create">
        <description>Create a ContentRevision</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentRevision" engine="entity-auto" default-entity-name="ContentRevision" auth="true" invoke="update">
        <description>Update a ContentRevision</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentRevision" engine="entity-auto" default-entity-name="ContentRevision" auth="true" invoke="delete">
        <description>Remove ContentRevision</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Content Revision Item services -->
    <service name="createContentRevisionItem" engine="entity-auto" default-entity-name="ContentRevisionItem" auth="true" invoke="create">
        <description>Create a ContentRevisionItem</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentRevisionItem" engine="entity-auto" default-entity-name="ContentRevisionItem" auth="true" invoke="update">
        <description>Update a ContentRevisionItem</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentRevisionItem" engine="entity-auto" default-entity-name="ContentRevisionItem" auth="true" invoke="delete">
        <description>Remove ContentRevisionItem</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Content Approval services -->
    <service name="createContentApproval" engine="entity-auto" default-entity-name="ContentApproval" auth="true" invoke="create">
        <description>Create a ContentApproval</description>
        <permission-service service-name="genericContentPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateContentApproval" engine="entity-auto" default-entity-name="ContentApproval" auth="true" invoke="update">
        <description>Update a ContentApproval</description>
        <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeContentApproval" engine="entity-auto" default-entity-name="ContentApproval" auth="true" invoke="delete">
        <description>Remove ContentApproval</description>
        <permission-service service-name="genericContentPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

</services>
