Hi Al,
forgive my delay in answering.
thank you for your explanation but why are you not convinced about "single
service"?
However I'm going to test and study your service deeply.

What do you think about partyContent solution which uses "simple" service?
Thank you again.




byersa wrote:
> 
> Angelo,
> 
> I implemented the CMS years ago per David's design. At the time, I thought
> it would be wise to have a single service, persistContentAndAssoc, which
> did
> everything - creating and updating, all types of media and all possible
> repositories (ie. database, filesystem, etc). I am not convinced that it
> would not be nice to have such a tool, even though it tends to go against
> the "OFBiz way" (I claim that for a T-shirt). I don't think
> persistContentAndAssoc is that tool, though I would love someone to
> improve
> on it or simplify it.
> 
> Not having a clear API for working with the CMS is its greatest drawback,
> I
> think. Saner heads than mine have broken the persist process into multiple
> steps. I drew from what they have done and here is how I recently did a
> simple text persist:
>                ...
>                String localeString = (String)entry.getKey();
>                 String textData = (String)entry.getValue();
>                 // Create new content
>                 mapIn = new HashMap();
>                 mapIn.put("localeString", localeString);
>                 mapIn.put("objectInfo", textData);
>                 mapIn.put("userLogin", userLogin);
>                 mapIn.put("dataResourceTypeId", "SHORT_TEXT");
>                 mapIn.put("mimeTypeId", "text/plain");
>                 result = dispatcher.runSync("createDataResource", mapIn);
>                 String dataResourceId =
> (String)result.get("dataResourceId");
> 
>                 mapIn = new HashMap();
>                 mapIn.put("localeString", localeString);
>                 mapIn.put("textData", textData);
>                 mapIn.put("description", description);
>                 mapIn.put("userLogin", userLogin);
>                 mapIn.put("dataResourceId", dataResourceId);
>                 result = dispatcher.runSync("createContent", mapIn);
>                 String contentId = (String)result.get("contentId");
> 
> 
>                 // Create assoc to SurveyQuestionOption
>                 // Angelo, note that this is not the ContentAssoc entity
> that you would use.
>                 // I think you would just use the createContentAssoc
> service
> here instead
>                 // And I would use FastMaps because that is the OFBiz way.
>                 mapIn = new HashMap();
>                 mapIn.put("localeString", localeString);
>                 mapIn.put("contentId", contentId);
>                 mapIn.put("surveyAnswerOptionId", surveyAnswerOptionId);
>                 mapIn.put("userLogin", userLogin);
>                 Map result2 =
> dispatcher.runSync("createSurveyAnswerOptionContentAssoc", mapIn);
> 
> In my mind, that is still a lot of code, when there are only a few pieces
> of
> data, but you might want to stick to something like this for now.
> 
> Sorry I can't be of more help, but I have forgotten much of what I did
> before. With Hans taking an interest in CMS, maybe things will get
> improved.
> 
> -Al
> 
> On Thu, Jan 22, 2009 at 12:00 PM, Angelo Matarazzo <
> matarazzoang...@gmail.com> wrote:
> 
>>
>> Hi,
>> I am following the debate between Hans and David about Content Component.
>> I am looking at a way to upload a resource and integrate it in database.
>> In Content Component there is a java service: persistContentAndAssoc 
>> which
>> is called very often.
>> Instead in Party Component it seems that this service is  replaced by
>> uploadPartyContentFile which don't call "persistContentAndAssoc" but
>> other
>> services.
>> Why?
>> To upload a file it is better to follow  Party Component?
>> "persistContentAndAssoc" is been replaced in the system?
>> Thank you.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Content-Service-tp21610839p21610839.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Content-Service-tp21610839p21656132.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply via email to