[OFBiz] SVN: r7869 - in trunk/applications/content: . config script/org/ofbiz/content src/org/ofbiz/content/data

hansbak@svn.ofbiz.org hansbak at svn.ofbiz.org
Mon Jun 26 22:10:39 CDT 2006


Author: hansbak
Date: 2006-06-26 22:10:11 -0500 (Mon, 26 Jun 2006)
New Revision: 7869

Added:
   trunk/applications/content/script/org/ofbiz/content/SubscriptionServices.xml
Modified:
   trunk/applications/content/config/ContentUiLabels.properties
   trunk/applications/content/ofbiz-component.xml
   trunk/applications/content/src/org/ofbiz/content/data/DataServices.java
Log:
 very first version of subscription services using the subscription entity. currenly security disabled pending running with system user

Modified: trunk/applications/content/config/ContentUiLabels.properties
===================================================================
--- trunk/applications/content/config/ContentUiLabels.properties	2006-06-27 01:40:12 UTC (rev 7868)
+++ trunk/applications/content/config/ContentUiLabels.properties	2006-06-27 03:10:11 UTC (rev 7869)
@@ -127,6 +127,8 @@
 SurveyWithQuestion=W/Question
 SurveyWithOption=W/Option
 
+SubscriptionPermissionError=You do not have permission to run this service. ("CONTENTMGR_VIEW" or "CONTENTMGR_ADMIN" needed)
+
 FormFieldTitle_webSiteId=Web Site Id
 FormFieldTitle_siteName=Site Name
 FormFieldTitle_productStoreId=Product Store Id

Modified: trunk/applications/content/ofbiz-component.xml
===================================================================
--- trunk/applications/content/ofbiz-component.xml	2006-06-27 01:40:12 UTC (rev 7868)
+++ trunk/applications/content/ofbiz-component.xml	2006-06-27 03:10:11 UTC (rev 7869)
@@ -50,6 +50,7 @@
     <service-resource type="model" loader="main" location="servicedef/services_email.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_survey.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_commevent.xml"/>
+    <service-resource type="model" loader="main" location="servicedef/services_subscription.xml"/>
     <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
     <webapp name="content"
         title="Content"

Added: trunk/applications/content/script/org/ofbiz/content/SubscriptionServices.xml
===================================================================
--- trunk/applications/content/script/org/ofbiz/content/SubscriptionServices.xml	2006-06-27 01:40:12 UTC (rev 7868)
+++ trunk/applications/content/script/org/ofbiz/content/SubscriptionServices.xml	2006-06-27 03:10:11 UTC (rev 7869)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  $Id: $
+  
+  Copyright 2001-2006 The Apache Software Foundation
+  
+  Licensed 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.
+-->
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+  xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
+  
+  <simple-method method-name="createSubscription" short-description="create a Subscription">
+    <!-- temporary disabled pending solution with security
+    <set value="_CREATE" field="securityAction"/>
+    <check-permission permission="CONTENT" action="${securityAction}"><fail-property resource="ContentUiLabels" property="SubscriptionPermissionError"/></check-permission>
+    <check-errors/>
+    -->
+    <make-value entity-name="Subscription" value-name="newEntity"/>
+    <if-empty field-name="parameters.subscriptionId">
+      <sequenced-id-to-env sequence-name="Subscription" env-name="newEntity.subscriptionId"/> <!-- get the next sequenced ID -->
+      <else>
+        <set field="newEntity.subscriptionId" from-field="parameters.subscriptionId"/>
+      </else>
+    </if-empty>
+    <field-to-result field-name="newEntity.subscriptionId" result-name="subscriptionId"/>
+    <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+    <create-value value-name="newEntity"/>
+  </simple-method>   
+  
+  <simple-method method-name="updateSubscription" short-description="update a Subscription">
+    <set value="_UPDATE" field="securityAction"/>
+    <check-permission permission="CONTENT" action="${securityAction}"><fail-property resource="ContentUiLabels" property="SubscriptionPermissionError"/></check-permission>
+    <check-errors/>
+    <entity-one entity-name="Subscription" value-name="lookedUpValue"/>
+    <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
+    <store-value value-name="lookedUpValue"/>
+  </simple-method>
+
+  <simple-method method-name="isSubscribed" short-description="check if a party has a subscription">
+    <!--
+    <set value="_READ" field="securityAction"/>
+    <check-permission permission="CONTENT" action="${securityAction}"><fail-property resource="ContentUiLabels" property="SubscriptionPermissionError"/></check-permission>
+    <check-errors/>
+    -->
+    <set field="pfInput.inputFields" from-field="parameters"/>
+    <set field="pfInput.entityName" value="Subscription"/>
+    <if-empty field-name="parameters.filterByDate">
+      <set field="pfInput.filterByDate" value="Y"/>
+      <else>
+        <set field="pfInput.filterByDate" from-field="parameters.filterByDate"/>
+      </else>
+    </if-empty>
+    
+    <call-service service-name="performFindList" in-map-name="pfInput">
+      <result-to-field result-name="list" field-name="pfResultList"/>
+    </call-service>
+    
+    <if-empty field-name="pfResultList">
+      <set field="found" value="false" type="Boolean"/>
+      <else>
+        <set field="found" value="true" type="Boolean"/>
+      </else>
+    </if-empty>
+    
+    <field-to-result field-name="found" result-name="isSubscribed"/>
+    <first-from-list entry-name="subscription" list-name="pfResultList"/>
+    <field-to-result field-name="subscription.subscriptionId" result-name="subscriptionId"/>
+  </simple-method>
+      
+</simple-methods>
\ No newline at end of file


Property changes on: trunk/applications/content/script/org/ofbiz/content/SubscriptionServices.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:keywords
   + "Date Rev Author URL Id"
Name: svn:eol-style
   + native

Modified: trunk/applications/content/src/org/ofbiz/content/data/DataServices.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/data/DataServices.java	2006-06-27 01:40:12 UTC (rev 7868)
+++ trunk/applications/content/src/org/ofbiz/content/data/DataServices.java	2006-06-27 03:10:11 UTC (rev 7869)
@@ -364,7 +364,7 @@
                 
             }
             String textData = (String) context.get("textData");
-            if (Debug.infoOn()) Debug.logInfo("in updateElectronicText, textData:" + textData, module);
+            if (Debug.verboseOn()) Debug.logVerbose("in updateElectronicText, textData:" + textData, module);
                 try {
                     electronicText = delegator.findByPrimaryKey("ElectronicText", UtilMisc.toMap("dataResourceId", dataResourceId));
                     if (electronicText != null) {



More information about the Svn mailing list