[Yanel-dev] policy viewer refactoring (inside "policymanager" resource-type)

Michael Wechner michael.wechner at wyona.com
Mon Mar 22 17:22:51 CET 2010


Guillaume Déflache wrote:
> Hi!
>
> For a project I need to implement some specific behaviour for the 
> policy viewer.
> So as to also reuse existing Yanel code for other unchanged things I'd 
> need to be able to reuse parts of the existing Yanel implementation.
>
>
> ATM alas the policy viewer is implemented by calling the sole static 
> method PolicyViewer#getXHTMLView(PolicyManager pm, GroupManager gm, 
> String path, String contentItemId, [other view options' parameters]) 
> which does not allow any kind of overriding.
>
>
> I'd like to introduce the following method in 
> org.wyona.yanel.impl.resources.policymanager.PolicyManagerResource:
>
>     protected PolicyViewer getPolicyViewer(PolicyManager pm, 
> GroupManager gm, [other view options' parameters]);
>
> with the visible API of PolicyViewer being:
>
>     InputStream getXHTMLInputStream(String path, String contentItemId) 
> throws Exception
>
> Then I would be able to just change the used resource-type in 
> $MY_SPECIFIC_REALM_DIR/src/webapp/global-resource-configs/policy-manager_yanel-rc.xml 
> to one using my own PolicyViewer-based Java class!
>
> WDYT?

What exactly would you like to do?

The reason I am asking is because I think "overriding/inheritance" is 
not always a good thing and maybe it's better to introduce
appropriate interfaces.

Thanks

Michi
>
>
> Cheers,
>    Guillaume
>



More information about the Yanel-development mailing list