From e46fbe8080b8a8d25c5d2bc3354f3e440be76b07 Mon Sep 17 00:00:00 2001 From: Hans Bakker Date: Sun, 18 Jan 2009 03:34:57 +0000 Subject: [PATCH] some more updates to mainly the blog functions, but also other problems found on the way, still not finish yet altough the blog post function now works correctly including picture, also did some minilanguage syntax changes git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@735383 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/ofbiz/content/blog/BlogServices.xml | 98 ++++++++++------- .../ofbiz/content/content/ContentServices.xml | 4 +- .../org/ofbiz/content/data/DataServices.xml | 101 ++++++++---------- applications/content/servicedef/services.xml | 14 ++- .../content/servicedef/services_content.xml | 9 -- .../org/ofbiz/content/data/DataServices.java | 9 +- .../content/widget/content/ContentForms.xml | 7 +- .../content/widget/content/ContentMenus.xml | 11 ++ .../content/widget/forum/BlogForms.xml | 3 +- .../content/widget/forum/BlogScreens.xml | 76 +++++-------- .../ecommerce/widget/blog/BlogForms.xml | 16 +-- .../ecommerce/widget/blog/BlogScreens.xml | 53 +-------- 12 files changed, 178 insertions(+), 223 deletions(-) diff --git a/applications/content/script/org/ofbiz/content/blog/BlogServices.xml b/applications/content/script/org/ofbiz/content/blog/BlogServices.xml index 79defdda8f..184a586bab 100644 --- a/applications/content/script/org/ofbiz/content/blog/BlogServices.xml +++ b/applications/content/script/org/ofbiz/content/blog/BlogServices.xml @@ -23,13 +23,12 @@ - - + @@ -46,28 +45,25 @@ - - - - - + - + + @@ -78,14 +74,13 @@ + - - @@ -93,7 +88,7 @@ - + @@ -106,7 +101,6 @@ - @@ -115,12 +109,10 @@ - - @@ -128,25 +120,25 @@ - + - + - + + - @@ -155,18 +147,13 @@ - - - - + - - + - @@ -175,28 +162,57 @@ - - - - - - - - - - - - + + + + - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/applications/content/script/org/ofbiz/content/content/ContentServices.xml b/applications/content/script/org/ofbiz/content/content/ContentServices.xml index 28582ad625..31b934f9b2 100644 --- a/applications/content/script/org/ofbiz/content/content/ContentServices.xml +++ b/applications/content/script/org/ofbiz/content/content/ContentServices.xml @@ -895,9 +895,7 @@ - - - + - + @@ -52,29 +52,22 @@ under the License. - + - - - - - + + - - - + - - - + @@ -83,9 +76,8 @@ under the License. - - + @@ -194,7 +186,7 @@ under the License. - + @@ -216,7 +208,7 @@ under the License. - + @@ -280,7 +272,7 @@ under the License. - + @@ -302,7 +294,7 @@ under the License. - + @@ -324,7 +316,7 @@ under the License. - + @@ -346,7 +338,7 @@ under the License. - + @@ -388,9 +380,8 @@ under the License. - - + @@ -400,7 +391,7 @@ under the License. - + @@ -510,9 +501,7 @@ under the License. - - + @@ -527,10 +516,10 @@ under the License. - - - + + + + @@ -562,14 +551,14 @@ under the License. - + - + @@ -577,7 +566,7 @@ under the License. - + @@ -649,9 +638,7 @@ under the License. - - - + @@ -672,8 +659,8 @@ under the License. - - + + @@ -703,8 +690,8 @@ under the License. - - + + @@ -732,8 +719,8 @@ under the License. - - + + @@ -759,8 +746,8 @@ under the License. - - + + @@ -788,8 +775,8 @@ under the License. - - + + @@ -815,8 +802,8 @@ under the License. - - + + @@ -844,8 +831,8 @@ under the License. - - + + @@ -871,8 +858,8 @@ under the License. - - + + @@ -900,8 +887,8 @@ under the License. - - + + @@ -927,7 +914,7 @@ under the License. - - + + diff --git a/applications/content/servicedef/services.xml b/applications/content/servicedef/services.xml index 9f3fd3e08e..e9dc19dbc0 100644 --- a/applications/content/servicedef/services.xml +++ b/applications/content/servicedef/services.xml @@ -1059,13 +1059,25 @@ + location="org/ofbiz/content/blog/BlogServices.xml" invoke="postBlogEntry"> Creates content records for a blog entry + + Creates content records for a blog entry + + + + + + + + + @@ -119,7 +118,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="updateContent"> Update a Content - @@ -241,7 +239,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="createContentAssoc"> Create a ContentAssoc - @@ -260,7 +257,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="updateContentAssoc"> Update a ContentAssoc - @@ -277,7 +273,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="removeContentAssoc"> Remove ContentAssoc - @@ -303,7 +298,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="createContentRole"> Create a ContentRole - @@ -312,7 +306,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="updateContentRole"> Update a ContentRole - @@ -320,7 +313,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="deactivateAllContentRoles"> Deactivate all ContentRoles - @@ -329,7 +321,6 @@ location="org/ofbiz/content/content/ContentServices.xml" invoke="removeContentRole"> Remove ContentRole - diff --git a/applications/content/src/org/ofbiz/content/data/DataServices.java b/applications/content/src/org/ofbiz/content/data/DataServices.java index 91ced4dc34..c9d1dcb2fd 100644 --- a/applications/content/src/org/ofbiz/content/data/DataServices.java +++ b/applications/content/src/org/ofbiz/content/data/DataServices.java @@ -197,19 +197,22 @@ public class DataServices { // obtain a reference to the file File file = null; - if (UtilValidate.isEmpty(dataResourceTypeId) || dataResourceTypeId.equals("LOCAL_FILE")) { + if (UtilValidate.isEmpty(dataResourceTypeId) || dataResourceTypeId.equals("LOCAL_FILE") || dataResourceTypeId.equals("LOCAL_FILE_BIN")) { file = new File(objectInfo); if (!file.isAbsolute()) { return ServiceUtil.returnError("DataResource LOCAL_FILE does not point to an absolute location"); } - } else if (dataResourceTypeId.equals("OFBIZ_FILE")) { + } else if (dataResourceTypeId.equals("OFBIZ_FILE") || dataResourceTypeId.equals("OFBIZ_FILE_BIN")) { prefix = System.getProperty("ofbiz.home"); if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) { sep = "/"; } file = new File(prefix + sep + objectInfo); - } else if (dataResourceTypeId.equals("CONTEXT_FILE")) { + } else if (dataResourceTypeId.equals("CONTEXT_FILE") || dataResourceTypeId.equals("CONTEXT_FILE_BIN")) { prefix = (String) context.get("rootDir"); + if (UtilValidate.isEmpty(prefix)) { + return ServiceUtil.returnError("Cannot find CONTEXT_FILE with an empty context root!"); + } if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) { sep = "/"; } diff --git a/applications/content/widget/content/ContentForms.xml b/applications/content/widget/content/ContentForms.xml index 55f0ff1c3c..0d9ccf155d 100644 --- a/applications/content/widget/content/ContentForms.xml +++ b/applications/content/widget/content/ContentForms.xml @@ -233,7 +233,7 @@ under the License.
- + @@ -308,15 +308,14 @@ under the License. -
- + - + diff --git a/applications/content/widget/content/ContentMenus.xml b/applications/content/widget/content/ContentMenus.xml index 34176ef297..86fadf02df 100644 --- a/applications/content/widget/content/ContentMenus.xml +++ b/applications/content/widget/content/ContentMenus.xml @@ -133,6 +133,17 @@ under the License. + + + + + + + + + diff --git a/applications/content/widget/forum/BlogForms.xml b/applications/content/widget/forum/BlogForms.xml index a88bbed17b..eea3a9f08b 100644 --- a/applications/content/widget/forum/BlogForms.xml +++ b/applications/content/widget/forum/BlogForms.xml @@ -35,12 +35,13 @@ under the License. -
+ diff --git a/applications/content/widget/forum/BlogScreens.xml b/applications/content/widget/forum/BlogScreens.xml index 81c5ba4260..8f8191aba9 100644 --- a/applications/content/widget/forum/BlogScreens.xml +++ b/applications/content/widget/forum/BlogScreens.xml @@ -48,7 +48,28 @@ under the License. - + + +
+ + + +
+ + + + + + + +
+ +
+
+
+
+
+
@@ -83,11 +104,12 @@ under the License.
+ - + @@ -115,7 +137,7 @@ under the License. - + @@ -230,57 +252,15 @@ under the License.
- - - - + - - - - - - - - - - diff --git a/applications/ecommerce/widget/blog/BlogForms.xml b/applications/ecommerce/widget/blog/BlogForms.xml index 4cb5ce4ef3..71b655cacb 100644 --- a/applications/ecommerce/widget/blog/BlogForms.xml +++ b/applications/ecommerce/widget/blog/BlogForms.xml @@ -246,33 +246,33 @@ -
- + - + - +