Package it.eng.spagobi.container

Examples of it.eng.spagobi.container.CoreContextManager


    try{
      // get the user profile from session
      SessionContainer permSession = sessionContainer.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      // get the execution role
      CoreContextManager contextManager = new CoreContextManager(new SpagoBISessionContainer(sessionContainer),
          new LightNavigatorContextRetrieverStrategy(requestSB));
      ExecutionInstance instance = contextManager.getExecutionInstance(ExecutionInstance.class.getName());
      String executionRole = instance.getExecutionRole();
      Integer objId = DAOFactory.getBIObjectDAO().loadBIObjectByLabel(objLabel).getId();
      BIObject obj = DAOFactory.getBIObjectDAO().loadBIObjectForExecutionByIdAndRole(objId, executionRole);
      if (obj == null){
        logger.error("Cannot obtain engine url. Document with label " + objLabel +" doesn't exist into database.");   
        List l = new ArrayList();
        l.add(objLabel);
        throw new EMFUserError(EMFErrorSeverity.ERROR, "1005", l, messageBundle);
      }
      Engine engine = obj.getEngine();
      // GET THE TYPE OF ENGINE (INTERNAL / EXTERNAL) AND THE SUITABLE BIOBJECT TYPES
      Domain engineType = null;
      Domain compatibleBiobjType = null;
      try {
        engineType = DAOFactory.getDomainDAO().loadDomainById(engine.getEngineTypeId());
        compatibleBiobjType = DAOFactory.getDomainDAO().loadDomainById(engine.getBiobjTypeId());
      } catch (EMFUserError error) {
        logger.error("Error retrieving document's engine information", error);
        return "1009|";
      } catch (Exception error) {
        logger.error("Error retrieving document's engine information", error);
        return "1009|";
      }

      String compatibleBiobjTypeCd = compatibleBiobjType.getValueCd();
      String biobjTypeCd = obj.getBiObjectTypeCode();

      // CHECK IF THE BIOBJECT IS COMPATIBLE WITH THE TYPES SUITABLE FOR THE ENGINE
      if (!compatibleBiobjTypeCd.equalsIgnoreCase(biobjTypeCd)) {
        // the engine document type and the biobject type are not compatible
        logger.error("Engine cannot execute input document type: " +
            "the engine " + engine.getName() + " can execute '" + compatibleBiobjTypeCd + "' type documents " +
            "while the input document is a '" + biobjTypeCd + "'.");
        Vector params = new Vector();
        params.add(engine.getName());
        params.add(compatibleBiobjTypeCd);
        params.add(biobjTypeCd);
        //errorHandler.addError(new EMFUserError(EMFErrorSeverity.ERROR, 2002, params));
        return "2002|";
      }

      // IF USER CAN'T EXECUTE THE OBJECT RETURN
      if (!ObjectsAccessVerifier.canSee(obj, profile)) return "1010|";

      //get object configuration
      DocumentCompositionConfiguration docConfig = null;
      docConfig = (DocumentCompositionConfiguration)contextManager.get("docConfig");

      Document document = null;
      //get correct document configuration
      List lstDoc = docConfig.getLabelsArray();
      boolean foundDoc = false;
View Full Code Here


 
  public CoreContextManager getContext() {
    if(contextManager == null) {
      IBeanContainer contextsContainer = getSpagoBISessionContainer();
      IContextRetrieverStrategy contextRetriverStartegy = new ExecutionContextRetrieverStrategy( getSpagoBIRequestContainer() );
      contextManager = new CoreContextManager(contextsContainer, contextRetriverStartegy);
    }
     
    return contextManager;    
  }
View Full Code Here

    IBeanContainer contextsContainer;
    IContextRetrieverStrategy contextRetriverStartegy;
   
    contextsContainer = getSpagoBISessionContainer();
    contextRetriverStartegy = new ExecutionContextRetrieverStrategy( contextId );
    contextManager = new CoreContextManager( contextsContainer, contextRetriverStartegy );
         
    return contextManager;    
  }
View Full Code Here

    if (subMessageExec != null && !subMessageExec.equals(""))
      messageExec = subMessageExec;
    errorHandler = getErrorHandler();
    requestContainer = this.getRequestContainer();
    SessionContainer session = requestContainer.getSessionContainer();
    contextManager = new CoreContextManager(new SpagoBISessionContainer(session),
        new LightNavigatorContextRetrieverStrategy(request));

    permanentSession = session.getPermanentContainer();
    logger.debug("errorHanlder, requestContainer, session, permanentSession retrived ");
View Full Code Here

      UUIDGenerator uuidGen  = UUIDGenerator.getInstance();
      UUID uuidObj = uuidGen.generateTimeBasedUUID();
      String executionContextId = uuidObj.toString();
      executionContextId = executionContextId.replaceAll("-", "");
     
      CoreContextManager ccm = createContext( executionContextId );
         // so far so good: everything has been validated successfully. Let's create a new ExecutionInstance.
      instance = createExecutionInstance(obj.getId(), executionRole, executionContextId);
        
      createContext( executionContextId ).set(ExecutionInstance.class.getName(), instance);
     
View Full Code Here

  public ListIFace filterListForCorrelatedParam(SourceBean request, ListIFace list, HttpServletRequest httpRequest) throws Exception {
    RequestContainer reqCont = ChannelUtilities.getRequestContainer(httpRequest);
    ResponseContainer respCont = ChannelUtilities.getResponseContainer(httpRequest);
    errorHand = respCont.getErrorHandler();
    SessionContainer sessionCont = reqCont.getSessionContainer();
    contextManager = new CoreContextManager(new SpagoBISessionContainer(sessionCont),
        new LightNavigatorContextRetrieverStrategy(request));
    // get biobject from the session
    ExecutionInstance instance = contextManager.getExecutionInstance(ExecutionInstance.class.getName());
    BIObject obj = instance.getBIObject();
    // get the id of the lookup parameter
View Full Code Here

    urlBuilder = UrlBuilderFactory.getUrlBuilder(requestContainer.getChannelType());
    msgBuilder = MessageBuilderFactory.getMessageBuilder();
    if (requestIdentity == null)
      requestIdentity = "";
    SessionContainer session = requestContainer.getSessionContainer();
    contextManager = new CoreContextManager(new SpagoBISessionContainer(session),
        new LightNavigatorContextRetrieverStrategy(request));

    String currTheme=ThemesManager.getCurrentTheme(requestContainer);
    if(currTheme==null)currTheme=ThemesManager.getDefaultTheme();
   
View Full Code Here

    try {
//      try {
//        dossier = DAOFactory.getBIObjectDAO().loadBIObjectById(dossierId);
        RequestContainer requestContainer = this.getRequestContainer();
        SessionContainer session = requestContainer.getSessionContainer();
        CoreContextManager contextManager = new CoreContextManager(new SpagoBISessionContainer(session),
          new LightNavigatorContextRetrieverStrategy(request));
        ExecutionInstance executionInstance = contextManager.getExecutionInstance( ExecutionInstance.class.getName() );
        dossier = executionInstance.getBIObject();
        pathTempFolder = dossierDAO.init(dossier);
//      } catch (EMFUserError e) {
//        logger.error("Error while recovering dossier information: " + e);
//        throw e;
View Full Code Here

TOP

Related Classes of it.eng.spagobi.container.CoreContextManager

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.