我使用 GateIn 3.2 创建了一个 GateIn 门户应用程序。我需要在我的gatein 门户应用程序中创建一个导航链接,而不更改navigation.xml 文件。这意味着我需要务实地创建它。要做到这一点,我需要调用哪个 GateIn 服务类?有没有可用的示例代码?
问问题
120 次
1 回答
1
AFAIK from version 3.3 Gatein introduced the NavigationService that's used to manipulate navigation. Example for usage of NavigationService:
POMSessionManager mgr = (POMSessionManager) container.getComponentInstanceOfType(POMSessionManager.class);
NavigationServiceImpl service = new NavigationServiceImpl(mgr);
mgr.getPOMService().getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "save_navigation");
NavigationContext nav = new NavigationContext(SiteKey.portal("save_navigation"), new NavigationState(5));
service.saveNavigation(nav);
For more details you should take a look at NavigationService & all its testcases in version 3.3 (or later). And they were in Component/Portal module.
于 2013-09-09T08:11:11.203 回答