You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Frank Russo <fr...@FXALL.com> on 2005/12/12 16:48:58 UTC

ASOs for a war with multiple Tapestry apps

I have that documented 'rare case', where we have more than one tapestry
application in a war file. Technically, the codebase is the same. We
just have different entry points for different types of users. Not sure
why it was done that way, since I didn't code it. Just inherited. I'm
trying to upgrade to T4. 
 
Here is my issue. I'm trying to create an Application State Object to
simulate the deprecated Visit object. I have the following configured:
 
/meta-inf/hivemodule.xml: 

	<contribution
configuration-id="tapestry.state.ApplicationObjects">
	    <state-object name="VisitState" scope="session">
	        <create-instance
class="com.fxall.admin.tapestry.Visit"/>
	    </state-object>
	</contribution>

.page file:

	<inject property="visitState" type="state" object="VisitState"/>

java class:

	private Visit visitState;
	public abstract Visit getVisitState();

I want to be able to use this Visit object for each of our tapestry
apps. I read that each of the apps can have it's own hivemodule.xml, but
what I'm not sure of is do I have to have a Visit defined for each app
in it's own hivemodule for the above to work? I think so, since I'm
getting the following error:

	'VisitState' is not a declared application state object.

I'm not sure if I'm missing something else, or am I supposed to create
the individual hivemodule.xml files...
 
Frank Russo
Senior Developer
FX Alliance, LLC


Re: ASOs for a war with multiple Tapestry apps

Posted by Ron Piterman <rp...@gmx.net>.
Ron Piterman wrote:
> I would think you should configure your own aso scope, which should be 
> quite simple, however could grow scary at beginning.
> take a look at the SessionScopeManager or rather ApplicationScopeManager.
> What you need is same as ApplicationScopeManager, but which omits the 
> application name from the context's attribute key, which I guess the 
> original service does.
> a tip: don't try to extend the class, rather, use copy and paste. (this 
> might seem strange, but life sometime is...)
> after you create your class, you should register it as a service in 
> hivemind, and add a configuration point

its a contribution to a configuration point, and not a configuration 
point...

> to make tapestry/hivemind know 
> its an ASO persisting model.
> then you use it.
> good luck.
> Ron
> 
> 
> 
> Frank Russo wrote:
> 
>> I have that documented 'rare case', where we have more than one tapestry
>> application in a war file. Technically, the codebase is the same. We
>> just have different entry points for different types of users. Not sure
>> why it was done that way, since I didn't code it. Just inherited. I'm
>> trying to upgrade to T4.  
>> Here is my issue. I'm trying to create an Application State Object to
>> simulate the deprecated Visit object. I have the following configured:
>>  
>> /meta-inf/hivemodule.xml:
>>     <contribution
>> configuration-id="tapestry.state.ApplicationObjects">
>>         <state-object name="VisitState" scope="session">
>>             <create-instance
>> class="com.fxall.admin.tapestry.Visit"/>
>>         </state-object>
>>     </contribution>
>>
>> .page file:
>>
>>     <inject property="visitState" type="state" object="VisitState"/>
>>
>> java class:
>>
>>     private Visit visitState;
>>     public abstract Visit getVisitState();
>>
>> I want to be able to use this Visit object for each of our tapestry
>> apps. I read that each of the apps can have it's own hivemodule.xml, but
>> what I'm not sure of is do I have to have a Visit defined for each app
>> in it's own hivemodule for the above to work? I think so, since I'm
>> getting the following error:
>>
>>     'VisitState' is not a declared application state object.
>>
>> I'm not sure if I'm missing something else, or am I supposed to create
>> the individual hivemodule.xml files...
>>  
>> Frank Russo
>> Senior Developer
>> FX Alliance, LLC
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: ASOs for a war with multiple Tapestry apps

Posted by Ron Piterman <rp...@gmx.net>.
I would think you should configure your own aso scope, which should be 
quite simple, however could grow scary at beginning.
take a look at the SessionScopeManager or rather ApplicationScopeManager.
What you need is same as ApplicationScopeManager, but which omits the 
application name from the context's attribute key, which I guess the 
original service does.
a tip: don't try to extend the class, rather, use copy and paste. (this 
might seem strange, but life sometime is...)
after you create your class, you should register it as a service in 
hivemind, and add a configuration point to make tapestry/hivemind know 
its an ASO persisting model.
then you use it.
good luck.
Ron



Frank Russo wrote:
> I have that documented 'rare case', where we have more than one tapestry
> application in a war file. Technically, the codebase is the same. We
> just have different entry points for different types of users. Not sure
> why it was done that way, since I didn't code it. Just inherited. I'm
> trying to upgrade to T4. 
>  
> Here is my issue. I'm trying to create an Application State Object to
> simulate the deprecated Visit object. I have the following configured:
>  
> /meta-inf/hivemodule.xml: 
> 
> 	<contribution
> configuration-id="tapestry.state.ApplicationObjects">
> 	    <state-object name="VisitState" scope="session">
> 	        <create-instance
> class="com.fxall.admin.tapestry.Visit"/>
> 	    </state-object>
> 	</contribution>
> 
> .page file:
> 
> 	<inject property="visitState" type="state" object="VisitState"/>
> 
> java class:
> 
> 	private Visit visitState;
> 	public abstract Visit getVisitState();
> 
> I want to be able to use this Visit object for each of our tapestry
> apps. I read that each of the apps can have it's own hivemodule.xml, but
> what I'm not sure of is do I have to have a Visit defined for each app
> in it's own hivemodule for the above to work? I think so, since I'm
> getting the following error:
> 
> 	'VisitState' is not a declared application state object.
> 
> I'm not sure if I'm missing something else, or am I supposed to create
> the individual hivemodule.xml files...
>  
> Frank Russo
> Senior Developer
> FX Alliance, LLC
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org