You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ka...@materna.de on 2007/11/15 07:26:24 UTC

T4.0.2: How do I replace a Service via Hivemind?

Hi,

I'm using Tapestry in a portal environment. In configuration point tapestry.portlet.services.FactoryServices a service called "render" is stored, which I would like to replace with my own class. Is it possible to overwrite this entry or the configuration point within my hivemodule.xml belonging to my portlet?

I tried it by writing this to my local hivemodule.xml so the class of service-point Render points to my own RenderService, but it is ignored:

<service-point id="Render" interface="org.apache.tapestry.engine.IEngineService">
  
  		The single service that should be referenced by a Portlet render request.
  
  		<invoke-factory>
    		<construct class="RenderService">
      			<set-service property="portletRenderer" service-id="PortletRenderer"/>
      			<set-service property="request" service-id="tapestry.portlet.PortletRequest"/>
      			<set-service property="pageResolver" service-id="tapestry.portlet.resolver.PortletPageResolver"/>
    		</construct>
  		</invoke-factory>  
 	</service-point>
 	 	
 	<configuration-point id="FactoryServices" schema-id="tapestry.services.EngineServices">
    
    	Configuration point for the factory default services. Each contributed service
    	must have a unique name.
    
  	</configuration-point>
    
  	<contribution configuration-id="FactoryServices">
    	<service name="home" object="service:tapestry.portlet.services.Home"/>
    	<service name="action" object="service:tapestry.services.Action"/>
    	<service name="direct" object="service:tapestry.services.Direct"/>
    	<service name="page" object="service:tapestry.services.Page"/>
    	<service name="reset" object="service:tapestry.services.Reset"/>
    	<service name="restart" object="service:tapestry.services.Restart"/>
    	<service name="asset" object="service:tapestry.portlet.services.PortletAsset"/>
	  	<service name="external" object="service:tapestry.services.External"/>
    	<service name="exception" object="service:tapestry.portlet.services.Exception"/>
    
    	<!-- Special one used for handling Portal RenderRequests -->
    
    	<service name="render" object="service:Render"/>
  	</contribution>

Best regards

Kay Thielmann
Mitarbeiter / BC Government Themen
Business Unit Information
______________________________________________
MATERNA GmbH Information & Communications
Voßkuhle 37 * 44141 Dortmund * Deutschland
Tel.: +49 231 5599-8297>
kay.thielmann@materna.de * www.materna.de
Hauptsitz der MATERNA GmbH: Voßkuhle 37, 44141 Dortmund
Geschäftsführer: Dr. Winfried Materna, Helmut an de Meulen, Ralph Hartwig
Amtsgericht Dortmund HRB 5839


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


Re: T4.0.2: How do I replace a Service via Hivemind?

Posted by Renat Zubairov <re...@gmail.com>.
Hi

It's off course possible (thanks to Howard and his Hivemind ideas :) ) You
can actually write something like

	<implementation service-id="<FULL SERVICE NAME HERE WITH MODULE ID>">

                BLAH BLAH

		<invoke-factory model="singleton">
			<construct class="<YOUR CLASS NAME HERE>">
                                   <!- ANY INITIALIZATION OR
INJECTIONS REQUIRED -->
			</construct>
		</invoke-factory>
	</implementation>

More examples you can find for example here:

http://bookie.googlecode.com/svn/trunk/bookie-framework/src/main/resources/META-INF/hivemodule.xml

And off course your new class should implement interface of the service.
As service-id you need to specify full service ID, with module, something
like tapestry.render.Render or something like that.

Renat

On 15/11/2007, Kay.Thielmann@materna.de <Ka...@materna.de> wrote:
>
> Hi,
>
> I'm using Tapestry in a portal environment. In configuration point
> tapestry.portlet.services.FactoryServices a service called "render" is
> stored, which I would like to replace with my own class. Is it possible to
> overwrite this entry or the configuration point within my hivemodule.xmlbelonging to my portlet?
>
> I tried it by writing this to my local hivemodule.xml so the class of
> service-point Render points to my own RenderService, but it is ignored:
>
> <service-point id="Render" interface="
> org.apache.tapestry.engine.IEngineService">
>
>                 The single service that should be referenced by a Portlet
> render request.
>
>                 <invoke-factory>
>                 <construct class="RenderService">
>                         <set-service property="portletRenderer"
> service-id="PortletRenderer"/>
>                         <set-service property="request" service-id="
> tapestry.portlet.PortletRequest"/>
>                         <set-service property="pageResolver" service-id="
> tapestry.portlet.resolver.PortletPageResolver"/>
>                 </construct>
>                 </invoke-factory>
>         </service-point>
>
>         <configuration-point id="FactoryServices" schema-id="
> tapestry.services.EngineServices">
>
>         Configuration point for the factory default services. Each
> contributed service
>         must have a unique name.
>
>         </configuration-point>
>
>         <contribution configuration-id="FactoryServices">
>         <service name="home" object="service:
> tapestry.portlet.services.Home"/>
>         <service name="action" object="service:tapestry.services.Action"/>
>         <service name="direct" object="service:tapestry.services.Direct"/>
>         <service name="page" object="service:tapestry.services.Page"/>
>         <service name="reset" object="service:tapestry.services.Reset"/>
>         <service name="restart" object="service:tapestry.services.Restart
> "/>
>         <service name="asset" object="service:
> tapestry.portlet.services.PortletAsset"/>
>                 <service name="external" object="service:
> tapestry.services.External"/>
>         <service name="exception" object="service:
> tapestry.portlet.services.Exception"/>
>
>         <!-- Special one used for handling Portal RenderRequests -->
>
>         <service name="render" object="service:Render"/>
>         </contribution>
>
> Best regards
>
> Kay Thielmann
> Mitarbeiter / BC Government Themen
> Business Unit Information
> ______________________________________________
> MATERNA GmbH Information & Communications
> Voßkuhle 37 * 44141 Dortmund * Deutschland
> Tel.: +49 231 5599-8297>
> kay.thielmann@materna.de * www.materna.de
> Hauptsitz der MATERNA GmbH: Voßkuhle 37, 44141 Dortmund
> Geschäftsführer: Dr. Winfried Materna, Helmut an de Meulen, Ralph Hartwig
> Amtsgericht Dortmund HRB 5839
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,
Renat Zubairov