Examples of Document


Examples of com.wesabe.grendel.entities.Document

      final FileInputStream recipientKeyring = new FileInputStream("src/test/resources/another-secret-keyring.gpg");
      this.recipientKeySet = KeySet.load(recipientKeyring);
      recipientKeyring.close();

      this.owner = new User(ownerKeySet);
      this.doc = new Document(owner, "test", MediaType.APPLICATION_OCTET_STREAM_TYPE);
    }
View Full Code Here

Examples of de.ailis.jollada.model.Document

     */

    @Test
    public void testAddChild()
    {
        final Document oldDocument = new Document();
        final Document document = new Document();
        final Node oldParent = new Node();
        oldParent.setDocument(oldDocument);
        final Node parent = new Node();
        parent.setDocument(document);
        final Node child = new Node();
View Full Code Here

Examples of de.filiadata.lucene.spider.generated.msoffice2000.word.Document

      //             jedem Fall (auch bei file-Dokumenten) anstatt der
      //             Originaldatei eine tempor�re Kopie genutzt, da diese
      //             unm�glich von jemandem bearbeitet werden kann.
      String fileName = rawDocument.getContentAsFile(true).getAbsolutePath();
      Documents docs = mWordApplication.getDocuments();
      Document doc = docs.open(new Variant(fileName),
                               new Variant(false),    // confirmConversions
                               new Variant(true));    // readOnly

      // iterate through the sections
      StringBuffer content = new StringBuffer(DEFAULT_BUFFER_SIZE);
      Sections sections = doc.getSections();
      for (int i = 1; i <= sections.getCount(); i++) {
        Section sec = sections.item(i);

        // Get the header of the first section as title
        if (i == 1) {
          int headerFirstPage = WdHeaderFooterIndex.wdHeaderFooterFirstPage;
          HeaderFooter firstHeader = sec.getHeaders().item(headerFirstPage);
          String title = firstHeader.getRange().getText();
          setTitle(title);
        }

        // Get the text
        sec.getRange().select();
        content.append(getSelection(mWordApplication) + "\n");
      }

      // iterate through the shapes
      Shapes shapes = doc.getShapes();
      for (int i = 1; i <= shapes.getCount(); i++) {
        Shape shape = shapes.item(new Variant(i));
        appendShape(shape, content);
      }
     
      // iterate through the paragraphs and extract the headlines
      StringBuffer headlines = null;
      if ((mHeadlineStyleNameSet != null) && (! mHeadlineStyleNameSet.isEmpty())) {
        Paragraphs paragraphs = doc.getParagraphs();
        for (int i = 1; i <= paragraphs.getCount(); i++) {
          Paragraph paragraph = paragraphs.item(i);
         
          // Get the name of the style for this paragraph
          // NOTE: See the Style class for getting other values from the style
          Object styleDispatch = paragraph.getFormat().getStyle().getDispatch();
          String formatName = Dispatch.get(styleDispatch, "NameLocal").toString();
         
          if (mHeadlineStyleNameSet.contains(formatName)) {
            // This paragraph is a headline -> add it to the headlines StringBuffer
           
            // Extract the text
            paragraph.getRange().select();
            String text = getSelection(mWordApplication);
            text = removeBinaryStuff(text);
           
            // Add it to the headlines
            if (headlines == null) {
              headlines = new StringBuffer();
            }
            headlines.append(text + "\n");
           
            if (mLog.isDebugEnabled()) {
              mLog.debug("Extracted headline: '" + text + "'");
            }
          }
        }
      }
     
      // Read the document properties
      readProperties(doc);
     
      // Set the extracted text and the headlines
      setCleanedContent(content.toString());
      if (headlines != null) {
        setHeadlines(headlines.toString());
      }

      // Dokument schlie�en (ohne Speichern)
      doc.close(new Variant(false));
    }
    catch (ComFailException exc) {
      throw new RegainException("Using COM failed.", exc);
    }
  }
View Full Code Here

