AnsweredAssumed Answered

Alfresco heirarchy concepts

Question asked by trupoet on Sep 16, 2006
So I'm trying to figure out the Alfresco CMS heirarchy.

I'm just trying to experiment at this point in pulling out CMS content from another portlet in JBoss.

So far, I have it to the point where I can pull out nodes but I'm confused as to what I do once I have a node if I want the actual content of a file to show.

I think the problem is I dont understand the heirarchy…I saw lots of stuff on the wiki about nodes, properties, references, predicates….dont understand how they all fit together.

if someone could paint the big picture that'd be great.

My current portlet code is:


package com.raf.portal.drippy;

/* imports excluded to make it shorter */


public class FirstJCRClient extends GenericPortlet
{
   
    protected void doView(RenderRequest rRequest, RenderResponse rResponse)
       throws PortletException, IOException, UnavailableException
   {
       AuthenticationUtils.startSession("admin", "admin");
       EngineConfiguration config = AuthenticationUtils.getEngineConfiguration();
       
       
       
       
       try
       {
          rResponse.setContentType("text/html");
          PrintWriter writer = rResponse.getWriter();
           writer.write("Content:<P>");
      
          
          
           RepositoryServiceLocator reposServLocator = new RepositoryServiceLocator(config);
           RepositoryServiceSoapPort reposService = (RepositoryServiceSoapPort)reposServLocator.getRepositoryService();
          
           Reference reference = new Reference(new Store(StoreEnum.workspace, "SpacesStore"), null,
                 "/app:company_home");
           Predicate predicate = new Predicate(new Reference[]{reference},null,null);
          
           Node[] nodes = reposService.get(predicate);
          
           Reference companyHome = nodes[0].getReference();
           String webID = companyHome.getUuid();
          
           QueryResult rootChildren = reposService.queryChildren(companyHome);
           ResultSet rootChildrenResults = rootChildren.getResultSet();
          
           ResultSetRow[] rows = rootChildrenResults.getRows();
          
           ResultSetRowNode rowNode;
           for(int i = 0; i < rows.length; i++)
           {
               rowNode = rows[i].getNode();
              
              writer.write(rowNode+"<P>");
           }
         
          
         
           writer.close();
       }   
       catch(Throwable e)
       {
          Log.error(this,"Something bad happened: ",e);
       }
       finally
       {
          AuthenticationUtils.endSession();
       }
   }

}


this of course just shows some weird information:


Content:

org.alfresco.webservice.types.ResultSetRowNode@5f33850f

org.alfresco.webservice.types.ResultSetRowNode@58dbf9f4

org.alfresco.webservice.types.ResultSetRowNode@60a5338

I'm just not sure where to go next once I have a node even if that node is the file which has the contents I want to display.

Any help appreciated, thanks.

Outcomes