Package org.jboss.seam.document

Examples of org.jboss.seam.document.DocumentData


             UIAttachment attachment = new UIAttachment();
             attachment.setFileName("filename.pdf");
             UIMessage message = new UIMessage();
             attachment.setParent(message);
             message.setMailSession(MailSession.instance());
             DocumentData doc = new ByteArrayDocumentData("filename", new DocumentData.DocumentType("pdf", "application/pdf"), new byte[] {});
             attachment.setValue(doc);
             attachment.encodeEnd(FacesContext.getCurrentInstance());
            
             // verify we built the message
             Assert.assertEquals(message.getAttachments().size(), 1);
View Full Code Here


            @Override
            protected void invokeApplication() throws Exception {

                Renderer.instance().render("/simple.xhtml");

                DocumentData data = (DocumentData) Contexts.getEventContext().get("testExport");
                Workbook workbook = Workbook.getWorkbook(new ByteArrayInputStream(((ByteArrayDocumentData)data).getData()));
                Sheet sheet = workbook.getSheet("Developers");
               
                assert sheet != null;
View Full Code Here

            DocumentStore store = (DocumentStore) getValue("#{org.jboss.seam.document.documentStore}");
            String docId = store.newId();

            Contexts.getSessionContext().set("docId", docId);

            DocumentData documentData = new ByteArrayDocumentData("base", UIDocument.PDF, new byte[100]);
            store.saveData(docId, documentData);
         }

         @Override
         protected void renderResponse() throws Exception
View Full Code Here

    */
   private void redirectExport()
   {
      String viewId = Pages.getViewId(FacesContext.getCurrentInstance());
      String baseName = UIWorkbook.baseNameForViewId(viewId);
      DocumentData documentData = new DocumentData(baseName, excelWorkbook.getDocumentType(), excelWorkbook.getBytes());
      String id = DocumentStore.instance().newId();
      String url = DocumentStore.instance().preferredUrlForContent(baseName, excelWorkbook.getDocumentType().getExtension(), id);
      url = Manager.instance().encodeConversationId(url, viewId);
      DocumentStore.instance().saveData(id, documentData);
      try
View Full Code Here

      DocumentType type = excelWorkbook.getDocumentType();

      String viewId = Pages.getViewId(context);
      String baseName = baseNameForViewId(viewId);

      DocumentData documentData = new DocumentData(baseName, type, bytes);
      documentData.setFilename(getFilename());

      if (getExportKey() != null) {
         Contexts.getEventContext().set(getExportKey(), documentData);
         return;
      }
View Full Code Here

      String viewId = Pages.getViewId(facesContext);
      String baseName = Pages.getCurrentBaseName();

      DocumentStore store = DocumentStore.instance();
      DocumentType documentType = new DocumentData.DocumentType("pdf", "application/pdf");
      DocumentData documentData = new ByteArrayDocumentData(baseName, documentType, buffer.toByteArray());
      documentData.setFilename(getFilename());

      if (getExportKey() != null)
      {
         log.debug("Exporting PDF data to event key #0", getExportKey());
         Contexts.getEventContext().set(getExportKey(), documentData);
View Full Code Here

      }

      String viewId = Pages.getViewId(context);
      String baseName = Pages.getCurrentBaseName();

      DocumentData documentData = new ByteArrayDocumentData(baseName, documentType, bytes);
      String dispositionValue = (String) valueBinding(context, "disposition", disposition);
      if (dispositionValue != null)
      {
         documentData.setDisposition(dispositionValue);
      }

      String fileNameValue = (String) valueBinding(context, "fileName", fileName);
      if (fileNameValue != null)
      {
         documentData.setFilename(fileNameValue);
      }

      if (sendRedirect)
      {
         DocumentStore store = DocumentStore.instance();
View Full Code Here

    */
   private void redirectExport()
   {
      String viewId = Pages.getViewId(FacesContext.getCurrentInstance());
      String baseName = Pages.getCurrentBaseName();
      DocumentData documentData = new ByteArrayDocumentData(baseName, excelWorkbook.getDocumentType(), excelWorkbook.getBytes());
      String id = DocumentStore.instance().newId();
      String url = DocumentStore.instance().preferredUrlForContent(baseName, excelWorkbook.getDocumentType().getExtension(), id);
      url = Manager.instance().encodeConversationId(url, viewId);
      DocumentStore.instance().saveData(id, documentData);
      try
View Full Code Here

      DocumentType type = excelWorkbook.getDocumentType();

      String viewId = Pages.getViewId(context);
      String baseName = Pages.getCurrentBaseName();

      DocumentData documentData = new ByteArrayDocumentData(baseName, type, bytes);
      documentData.setFilename(getFilename());

      if (getExportKey() != null)
      {
         Contexts.getEventContext().set(getExportKey(), documentData);
         return;
View Full Code Here

      }

      String viewId = Pages.getViewId(context);
      String baseName = baseNameForViewId(viewId);

      DocumentData documentData = new DocumentData(baseName, documentType, bytes);
      String dispositionValue = (String) valueBinding(context, "disposition", disposition);
      if (dispositionValue != null)
      {
         documentData.setDisposition(dispositionValue);
      }

      String fileNameValue = (String) valueBinding(context, "fileName", fileName);
      if (fileNameValue != null)
      {
         documentData.setFilename(fileNameValue);
      }

      if (sendRedirect)
      {
         DocumentStore store = DocumentStore.instance();
View Full Code Here

TOP

Related Classes of org.jboss.seam.document.DocumentData

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.