Examples of de.micromata.opengis.kml.v_2_2_0.Document

   
    // Setup the Kml object used to generate the kml document
    Kml kml = new Kml();
   
    // Create the document
    Document document = kml.createAndSetDocument()
      .withName("Infinit.e KML Interface"
      .withDescription("Infinit.e search KML representation");
   
    // Create the folder to contain the placemarks (allows us to have multiple folders
    Folder placemarksFolder = document.createAndAddFolder()
      .withName("Documents")
      .withDescription("Placemarks for the document locations in the query");
   
    // loop through the result set
    for ( BasicDBObject fdbo : docs)
View Full Code Here

Examples of de.pdark.decentxml.Document

    private void createVaultFileWithContent(IFolder parent, String filename, String childNodeType, Element content) {
        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<jcr:root \n    xmlns:sling=\"http://sling.apache.org/jcr/sling/1.0\"\n    xmlns:jcr=\"http://www.jcp.org/jcr/1.0\"\n    jcr:primaryType=\""+childNodeType+"\"/>";
        final IFile file = parent.getFile(filename);
        try {
            if (content!=null) {
                Document document = TolerantXMLParser.parse(xml, file.getFullPath().toOSString());
                // add the attributes of content
                List<Attribute> attributes = content.getAttributes();
                for (Iterator<Attribute> it = attributes.iterator(); it.hasNext();) {
                    Attribute anAttribute = it.next();
                    if (anAttribute.getName().equals("jcr:primaryType")) {
                        // skip this
                        continue;
                    }
                    document.getRootElement().addAttribute(anAttribute);
                }
                // then copy all the children
                document.getRootElement().addNodes(content.getChildren());
               
                // then save the document
                xml = document.toXML();
            }
            if (file.exists()) {
                file.setContents(new ByteArrayInputStream(xml.getBytes()), true, true, new NullProgressMonitor());
            } else {
                file.create(new ByteArrayInputStream(xml.getBytes()), true, new NullProgressMonitor());
View Full Code Here

Examples of de.sciss.app.Document

  }
 
  private void oscRouteNext( RoutedOSCMessage rom )
  {
    final String  subPath;
    final Document  doc;
   
    try {
      subPath = rom.getPathComponent();

      if( subPath.equals( OSC_ACTIVE )) {
View Full Code Here

Examples of de.xanders.data.system.dao.Document

    /**
     * @see DocumentService#getDocumentById(java.lang.Long)
     */
    protected DocumentVO handleGetDocumentById(Long documentId)
        throws java.lang.Exception {
      Document document = this.getDocumentDao().load(documentId);
      return this.getDocumentDao().toDocumentVO(document);
    }
View Full Code Here

Examples of domain.Document

          errors.setNestedPath("");
          return;
        }

        String chemin = null;
        Document cv = folder.getPi().getCv();

        if (!cv.getName().equals("")) {
          errors.setNestedPath("folder.pi.cv");
          errors.rejectValue("data", "data.invalid",
              "Vous avez d�ja envoy� un cv: supprimez le avant!");
          errors.setNestedPath("");
          return;
        }

        String id = Generator.getRandomId();
        chemin = request.getSession().getServletContext().getRealPath(
            "/")
            + "uploads/CV/" + id + "_" + nomDocument;
        enregistrer(fichier, chemin);
        cv.setName(id + "_" + nomDocument);
      } else if (todelete != null) {
        System.out.println("DELETING RESUME");
        Document cv = folder.getPi().getCv();
        File f = new File(request.getSession().getServletContext()
            .getRealPath("/")
            + "uploads/CV/" + cv.getName());
        f.delete();
        cv.setName("");
      }

    } else if (page == 3) {
      if (request.getParameter("add") != null) {
        errors.setNestedPath("folder.currentPromoDetail");
View Full Code Here

Examples of edu.harvard.hul.ois.jhove.Document

              "Corso Stati Uniti 23/A, 25100 Padova.");
    agent.setTelephone ("+39 (49) 8283-411");
    agent.setEmail("saint@eng.it");
    _vendor = agent;

    Document doc = new Document ("PNG (Portable Network Graphics): a file format (pronounced \"ping\"), for a lossless, portable, compressed individual computer graphics image transmitted across the Internet. Indexed-colour, greyscale, and truecolour images are supported, with optional transparency",
                   DocumentType.REPORT);
    agent = new Agent ("W3 Consortium",
               AgentType.STANDARD);
    agent.setAddress ("E.M.E.A.: ERCIM, 2004 route des Lucioles, BP 93, 06902 Sophia-Antipolis Cedex, France\nJapan & Korea: Keio University, 5322 Endo, Fujisawa, Kanagawa 252-8520 Japan\nAll other countries: MIT, 32 Vassar Street, Room 32-G515, Cambridge, MA 02139 USA");
    agent.setTelephone ("E.M.E.A. : +33.4.92.38.75.90\nJapan & Korea: +81.466.49.1170\nAll other countries: +1.617.253.2613");
    agent.setWeb ("http://www.w3.org/");
    doc.setAuthor (agent);
    doc.setDate ("2003-11-10");
    doc.setIdentifier (new Identifier ("http://www.w3.org/Graphics/GIF/spec-gif87.txt",
                       IdentifierType.URL));
    _specification.add (doc);

    Signature sig = new InternalSignature ("PNG", SignatureType.MAGIC,
                         SignatureUseType.MANDATORY, 0);
View Full Code Here

Examples of edu.pitt.dbmi.nlp.noble.coder.model.Document

    htmlExporter = new HTMLExporter(outputDir);
    csvExporter = new CSVExporter(outputDir);
   
    for(int i=0;i<files.size();i++){
      progress("processing report ("+(processCount+1)+") "+files.get(i).getName()+" ... \n");
      Document doc = coder.process(files.get(i));
      processTime += coder.getProcessTime();
     
      // now output HTML for this report
      htmlExporter.export(doc);
      csvExporter.export(doc);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.