Examples of Document


Examples of org.apache.chemistry.opencmis.client.api.Document

    String[] rval = new String[documentIdentifiers.length];
    int i = 0;
    while (i < rval.length){
      CmisObject cmisObject = session.getObject(documentIdentifiers[i]);
      if (cmisObject.getBaseType().getId().equals(CMIS_DOCUMENT_BASE_TYPE)) {
        Document document = (Document) cmisObject;
       
        //we have to check if this CMIS repository support versioning
        // or if the versioning is disabled for this content
        if(StringUtils.isNotEmpty(document.getVersionLabel())){
          rval[i] = document.getVersionLabel();
        } else {
        //a CMIS document that doesn't contain versioning information will always be processed
          rval[i] = StringUtils.EMPTY;
        }
      } else {
View Full Code Here

Examples of org.apache.chemistry.opencmis.inmemory.storedobj.api.Document

          DocumentVersion version = objectStore.createVersionedDocument(name,  propMap,
                user, folder, addACEs, removeACEs, contentStream, versioningState);
            version.persist();
            so = version; // return the version and not the version series to caller
        } else {
          Document doc = objectStore.createDocument(name, propMap, user, folder, addACEs, removeACEs);
          doc.setContent(contentStream, false);
            doc.persist();
            so = doc;
        }

        return so;
    }
View Full Code Here

