1 Reply Latest reply on Jun 13, 2007 4:26 PM by ghyoju

    org.jboss.portal.core.model.portal.Context missing ??

    ghyoju

      Hi

      There used to be org.jboss.portal.core.model.portal.Context in JBOSS Portal 2.4.1, according to the javadoc it should also be in JBOSS Protal 2.6 http://docs.jboss.com/jbportal/v2.6/javadoc/org/jboss/portal/core/model/portal/Context.html but it is not there (am I missing something?).

      I am trying to get the portal names from the JBOSS Portal. I was able to do it in 2.4.1 with following code :


       TransactionManager tm = null;
       try {
       InitialContext ic = new InitialContext();
       tm = (TransactionManager) ic.lookup("java:/TransactionManager");
       } catch (NamingException ex) {
       System.out.println("Failed to find transactionmnager" );
       }
      
       try
       {
       tm.begin();
       try {
       PortalObjectContainer container;
       container = (PortalObjectContainer)getPortletContext().getAttribute("PortalObjectContainer");
       Context context = container.getContext();
      
       Iterator portalObjectIterator= context.getChildren().iterator();
      
       ArrayList names = new ArrayList();
      
       while (portalObjectIterator.hasNext())
       {
       PortalObject child = (PortalObject) portalObjectIterator.next();
       String name = child.getName();
       names.add(name);
       }
       }
       finally {
       tm.commit();
       }
       }
       catch ( Exception ex ) {
       ex.printStackTrace();
       }