Package org.infoglue.cms.net

Examples of org.infoglue.cms.net.CommunicationEnvelope


  }
 

  public CommunicationEnvelope execute(CommunicationEnvelope envelope)
  {
        CommunicationEnvelope responseEnvelope = new CommunicationEnvelope();
     
    try
       
            String action = envelope.getAction();
            logger.info("ACTION:" + action);
           
            if(action.equals("selectRootNode"))
            {
                responseEnvelope = getRootContent(envelope);
            }
            if(action.equals("selectNode"))
            {
                responseEnvelope = getContent(envelope);
            }
            /*
            else if(action.equals("selectChildNodes"))
            {
                responseEnvelope = getChildContents(envelope);
            }
            */
            /*
            else if(action.equals("createContent"))
            {
                responseEnvelope = createContent(envelope);
            }
            else if(action.equals("updateContent"))
            {
                responseEnvelope = updateContent(envelope);
            }
            else if(action.equals("deleteContent"))
            {
                responseEnvelope = deleteContent(envelope);
            }
            */
            logger.info("Executing in ContentService...");
        }
        catch (Exception e)
        {
            responseEnvelope.setStatus("1");
            e.printStackTrace();   
        }
        return responseEnvelope;
  }
View Full Code Here


    /**
     * This method fetches the root Content of this site
     */
    public CommunicationEnvelope getRootContent(CommunicationEnvelope envelope)
  {
        CommunicationEnvelope responseEnvelope = new CommunicationEnvelope();
     
    try
       
          List arguments = (List)envelope.getNodes();
          logger.info("arguments:" + arguments.size());
          Integer repositoryId = ((Node)arguments.get(0)).getId();
      logger.info("repositoryId:" + repositoryId);
           
            ContentVO contentVO = ContentControllerProxy.getController().getRootContentVO(repositoryId, this.request.getRemoteUser());
           
            logger.info("contentVO:" + contentVO.getContentId() + " " + contentVO.getName());
            Node node = new Node();
            node.setId(contentVO.getContentId());
            node.setName(contentVO.getName());
            node.setIsBranch(contentVO.getIsBranch());
           
            List nodes = new ArrayList();
            nodes.add(node);
            responseEnvelope.setNodes(nodes);
        }
        catch (Exception e)
        {
            responseEnvelope.setStatus("1");
            e.printStackTrace();   
        }
        return responseEnvelope;
  }
View Full Code Here

    /**
     * This method fetches the Content with the given id
     */
    public CommunicationEnvelope getContent(CommunicationEnvelope envelope)
  {
        CommunicationEnvelope responseEnvelope = new CommunicationEnvelope();
     
    try
       
      List arguments = (List)envelope.getNodes();
          Integer contentId = ((Node)arguments.get(0)).getId();
      logger.info("contentId:" + contentId);
            ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
            logger.info("contentVO:" + contentVO.getContentId() + " " + contentVO.getName());
            Node node = new Node();
            node.setId(contentVO.getContentId());
            node.setName(contentVO.getName());
            node.setIsBranch(contentVO.getIsBranch());
           
            List nodes = new ArrayList();
            nodes.add(node);
            responseEnvelope.setNodes(nodes);
        }
        catch (Exception e)
        {
            responseEnvelope.setStatus("1");
            e.printStackTrace();   
        }
        return responseEnvelope;
  }
View Full Code Here

           
           
            // get an input stream from the applet
          out = response.getWriter();
         
          CommunicationEnvelope requestEnvelope = deserializeEnvelope(inHash);
          CommunicationEnvelope reponseEnvelope = execute(requestEnvelope);
      String responseString = toEncodedString(serializeEnvelope(reponseEnvelope));
                   
          // send back a confirmation message to the applet
            logger.info("Sending the string to the applet:" + responseString);
          out.println(responseString);
View Full Code Here

  }
 
 
  private CommunicationEnvelope deserializeEnvelope(Hashtable hash)
  {
    CommunicationEnvelope communicationEnvelope = new CommunicationEnvelope();
    communicationEnvelope.setAction("" + hash.get("action"));
    communicationEnvelope.setStatus("" + hash.get("status"));
    logger.info("Action:" + communicationEnvelope.getAction());
    logger.info("Status:" + communicationEnvelope.getStatus());
   
    List nodes = new ArrayList();
    int i = 0;
    String id = (String)hash.get("nodeList." + i + ".id");
    while(id != null)
    {
      Node n = new Node();
      n.setId(new Integer(id));
      n.setName((String)hash.get("nodeList." + i + ".name"));
      n.setIsBranch(new Boolean((String)hash.get("nodeList." + i + ".isBranch")));
      nodes.add(n);
      logger.info("Node:" + n);
      i++;
      id = (String)hash.get("nodeList." + i + ".id");
   
    communicationEnvelope.setNodes(nodes);
       
    return communicationEnvelope;   
  }
View Full Code Here

  }
 

  public CommunicationEnvelope execute(CommunicationEnvelope envelope)
  {
        CommunicationEnvelope responseEnvelope = new CommunicationEnvelope();
     
    try
       
            String action = envelope.getAction();
            logger.info("ACTION:" + action);
           
            if(action.equals("selectRootNode"))
            {
                responseEnvelope = getRootSiteNode(envelope);
            }
            if(action.equals("selectNode"))
            {
                responseEnvelope = getSiteNode(envelope);
            }
            else if(action.equals("selectChildNodes"))
            {
                responseEnvelope = getChildSiteNodes(envelope);
            }
            /*
            else if(action.equals("createSiteNode"))
            {
                responseEnvelope = createSiteNode(envelope);
            }
            else if(action.equals("updateSiteNode"))
            {
                responseEnvelope = updateSiteNode(envelope);
            }
            else if(action.equals("deleteSiteNode"))
            {
                responseEnvelope = deleteSiteNode(envelope);
            }
            */
            logger.info("Executing in SiteNodeService...");
        }
        catch (Exception e)
        {
            responseEnvelope.setStatus("1");
            e.printStackTrace();   
        }
        return responseEnvelope;
  }
