Hi Yves.  Rather than change the core source-code for the portlet, you
could override the portlet from a module.  An example of a portlet override
is in the addresshierachyrwanda module.  If you look at the code of this
module, you'll see this url mapping:

<prop key="**/addressLayout.portlet">ahAddressLayoutPortletController</prop>

This overwrites the url mapping for the portlet from 1.6.x core, which is:

<prop key="**/addressLayout.portlet">addressLayoutPortletController</prop>

Once this override is in place, any call to the portlet across openmrs will
be redirected to the jsp and the controller in the module, rather than in
core.  There's one other trick to making this work:

In the module's moduleApplicationContext.xml, be sure to add the following
to the urlMapping bean (this is the bean where you specify your urls, the
one mapped to
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping):

<property name="order"><value>4</value></property>

OpenMRS core mappings have order 99 (i think), so for the override to work,
you need your module mappings to have a lower order number (doesn't have to
be 4, just something less than 99).  When spring is resolving urls, it
checks url mappings from low to high.

d

On Thu, Nov 24, 2011 at 3:46 PM, Yves GAKUBA <[email protected]> wrote:

> Thank you Ben for your answer, maybe I didn't get you well, but I just
> want to disable/enable some of the content inside a porltet not to
> disable/enable completely the portlet, which I think is your suggetion [1].
>
> Your suggetion [2], I think it require me to go inside OpenMRS code and
> change the way the portlet tag work, is that what you mean?
>
> I believe that it's feasable by using some javascript and look for a div
> with an id 'abc' and hide it, but I was wondering if it was possible to
> replace an existing portlet, the same as the patientDashboardForm.jsp can
> be replaced and specified in the openmrs-runtime.properties file.
>
> Thanks,
>
> --
> Yves GAKUBA
>
>  ------------------------------
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from 
> OpenMRS Developers' mailing list
>

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-devel-l" in the  body (not 
the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

Reply via email to