[jboss-user] [JBoss Portal] - org.jboss.portal.core.model.portal.Context missing ??

ghyoju do-not-reply at jboss.com
Wed Jun 13 11:12:31 EDT 2007


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();
  | 		} 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054030#4054030

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054030



More information about the jboss-user mailing list