cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lionel Crine <cr...@4dconcept.fr>
Subject Re: extends my custom class [correction]
Date Thu, 24 Apr 2003 07:47:59 GMT
Thanks for the answer.


>Lionel., are you saying you want a reference to the Context object from 
>your custom object?

yes.

>   Or do you also need the HttpRequest or HttpResponse?

I don't think so.

>When and where is this object created?  Is it a singleton?

Yes. Where can I find some java help about singleton.

Lionel





At 09:47 23/04/2003 -0700, you wrote:
>Charles Yates wrote:
>
>>     Action passes an objectModel Map in act(), Transformer and Generator 
>> in setup() which can be used to get a Context object.  The Context is 
>> different with each request so you should get your reference to it from 
>> within those
>
>on further reflection I misspoke, Context remains the same object with in 
>a servlet.
>
>Lionel., are you saying you want a reference to the Context object from 
>your custom object?  Or do you also need the HttpRequest or HttpResponse? 
>When and where is this object created?  Is it a singleton?
>
>>methods.  These methods are call on the objects each time they are 
>>assembled into a pipeline.  I guess I'm still not sure what you are 
>>trying to do.
>>
>>Charles
>>
>>Lionel Crine wrote:
>>
>>>I explain a little more :
>>>
>>>In my custom generator, there is a "setup" method which get the objectmodel.
>>>
>>>
>>>public void setup(SourceResolver resolver, Map objectModel, String src, 
>>>Parameters par)
>>>         throws ProcessingException, SAXException, IOException {
>>>         super.setup(resolver, objectModel, src, par);
>>>//Here I do a getContext
>>>Context context = ObjectModelHelper.getContext(objectModel);
>>>//then i get some variable
>>>this.domain = context.getInitParameter("domain");
>>>...
>>>
>>>
>>>BUT I have some action, transformers, generators which launch, each time 
>>>I called them, the "getContext" method.
>>>
>>>So I'm creating a class that instanced this variables in the context. 
>>>But in this class this ObjectModel Object does not exist.
>>>
>>>To get it I need to extends a cocoon class, which one ?
>>>
>>>Lionel
>>>
>>>
>>>
>>>At 07:43 22/04/2003 -0700, you wrote:
>>>
>>>>Hello Lionel,
>>>>     I'm not sure I understand your question.  All methods in 
>>>> ObjectModelHelper are static so you have access to them from any object:
>>>>
>>>>ObjectModelHelper.getContext();
>>>>ObjectModelHelper.getRequest();
>>>>ObjectModelHelper.getResponse();
>>>>
>>>>Charles Y
>>>>
>>>>Lionel Crine wrote:
>>>>
>>>>>Hello,
>>>>>
>>>>>I need to use the "ObjectModelHelper" object into my custom class. But

>>>>>this class is not a generator or a transformer so I don't want to 
>>>>>extends it anyhow. This class initialize variables and methods use by

>>>>>the custom generator and transformer.
>>>>>
>>>>>Which class should I extend to get the "ObjectModelHelper" object.
>>>>>
>>>>>thanks
>>>>>
>>>>>
>>>>>Lionel
>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>>>>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>>>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message