Package it.eng.spagobi.services.proxy

Examples of it.eng.spagobi.services.proxy.ContentServiceProxy


        return;
      }
      xmlString = document.asXML();
        try {
        //ContentServiceProxy proxy=new ContentServiceProxy(user,session);
        ContentServiceProxy proxy=new ContentServiceProxy(userUniqueIdentifier,session);
        String result=proxy.saveObjectTemplate( documentId, templateName, xmlString);
          //byte[] response = sbiutils.saveObjectTemplate(spagoBIBaseUrl, path, templateName, xmlString);
        } catch (Exception gse) {   
          logger.error("Error while saving template", gse);
          //session.setAttribute("saveTemplateMessage", "KO - " + gse.getMessage());
        }  
View Full Code Here


        return;
      }
      xmlString = document.asXML();
        try {
      //ContentServiceProxy proxy=new ContentServiceProxy(user,session);
      ContentServiceProxy proxy=new ContentServiceProxy(userUniqueIdentifier,session);
      String result=proxy.saveObjectTemplate( documentId, templateName, xmlString);
        } catch (Exception gse) {   
          logger.error("Error while saving template", gse);
        }  
    } else {
      logger.error("Could not retrieve MDX query");
View Full Code Here

    attributes.put("FUNCTIONALITYCODE", functionalitiyCode)
    attributes.put("STATE", state);
    attributes.put("USER", user);
   
    try {
      ContentServiceProxy contentProxy=new ContentServiceProxy(user, servletIOManager.getHttpSession());
        contentProxy.publishTemplate(attributes);
      //servletIOManager.getContentServiceProxy().publishTemplate(attributes);
      /*
      String spagobiurl = config.getSpagobiUrl();
        session.setAttribute("BACK_END_SPAGOBI_CONTEXT", spagobiurl);
        ContentServiceProxy contentProxy=new ContentServiceProxy(user,session);
View Full Code Here

    try {   
      HttpSession session = servletIOManager.getHttpSession();
      cleanSessionAttributes(session);
     
      IEngUserProfile profile = (IEngUserProfile) session.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      ContentServiceProxy contentProxy = new ContentServiceProxy((String)profile.getUserUniqueIdentifier(),session);
      String documentId = (String) servletIOManager.getRequest().getParameter(DOCUMENT_ID);
      String subobj = (String) servletIOManager.getRequest().getParameter(SUBOBJ_ID);
      String isSpagoBIDev = (String) servletIOManager.getRequest().getParameter(IS_DEVELOPER);
      String isNewDoc = (String) servletIOManager.getRequest().getParameter(IS_NEW_DOCUMENT);
     
      Locale locale = servletIOManager.getLocale();
      String country = locale.getCountry();
      String language = locale.getLanguage();

      if(language == null || country == null){
        language = (String) servletIOManager.getRequest().getParameter(LANG);
        country = (String) servletIOManager.getRequest().getParameter(COUNTRY);
      }
     
      String pass = AuthUserImpl.encrypt(rb.getString("jpalo.admin.password"));
     
      jpaloUrl = PALO_BASE_URL;
     
      jpaloUrl += "?locale=";     
      jpaloUrl += language+"_"+country;
      jpaloUrl += "&theme=gray&options=(";
      jpaloUrl += "user=\"";
      jpaloUrl += rb.getString("jpalo.admin.user");
      jpaloUrl += "\",pass=\"";
      jpaloUrl += pass;
      jpaloUrl += "\"";
      if((isNewDoc != null && isNewDoc.equals("true")) &&
          (isSpagoBIDev != null && isSpagoBIDev.equals("true"))){
        //new document--> template doesn't exist!
        //open editor with no view
          if(documentId != null && profile != null){
            jpaloUrl += ",spagobiusr=\""+(String)profile.getUserUniqueIdentifier()+"\"";       
            jpaloUrl += ",spagobidoc=\""+documentId+"\"";
          }
          if(isSpagoBIDev != null){
            jpaloUrl += ",isdeveloper=\""+isSpagoBIDev+"\"";
          }         
         
      }else{
        Content templateContent = contentProxy.readTemplate(documentId,new HashMap());
 
        byte[] byteContent = null;
        try {
          BASE64Decoder bASE64Decoder = new BASE64Decoder();
          byteContent = bASE64Decoder.decodeBuffer(templateContent.getContent());
View Full Code Here

        String visibilityBoolean = "false";
      if (PUBLIC_VISIBLITY.equalsIgnoreCase(analysisVisibility))
        visibilityBoolean = "true";
     
      //***SpagoBIAccessUtils sbiutils = new SpagoBIAccessUtils();
      ContentServiceProxy proxy=new ContentServiceProxy(userUniqueIdentifier,session);
      try {
/**        byte[] response = sbiutils.saveSubObject(spagoBIBaseUrl, jcrPath, analysisName,
            analysisDescription, user, visibilityBoolean, xmlString);*/
                String result=proxy.saveSubObject(documentId, analysisName,analysisDescription,
            visibilityBoolean, xmlString);   

        //*****String message = new String(response);
                logger.debug("result save subobject: " + result);       
                session.setAttribute("saveSubObjectMessage", result);
View Full Code Here

        String visibilityBoolean = "false";
        if (PUBLIC_VISIBLITY.equalsIgnoreCase(analysisVisibility))
        visibilityBoolean = "true";
       
       //ContentServiceProxy proxy=new ContentServiceProxy(user,session);
       ContentServiceProxy proxy=new ContentServiceProxy(userUniqueIdentifier,session);
        try {
                String result=proxy.saveSubObject(documentId, analysisName,analysisDescription,
                                  visibilityBoolean, xmlString);   
                logger.debug("result save subobject: " + result);
            session.setAttribute("saveSubObjectMessage", result);
            // if the saving operation has no success, the previous
            if (result.toUpperCase().startsWith("KO")) this.analysisName = recoveryAnalysisName;
View Full Code Here

    SourceBean template;
    SourceBean formBlock;
    SourceBean queryBlock;
   
    QbeEngineInstance qbeEngineInstance;
    ContentServiceProxy contentServiceProxy;
   
    logger.debug("IN");
   
    try {   
      super.service(request, response);
     
      qbeEngineInstance = getEngineInstance();
      Assert.assertNotNull(qbeEngineInstance, "It's not possible to execute " + this.getActionName() + " service before having properly created an instance of EngineInstance class");
     
     
      formState = this.getAttributeAsJSONObject(FORM_STATE);
      logger.debug("Parameter [" + FORM_STATE + "] is equals to [" + formState + "]");
      Assert.assertNotNull(formState, "Parameter [" + FORM_STATE + "] cannot be null");
     
      qbeEngineInstance.getFormState().setConf(formState);
     
      templateName = this.getAttributeAsString(TEMPLATE_NAME);
      logger.debug("Parameter [" + TEMPLATE_NAME + "] is equals to [" + templateName + "]");
      if(StringUtilities.isEmpty(templateName)) {
        templateName = "template.sbiform";
        logger.debug("The default template name [" + templateName + "] will be used");
      }
     
      template = (SourceBean)qbeEngineInstance.getEnv().get("TEMPLATE");
     
      StringBuffer dataDefinition = new StringBuffer();
      String formStateString = new String(getEngineInstance().getFormState().store());
      JSONObject formStateJSON = new JSONObject(formStateString);
      dataDefinition.append("<FORM>");
      dataDefinition.append("<![CDATA[\n" + formStateJSON.toString(3) + "\n]]>");
      dataDefinition.append("</FORM>");
      formBlock = SourceBean.fromXMLString(dataDefinition.toString());
      template.updAttribute(formBlock);
     
      dataDefinition = new StringBuffer();
      String analysisState = new String(getEngineInstance().getAnalysisState().store());
      JSONObject queryJSON = new JSONObject(analysisState);
      dataDefinition.append("<QUERY>");
      dataDefinition.append("<![CDATA[\n" + queryJSON.toString(3) + "\n]]>");
      dataDefinition.append("</QUERY>");
      queryBlock = SourceBean.fromXMLString(dataDefinition.toString());
      template.updAttribute(queryBlock);
     
      logger.debug(template.toString());
     
      contentServiceProxy = (ContentServiceProxy)qbeEngineInstance.getEnv().get(EngineConstants.ENV_CONTENT_SERVICE_PROXY);
      Assert.assertNotNull(formState, "Parameter [" + FORM_STATE + "] cannot be null");
     
      String docId = (String)qbeEngineInstance.getEnv().get("DOCUMENT");
      String result = contentServiceProxy.saveObjectTemplate(docId, templateName, template.toString());
     
      if (result == null || !result.trim().equals("OK")) {
        throw new Exception("Error while saving document's template");
      }
     
View Full Code Here

  public String saveAnalysisState(JSONObject form, String scope, String name,
      String description) throws SpagoBIEngineException {
    String documentId = null;
    SmartFilterAnalysisState analysisState = null;
    ContentServiceProxy contentServiceProxy = null;
    String serviceResponse = null;

    QbeEngineInstance engineInstance = getEngineInstance();
   
    analysisState = new SmartFilterAnalysisState(parseValues(form, engineInstance.getFormState().getIdNameMap()));

    if (getEnv() == null) {
      return "KO - Missing environment";
    }

    contentServiceProxy = (ContentServiceProxy) getEnv().get(
        EngineConstants.ENV_CONTENT_SERVICE_PROXY);
    if (contentServiceProxy == null) {
      return "KO - Missing content service proxy";
    }

    documentId = (String) getEnv().get(EngineConstants.ENV_DOCUMENT_ID);
    if (documentId == null) {
      return "KO - Missing document id";
    }

    String isPublic = "false";
    if (PUBLIC_SCOPE.equalsIgnoreCase(scope))
      isPublic = "true";

    serviceResponse = contentServiceProxy.saveSubObject(documentId, name,
        description, isPublic, new String(analysisState.store()));

    return serviceResponse;
  }
View Full Code Here

    }
  }

  public ContentServiceProxy getContentServiceProxy() {
    if (contentProxy == null) {
      contentProxy = new ContentServiceProxy(getUserIdentifier(),
          getHttpSession());
    }

    return contentProxy;
  }
View Full Code Here

  public String saveAnalysisState() throws SpagoBIEngineException {
    IEngineInstance engineInstance = null;
    String documentId = null;
    EngineAnalysisMetadata analysisMetadata = null;
    IEngineAnalysisState analysisState = null;
    ContentServiceProxy  contentServiceProxy = null;
    String serviceResponse= null;
   
   
   
    engineInstance = getEngineInstance();
    analysisMetadata = engineInstance.getAnalysisMetadata();
    analysisState = engineInstance.getAnalysisState();

    if(getEnv() == null) {
      return "KO - Missing environment";
    }
   
    contentServiceProxy = (ContentServiceProxy)getEnv().get( EngineConstants.ENV_CONTENT_SERVICE_PROXY );
    if(contentServiceProxy == null) {
      return "KO - Missing content service proxy";
    }
   
    documentId = (String)getEnv().get( EngineConstants.ENV_DOCUMENT_ID );
    if(documentId == null) {
      return "KO - Missing document id";
    }
   
      String isPublic = "false";
      if (PUBLIC_SCOPE.equalsIgnoreCase(analysisMetadata.getScope()))
        isPublic = "true";
   
    serviceResponse = contentServiceProxy.saveSubObject(documentId,
        analysisMetadata.getName(),
        analysisMetadata.getDescription(),
        isPublic,
        new String(analysisState.store()) );
   
View Full Code Here

TOP

Related Classes of it.eng.spagobi.services.proxy.ContentServiceProxy

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.