Package it.eng.spagobi.engines.documentcomposition.configuration

Examples of it.eng.spagobi.engines.documentcomposition.configuration.DocumentCompositionConfiguration$Document


    HttpServletRequest httpRequest = getHttpRequest();
    HttpSession session=httpRequest.getSession();

    this.freezeHttpResponse();

    DocumentCompositionConfiguration docCompConf=(DocumentCompositionConfiguration)session.getAttribute("DOC_COMP_CONF");

    // create the pdfFile   
    String dir=System.getProperty("java.io.tmpdir");
      Random generator = new Random();
      int randomInt = generator.nextInt();
      String path=dir+"/"+Integer.valueOf(randomInt).toString()+".pdf";
   
    File tmpFile=new File("path");

    // map that associates document labels and DOcument Containers (containing informations)
    Map<String, DocumentContainer> documents=new LinkedHashMap<String, DocumentContainer>();

    SpagoBIRequestContainer requestContainer=getSpagoBIRequestContainer();
    SourceBean sb=requestContainer.getRequest();
   
    // Recover currentParametersConfiguration
    Map<String, CurrentConfigurationDocComp> currentConfigurationsMap=new HashMap<String, CurrentConfigurationDocComp>();

    // if only one metadata style is wrong use default table style (ignore table positions)
    boolean defaultStyle=false;

    Map styles=docCompConf.getLstDivStyle();
    //Map docsMap=docCompConf.getDocumentsMap();
    Iterator iteratorStyles=styles.keySet().iterator();
    for (Iterator iterator = docCompConf.getDocumentsArray().iterator(); iterator.hasNext();) {
      Document doc = (Document) iterator.next();
      String label=doc.getSbiObjLabel();
      logger.debug("Document "+label);     
      // recover style informations
      String styleLab=(String)iteratorStyles.next();
View Full Code Here


      // 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;
      for (int i = 0; i < lstDoc.size(); i++){
        document = (Document)docConfig.getDocument((String)lstDoc.get(i));
        if (document != null){
          if (!obj.getLabel().equalsIgnoreCase(document.getSbiObjLabel()))
            continue;
          else{
            foundDoc = true;
View Full Code Here

        logger.error("Error while converting the Template bytes into a SourceBean object: ", e);
        throw new EMFUserError(EMFErrorSeverity.ERROR, "1011", messageBundle);
      }
     
      // read the configuration and set relative object into session
      DocumentCompositionConfiguration docConf = new DocumentCompositionConfiguration(content);
      SessionContainer session = requestContainer.getSessionContainer();
      ContextManager contextManager = new ContextManager(new SpagoBISessionContainer(session),
          new LightNavigatorContextRetrieverStrategy(requestContainer.getServiceRequest()));
      contextManager.set("docConfig", docConf);
        
View Full Code Here

      //gets document composition configuration
      if(template==nullreturn;
      byte[] contentBytes = template.getContent();
      String contentStr = new String(contentBytes);
      SourceBean content = SourceBean.fromXMLString(contentStr);
      DocumentCompositionConfiguration docConf = new DocumentCompositionConfiguration(content);
      List lstLabeldDocs = docConf.getSbiObjLabelsArray();
      List totalParameters = new ArrayList();

      //if flag flgDelete is true delete all parameters associated to document composition
      if (flgDelete){
        List lstDocParameters = DAOFactory.getBIObjectParameterDAO().loadBIObjectParametersById(biObject.getId());
View Full Code Here

      logger.debug("Template document composition in insert: " + template );
      if (template==null) return;
      byte[] contentBytes = template.getContent();
      String contentStr = new String(contentBytes);
      SourceBean content = SourceBean.fromXMLString(contentStr);
      DocumentCompositionConfiguration docConf = new DocumentCompositionConfiguration(content);
      List lstLabeldDocs = docConf.getSbiObjLabelsArray();
      List totalParameters = new ArrayList();


      //for every document child gets parameters and inserts these into new document composition object
      for (int i=0; i<lstLabeldDocs.size(); i++){
View Full Code Here

    @Test
    public void testDocument() throws Exception {
        if (!shouldRunTest("Document")) {
            return;
        }
        Document x = new Document();
        x.setValue("content-x");
        x.setID("Hello There");
        Document yOrig = new Document();
        yOrig.setID("Cheerio");
        yOrig.setValue("content-y");

        Holder<Document> y = new Holder<Document>(yOrig);
        Holder<Document> z = new Holder<Document>();

        Document ret;
        if (testDocLiteral) {
            ret = docClient.testDocument(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testDocument(x, y, z);
        } else {
            ret = rpcClient.testDocument(x, y, z);
        }
        if (!perfTestOnly) {
            equals("testDocument(): Incorrect value for inout param", x, y.value);
            equals("testDocument(): Incorrect value for out param", yOrig, z.value);
            equals("testDocument(): Incorrect return value", x, ret);
        }

        x = new Document();
        yOrig = new Document();
        x.setValue("content-x");
        yOrig.setValue("content-y");
        x.setID(null);
        yOrig.setID(null);
        y = new Holder<Document>(yOrig);
        z = new Holder<Document>();

        if (testDocLiteral) {
            ret = docClient.testDocument(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testDocument(x, y, z);
        } else {
            ret = rpcClient.testDocument(x, y, z);
        }
        if (!perfTestOnly) {
            equals("testDocument(): Incorrect value for inout param", x, y.value);
            equals("testDocument(): Incorrect value for out param", yOrig, z.value);
            equals("testDocument(): Incorrect return value", x, ret);
            assertNull(y.value.getID());
            assertNull(ret.getID());
        }
    }
View Full Code Here

        assertEquals(msg, x.getValue(), y.getValue());
        assertEquals(msg, x.getID(), y.getID());
    }
    @Test
    public void testDocument() throws Exception {
        Document x = new Document();
        x.setValue("content-x");
        x.setID("Hello There");
        Document yOrig = new Document();
        yOrig.setID("Cheerio");
        yOrig.setValue("content-y");

        Holder<Document> y = new Holder<Document>(yOrig);
        Holder<Document> z = new Holder<Document>();

        Document ret;
        if (testDocLiteral) {
            ret = docClient.testDocument(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testDocument(x, y, z);
        } else {
            ret = rpcClient.testDocument(x, y, z);
        }
        if (!perfTestOnly) {
            equals("testDocument(): Incorrect value for inout param", x, y.value);
            equals("testDocument(): Incorrect value for out param", yOrig, z.value);
            equals("testDocument(): Incorrect return value", x, ret);
        }

        x = new Document();
        yOrig = new Document();
        x.setValue("content-x");
        yOrig.setValue("content-y");
        x.setID(null);
        yOrig.setID(null);
        y = new Holder<Document>(yOrig);
        z = new Holder<Document>();

        if (testDocLiteral) {
            ret = docClient.testDocument(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testDocument(x, y, z);
        } else {
            ret = rpcClient.testDocument(x, y, z);
        }
        if (!perfTestOnly) {
            equals("testDocument(): Incorrect value for inout param", x, y.value);
            equals("testDocument(): Incorrect value for out param", yOrig, z.value);
            equals("testDocument(): Incorrect return value", x, ret);
            assertNull(y.value.getID());
            assertNull(ret.getID());
        }
    }
View Full Code Here

        assertEquals(msg, x.getValue(), y.getValue());
        assertEquals(msg, x.getID(), y.getID());
    }
   
    public void testDocument() throws Exception {
        Document x = new Document();
        x.setValue("content-x");
        x.setID("Hello There");
        Document yOrig = new Document();
        yOrig.setID("Cheerio");
        yOrig.setValue("content-y");

        Holder<Document> y = new Holder<Document>(yOrig);
        Holder<Document> z = new Holder<Document>();

        Document ret;
        if (testDocLiteral) {
            ret = docClient.testDocument(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testDocument(x, y, z);
        } else {
            ret = rpcClient.testDocument(x, y, z);
        }
        if (!perfTestOnly) {
            equals("testDocument(): Incorrect value for inout param", x, y.value);
            equals("testDocument(): Incorrect value for out param", yOrig, z.value);
            equals("testDocument(): Incorrect return value", x, ret);
        }

        x = new Document();
        yOrig = new Document();
        x.setValue("content-x");
        yOrig.setValue("content-y");
        x.setID(null);
        yOrig.setID(null);
        y = new Holder<Document>(yOrig);
        z = new Holder<Document>();

        if (testDocLiteral) {
            ret = docClient.testDocument(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testDocument(x, y, z);
        } else {
            ret = rpcClient.testDocument(x, y, z);
        }
        if (!perfTestOnly) {
            equals("testDocument(): Incorrect value for inout param", x, y.value);
            equals("testDocument(): Incorrect value for out param", yOrig, z.value);
            equals("testDocument(): Incorrect return value", x, ret);
            assertNull(y.value.getID());
            assertNull(ret.getID());
        }
    }
View Full Code Here

            DOMBuilder domBuilder = new DOMBuilder();
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                return domBuilder.build((org.w3c.dom.Element) node);
            }
            else if (node.getNodeType() == Node.DOCUMENT_NODE) {
                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
        }
        // we have no other option than to transform
        JDOMResult jdomResult = new JDOMResult();
        transform(requestPayload, jdomResult);
View Full Code Here

            DOMBuilder domBuilder = new DOMBuilder();
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                return domBuilder.build((org.w3c.dom.Element) node);
            }
            else if (node.getNodeType() == Node.DOCUMENT_NODE) {
                Document document = domBuilder.build((org.w3c.dom.Document) node);
                return document.getRootElement();
            }
        }
        // we have no other option than to transform
        JDOMResult jdomResult = new JDOMResult();
        transform(source, jdomResult);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.documentcomposition.configuration.DocumentCompositionConfiguration$Document

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.