AnsweredAssumed Answered

Crear un documento sobre una carpeta especifica [Solucionado

Question asked by rafex on Aug 28, 2012
Latest reply on Aug 29, 2012 by rafex
Mi duda es cómo creo un documento sobre una carpeta especifica, ya que puedo crear documentos cuando creo la carpeta

Map<String, Object> properties = new HashMap<String, Object>();
      properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
      properties.put(PropertyIds.NAME, "carpeta"+System.currentTimeMillis());

      // create the folder
      Folder parent = root.createFolder(properties);
      //System.out.println("folder parent:  " + parent);
      //System.out.println("folder parent:  " + parent.getPath());

      String name = "myNewDocumentds"+System.currentTimeMillis()+".txt";
      // properties
      // (minimal set: name and object type id)
      Map<String, Object> properties2 = new HashMap<String, Object>();
      properties2.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
      properties2.put(PropertyIds.NAME, name);

      // content
      byte[] content = "Hello World, kakkakskaskaks!!!!".getBytes();
      InputStream stream = new ByteArrayInputStream(content);
      ContentStream contentStream = new ContentStreamImpl(name, BigInteger.valueOf(content.length), "text/plain", stream);

      // create a major version
      Document newDoc = parent.createDocument(properties2, contentStream, VersioningState.MAJOR);

pero quiero crear el documento sobre una carpeta que exista previamente, si alguien me puede orientar porfavor!

Outcomes