Codota Logo
BusinessAdapter.getDocument
Code IndexAdd Codota to your IDE (free)

How to use
getDocument
method
in
org.nuxeo.ecm.automation.core.operations.business.adapter.BusinessAdapter

Best Java code snippets using org.nuxeo.ecm.automation.core.operations.business.adapter.BusinessAdapter.getDocument (Showing top 5 results out of 315)

  • Common ways to obtain BusinessAdapter
private void myMethod () {
BusinessAdapter b =
  • Codota IconDocumentModel documentModel;Object object;documentModel.getAdapter(object.getClass())
  • Smart code suggestions by Codota
}
origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@OperationMethod
public BusinessAdapter run(BusinessAdapter input) throws ClassNotFoundException {
  DocumentModel document = input.getDocument();
  session.saveDocument(document);
  return input;
}
origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@OperationMethod
public BusinessAdapter run(BusinessAdapter input) {
  DocumentModel document = input.getDocument();
  // TODO the code intends to copy to a new document with parentPath+name but it's buggy and does not do that
  // TODO currently we just create a placeless document with an random name
  // TODO use createDocumentModel instead of document to fix
  // createDocumentModel.copyContent(document);
  document = session.createDocument(document);
  return document.getAdapter(input.getClass());
}
origin: org.nuxeo.ecm.platform/nuxeo-rest-api-server

@PUT
@Path("{adapterName}")
@Consumes(MediaType.APPLICATION_JSON)
public Object doPostAdapter(@PathParam("adapterName") String adapterName, BusinessAdapter input) {
  ctx.getCoreSession().saveDocument(input.getDocument());
  ctx.getCoreSession().save();
  return new DefaultJsonAdapter(input);
}
origin: org.nuxeo.ecm.platform/nuxeo-rest-api-server

@POST
@Path("{adapterName}/{docName}")
public Object doPutAdapter(@PathParam("adapterName") String adapterName, @PathParam("docName") String docName,
    BusinessAdapter input) {
  DocumentModel document = input.getDocument();
  DocumentObject dobj = (DocumentObject) getTarget();
  DocumentModel parentDoc = dobj.getDocument();
  document.setPathInfo(parentDoc.getPathAsString(), docName);
  CoreSession session = ctx.getCoreSession();
  document = session.createDocument(document);
  session.save();
  BusinessAdapter adapter = document.getAdapter(input.getClass());
  return new DefaultJsonAdapter(adapter);
}
origin: org.nuxeo.ecm.automation/nuxeo-automation-io

  /**
   * When the object codec is called the stream is positioned on the first value. For inlined objects this is the
   * first value after the "entity-type" property. For non inlined objects this will be the object itself (i.e.
   * '{' or '[')
   *
   * @param jp
   * @return
   * @throws IOException
   */
  @Override
  public BusinessAdapter read(JsonParser jp, CoreSession session) throws IOException {
    if (jp.getCodec() == null) {
      jp.setCodec(new ObjectMapper());
    }
    BusinessAdapter fromBa = jp.readValueAs(type);
    DocumentModel doc = fromBa.getId() != null ? session.getDocument(new IdRef(fromBa.getId()))
        : DocumentModelFactory.createDocumentModel(fromBa.getType());
    BusinessAdapter ba = doc.getAdapter(fromBa.getClass());
    // And finally copy the fields sets from the adapter
    for (String schema : fromBa.getDocument().getSchemas()) {
      DataModel dataModel = ba.getDocument().getDataModel(schema);
      DataModel fromDataModel = fromBa.getDocument().getDataModel(schema);
      for (String field : fromDataModel.getDirtyFields()) {
        dataModel.setData(field, fromDataModel.getData(field));
      }
    }
    return ba;
  }
}
org.nuxeo.ecm.automation.core.operations.business.adapterBusinessAdaptergetDocument

Popular methods of BusinessAdapter

  • getId
  • getType

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • onCreateOptionsMenu (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now