View Full Code Here

    /**
     * This method fetches the root SiteNode of this site
     */
    public CommunicationEnvelope getRootSiteNode(CommunicationEnvelope envelope)
  {
        CommunicationEnvelope responseEnvelope = new CommunicationEnvelope();
     
    try
       
           List arguments = (List)envelope.getNodes();
          Integer repositoryId = ((Node)arguments.get(0)).getId();
      logger.info("repositoryId:" + repositoryId);
            ViewSiteNodeTreeUCC viewSiteNodeTreeUCC = ViewSiteNodeTreeUCCFactory.newViewSiteNodeTreeUCC();
            SiteNodeVO siteNodeVO = viewSiteNodeTreeUCC.getRootSiteNode(repositoryId, getInfoGluePrincipal());
            logger.info("siteNodeVO:" + siteNodeVO.getSiteNodeId() + " " + siteNodeVO.getName());
            Node node = new Node();
            node.setId(siteNodeVO.getSiteNodeId());
            node.setName(siteNodeVO.getName());
            node.setIsBranch(siteNodeVO.getIsBranch());
           
            List nodes = new ArrayList();
            nodes.add(node);
            responseEnvelope.setNodes(nodes);
        }
        catch (Exception e)
        {
            responseEnvelope.setStatus("1");
            e.printStackTrace();   
        }
        return responseEnvelope;
  }
View Full Code Here

    /**
     * This method fetches the SiteNode with the given id
     */
    public CommunicationEnvelope getSiteNode(CommunicationEnvelope envelope)
  {
        CommunicationEnvelope responseEnvelope = new CommunicationEnvelope();
     
    try
       
          List arguments = (List)envelope.getNodes();
          Integer siteNodeId = ((Node)arguments.get(0)).getId();
      logger.info("siteNodeId:" + siteNodeId);
            ViewSiteNodeTreeUCC viewSiteNodeTreeUCC = ViewSiteNodeTreeUCCFactory.newViewSiteNodeTreeUCC();
            SiteNodeVO siteNodeVO = viewSiteNodeTreeUCC.getSiteNode(siteNodeId);
            logger.info("siteNodeVO:" + siteNodeVO.getSiteNodeId() + " " + siteNodeVO.getName());
            Node node = new Node();
            node.setId(siteNodeVO.getSiteNodeId());
            node.setName(siteNodeVO.getName());
            node.setIsBranch(siteNodeVO.getIsBranch());
           
            List nodes = new ArrayList();
            nodes.add(node);
            responseEnvelope.setNodes(nodes);
        }
        catch (Exception e)
        {
            responseEnvelope.setStatus("1");
            e.printStackTrace();   
        }
        return responseEnvelope;
  }
View Full Code Here

    /**
     * This method fetches the root SiteNode of this site
     */
    public CommunicationEnvelope getChildSiteNodes(CommunicationEnvelope envelope)
  {
        CommunicationEnvelope responseEnvelope = new CommunicationEnvelope();
     
    try
       
            List arguments = (List)envelope.getNodes();
          Integer siteNodeId = ((Node)arguments.get(0)).getId();
      logger.info("siteNodeId:" + siteNodeId);
           
            ViewSiteNodeTreeUCC viewSiteNodeTreeUCC = ViewSiteNodeTreeUCCFactory.newViewSiteNodeTreeUCC();
            List childSiteNodes = viewSiteNodeTreeUCC.getSiteNodeChildren(siteNodeId);
     
      List nodes = new ArrayList();
      Iterator childIterator = childSiteNodes.iterator();
     
      while(childIterator.hasNext())
      {
        SiteNodeVO siteNodeVO = (SiteNodeVO)childIterator.next();
        Node node = new Node();
              node.setId(siteNodeVO.getSiteNodeId());
              node.setName(siteNodeVO.getName());
              node.setIsBranch(siteNodeVO.getIsBranch());
              nodes.add(node);
      }       
      
            responseEnvelope.setNodes(nodes);
        }
        catch (Exception e)
        {
            responseEnvelope.setStatus("1");
            e.printStackTrace();   
        }
        return responseEnvelope;
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.net.CommunicationEnvelope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.