You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2005/03/21 14:26:13 UTC

Re: [1.4] component management (Was: Re: [1.4] Ant tasks and publication API)

Andreas Hartmann wrote:
> J. Wolfgang Kaltz wrote:

[...]

>> IIUC use case components are currently not released,
> 
> 
> That's a bug. Actually, it's a bigger problem. We probably have to release
> the component before we call sendPageAndWait(), because we can't be sure
> that the flowscript is continued. So we need a way to re-build and
> re-initialize the usecase handler transparently.


I refactored the usecase handling flowscript and added a proxy class.
Now usecase handlers are allocated only temporarily and released before
a response is sent to the user. A proxy object is used to store the
parameters and handle them to the JX template. This approach requires
that usecases don't use fields but parameters to store data.

Another approach would be to use POJOs for usecase handlers, but that
would mean we'd have to pass the ServiceManager to them manually.
I'd rather try the current solution.


-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [1.4] component management (Was: Re: [1.4] Ant tasks and publication API)

Posted by Andreas Hartmann <an...@wyona.org>.
J. Wolfgang Kaltz wrote:
> Andreas Hartmann schrieb:
> 
>>> [...]
>>> I refactored the usecase handling flowscript and added a proxy class.
>>> Now usecase handlers are allocated only temporarily and released before
>>> a response is sent to the user.
>>
>>
>>
>> [...]
>>
>> BTW, this means that usecases can now safely be used to present
>> data without requiring user interaction.
> 
> 
> Yes, I think this is an important improvement in the uc framework.
> 
> However, there seems to be a problem recreating the usecase for the 
> second step: Use-cases in the admin area now throw a NPE, for example 
> GroupProfile:

The UsecaseProxy didn't pass the source URL to the usecase.
I fixed it, thanks for reporting!

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [1.4] component management (Was: Re: [1.4] Ant tasks and publication API)

Posted by "J. Wolfgang Kaltz" <ka...@interactivesystems.info>.
Andreas Hartmann schrieb:
>> [...]
>> I refactored the usecase handling flowscript and added a proxy class.
>> Now usecase handlers are allocated only temporarily and released before
>> a response is sent to the user.
> 
> 
> [...]
> 
> BTW, this means that usecases can now safely be used to present
> data without requiring user interaction.

Yes, I think this is an important improvement in the uc framework.

However, there seems to be a problem recreating the usecase for the 
second step: Use-cases in the admin area now throw a NPE, for example 
GroupProfile:

java.lang.NullPointerException
	at 
org.apache.lenya.cms.publication.URLInformation.<init>(URLInformation.java:71)
	at 
org.apache.lenya.cms.ac.PublicationAccessControllerResolver.generateCacheKey(PublicationAccessControllerResolver.java:59)
	at 
org.apache.lenya.ac.impl.AbstractAccessControllerResolver.resolveAccessController(AbstractAccessControllerResolver.java:55)
	at 
org.apache.lenya.cms.ac.usecases.AccessControlUsecase.initializeAccessController(AccessControlUsecase.java:70)
	at 
org.apache.lenya.cms.ac.usecases.AccessControlUsecase.getGroupManager(AccessControlUsecase.java:99)
	at 
org.apache.lenya.cms.ac.usecases.GroupProfile.setParameter(GroupProfile.java:54)


I've traced this to AbstractUsecase.getSourceURL() returning null in the 
second step of the usecase (the first step works), but I don't know why 
that happens. Since the usecase instance is no longer the same object 
for both steps IIUC, I'm assuming it has to do with that.

Any further ideas ?

Re: [1.4] component management (Was: Re: [1.4] Ant tasks and publication API)

Posted by Andreas Hartmann <an...@wyona.org>.
Andreas Hartmann wrote:
> Andreas Hartmann wrote:
> 
>> J. Wolfgang Kaltz wrote:
> 
> 
> [...]
> 
>>> IIUC use case components are currently not released,
>>
>>
>>
>> That's a bug. Actually, it's a bigger problem. We probably have to 
>> release
>> the component before we call sendPageAndWait(), because we can't be sure
>> that the flowscript is continued. So we need a way to re-build and
>> re-initialize the usecase handler transparently.
> 
> 
> 
> I refactored the usecase handling flowscript and added a proxy class.
> Now usecase handlers are allocated only temporarily and released before
> a response is sent to the user.

[...]

BTW, this means that usecases can now safely be used to present
data without requiring user interaction.

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org