protected void openSubview(PortalNode portalNode, Keywords arguments) throws ComponentException { if (getViewManager().getUserInterfaceType() == UserInterfaceType.WINGS) closeOpenViews(); Keywords keywords = (Keywords) ((Keywords) portalNode.getView()).clone(); if (Boolean.TRUE.equals(arguments.getValue("inPortal"))) { ViewContainer portalContainer = ((PortalViewVisualizer) getViewVisualizer()).getPortalContainer(); keywords.addValue("container", portalContainer.getID()); } String callClassName = (String) keywords.getValue( "functioncall", "de.sdm.sia.remis.portal.client.businessobject.OpenViewCall"); try { Call call = (Call) Class.forName(callClassName).newInstance(); UseCaseManager.getUseCaseManager().call(call, keywords); } catch (InstantiationException e) { e.printStackTrace(); // To change body of catch statement use Options | File Templates. } catch (IllegalAccessException e) { e.printStackTrace(); // To change body of catch statement use Options | File Templates. } catch (ClassNotFoundException e) { e.printStackTrace(); // To change body of catch statement use Options | File Templates. } // getViewManager().openView((String)keywords.getValue("view"), keywords); }
public void terminate() { ViewContainer container = ((PortalViewVisualizer) getViewVisualizer()).getPortalContainer(); ViewManager viewManager = getViewManager(); Object[] openViews = container.getComponents().toArray(); for (int i = 0; i < openViews.length; i++) { View view = (View) openViews[i]; System.out.println("closed view " + view); container.closeView(view, new Keywords()); } viewManager.delistContainer(container); ViewTransaction viewTransaction = viewManager.beginTransaction(); try { getContainer() .performCommand( ViewContainer.CANCEL_ACTIVE_VIEW, new Keywords("viewtransaction", viewTransaction, "force", Boolean.TRUE)); viewManager.commitTransaction(viewTransaction); } catch (ComponentException e) { viewManager.rollbackTransaction(viewTransaction); } }
public void closeOpenViews() { ViewContainer container = ((MenueVisualizer) getViewVisualizer()).getPortalContainer(); Object[] openViews = container.getComponents().toArray(); for (int i = 0; i < openViews.length; i++) { View view = (View) openViews[i]; try { container.closeView(view, new Keywords()); } catch (Throwable t) { t.printStackTrace(); } } }