Examples of org.apache.ctakes.ytex.uima.model.Document

    });
  }

  private Document createDocument(JCas jcas, String analysisBatch,
      boolean bStoreDocText, boolean bStoreCAS) {
    Document doc = new Document();
    if (bStoreDocText)
      doc.setDocText(jcas.getDocumentText());
    doc.setAnalysisBatch(analysisBatch == null
        || analysisBatch.length() == 0 ? getDefaultAnalysisBatch()
        : analysisBatch);
    // look for the ctakes DocumentID anno
    if (setUimaDocId(jcas, doc,
        "edu.mayo.bmi.uima.core.type.structured.DocumentID",
        "documentID") == null) {
      // look for the uima SourceDocumentInformation anno
      setUimaDocId(jcas, doc,
          "org.apache.uima.examples.SourceDocumentInformation", "uri");
    }
    // look for document
    if (bStoreCAS) {
      try {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        GZIPOutputStream zipOut = new GZIPOutputStream(out);
        XmiCasSerializer ser = new XmiCasSerializer(
            jcas.getTypeSystem());
        XMLSerializer xmlSer = new XMLSerializer(zipOut, false);
        ser.serialize(jcas.getCas(), xmlSer.getContentHandler());
        zipOut.close();
        doc.setCas(out.toByteArray());
      } catch (Exception saxException) {
        log.error("error serializing document cas", saxException);
      }
    }
    return doc;
View Full Code Here

Examples of org.apache.ecs.Document

     */
    public Document getPage()
    {
        pageSet = true;
        if (this.page == null)
            this.page = new Document();
        return this.page;
    }
View Full Code Here

Examples of org.apache.fop.afp.modca.Document

     * @return a new {@link Document}
     */
    public Document createDocument() {
        String documentName = DOCUMENT_NAME_PREFIX
        + StringUtils.lpad(String.valueOf(++documentCount), '0', 5);
        Document document = new Document(this, documentName);
        return document;
    }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.testmodel.auto.Document

    //---------------------------------------------------------------------------------------------------------
      Folder  folder = new FolderImpl();
      folder.setPath("/folder2");
      folder.setName("folder2");       
   
      Document document = new DocumentImpl();
      document.setPath("/folder2/document4");
      document.setName("document4");
      document.setContentType("plain/text");
      DocumentStream documentStream = new DocumentStream();
      documentStream.setEncoding("utf-8");
      documentStream.setContent("Test Content 4".getBytes());
      document.setDocumentStream(documentStream);      

      Folder subFolder = new FolderImpl();
      subFolder.setName("subfolder");
      subFolder.setPath("/folder2/subfolder");
                 
View Full Code Here

Examples of org.apache.jackrabbit.ocm.testmodel.interfaces.Document

            documentImpl.setContentType("plain/text");
            DocumentStream documentStream = new DocumentStream();
            documentStream.setEncoding("utf-8");
            documentStream.setContent("Test Content".getBytes());
            documentImpl.setDocumentStream(documentStream);
            Document document = documentImpl;
           
            ocm.insert(document);
      ocm.save();

      //---------------------------------------------------------------------------------------------------------
      // Retrieve
      //---------------------------------------------------------------------------------------------------------           
      document = (Document) ocm.getObject( "/document1");
      assertTrue("Invalid implementation for Document", document instanceof DocumentImpl);
      assertEquals("Document path is invalid", document.getPath(), "/document1");
      assertEquals("Content type  is invalid", document.getContentType(), "plain/text");
      assertNotNull("document stream is null", document.getDocumentStream());
      assertTrue("Invalid document stream ", document.getDocumentStream().getEncoding().equals("utf-8"));
     
      //---------------------------------------------------------------------------------------------------------
      // Update  a document
      //---------------------------------------------------------------------------------------------------------           
      document.setName("anotherName");
      ocm.update(document);
      ocm.save();
     
             //  ---------------------------------------------------------------------------------------------------------
      // Retrieve the updated descendant object
      //---------------------------------------------------------------------------------------------------------           
      document = (Document) ocm.getObject( "/document1");
      assertTrue("Invalid implementation for Document", document instanceof DocumentImpl);
      assertEquals("document name is incorrect", document.getName(), "anotherName");
      assertEquals("Document path is invalid", document.getPath(), "/document1");
      assertEquals("Content type  is invalid", document.getContentType(), "plain/text");
      assertNotNull("document stream is null", document.getDocumentStream());
      assertTrue("Invalid document stream", document.getDocumentStream().getEncoding().equals("utf-8"));

      CmsObject cmsObject = (CmsObject) ocm.getObject( "/document1");
      assertEquals("cmsObject name is incorrect", cmsObject.getName(), "anotherName");
      assertEquals("cmsObject path is invalid", cmsObject.getPath(), "/document1");     
     
View Full Code Here

Examples of org.apache.jackrabbit.vault.util.diff.Document

            out.writeNewLine();
            out.write("===================================================================");
            out.writeNewLine();

            Reader r0 = getBaseFile(false) == null ? null : getBaseFile(false).getReader();
            Document d0 = new Document(this, LineElementsFactory.create(this, r0, false));
            Reader r1 = file.exists() ? new InputStreamReader(FileUtils.openInputStream(file), Constants.ENCODING) : null;
            Document d1 = new Document(this, LineElementsFactory.create(this, r1, false));

            DocumentDiff diff;
            try {
                diff = d0.diff(d1);
            } finally {
View Full Code Here

Examples of org.apache.jetspeed.om.page.Document

        return new TestSuite(TestCastorFileSystemDocumentHandler.class);
    }
   
    public void testFolderMetaData() throws Exception
    {
        Document doc = folderMetaDataDocumentHandler.getDocument("/folder1/folder.metadata", false);
        assertNotNull(doc);
        String title = doc.getTitle();
        assertEquals("Default Title for Folder 1", title);
    }
View Full Code Here

Examples of org.apache.lenya.cms.publication.Document

      builder.buildCanonicalUrl(
        publication,
        getFirstarea(),
        srcDocumentid,
        language);
    Document srcDoc;
    try {
      srcDoc = builder.buildDocument(publication, srcUrl);
    } catch (DocumentBuildException e) {
      throw new BuildException(e);
    }
    ResourcesManager resourcesMgr = new ResourcesManager(srcDoc);
    List resources = new ArrayList(Arrays.asList(resourcesMgr.getResources()));
    resources.addAll(Arrays.asList(resourcesMgr.getMetaFiles()));
    File[] srcFiles =
      (File[]) resources.toArray(new File[resources.size()]);

    if (srcFiles == null) {
      log(
        "There are no resources for the document "
          + getFirstdocumentid());
      return;
    }

    String destUrl =
      builder.buildCanonicalUrl(
        publication,
        getSecarea(),
        destDocumentid,
        language);
    Document destDoc;
    try {
      destDoc = builder.buildDocument(publication, destUrl);
    } catch (DocumentBuildException e) {
      throw new BuildException(e);
    }
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.