org.jbpm.document.Document.setLink()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.jbpm.document.Document.setLink()方法的一些代码示例,展示了Document.setLink()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.setLink()方法的具体详情如下:
包路径:org.jbpm.document.Document
类名称:Document
方法名:setLink

Document.setLink介绍

暂无

代码示例

代码示例来源:origin: kiegroup/jbpm

@SuppressWarnings({"resource", "unused"})
@Override
public Object unmarshal(Context context, ObjectInputStream objectInputStream, byte[] object, ClassLoader classLoader) throws IOException, ClassNotFoundException {
  DroolsObjectInputStream is = new DroolsObjectInputStream(new ByteArrayInputStream(object), classLoader);
  // first we read out the object id and class name we stored during marshaling
  String objectId = is.readUTF();
  String canonicalName = is.readUTF();
  String link = is.readUTF();
  Document storedDoc = null;
  try {            
    storedDoc = documentStorageService.getDocument(objectId);            
    storedDoc.setLink( link );
    // when loaded, mark it as not updated to avoid not needed marshalling
    storedDoc.addAttribute(Document.UPDATED_ATTRIBUTE, "false");
  } catch (Exception e) {
    throw new RuntimeException("Cannot read document from storage service", e);
  }
  return storedDoc;
}

代码示例来源:origin: kiegroup/jbpm

private Document getDocument(String documentName) {
  Document documentOne = new DocumentImpl();
  documentOne.setIdentifier(documentName);
  documentOne.setLastModified(new Date());
  documentOne.setLink("http://" +  documentName);
  documentOne.setName(documentName + " Name");
  documentOne.setSize(1);
  documentOne.setContent(documentName.getBytes());
  return documentOne;
}

代码示例来源:origin: org.jbpm/jbpm-wb-forms-backend

protected Map<String, Object> processData(DocumentServicesClient documentClient,
                     Map<String, Object> data) {
  if (data == null || data.isEmpty()) {
    return data;
  }
  for (Map.Entry<String, Object> entry : data.entrySet()) {
    if (entry.getValue() instanceof Document) {
      Document document = ((Document) entry.getValue());
      document.setLink(documentClient.getDocumentLink(document.getIdentifier()));
    }
  }
  return data;
}

代码示例来源:origin: org.jbpm/jbpm-console-ng-generic-forms-backend

protected Map<String, Object> processData( DocumentServicesClient documentClient, Map<String, Object> data ) {
  if ( data == null || data.isEmpty() ) {
    return data;
  }
  for ( Map.Entry<String, Object> entry : data.entrySet() ) {
    if ( entry.getValue() instanceof Document ) {
      Document document = ( (Document) entry.getValue() );
      document.setLink( documentClient.getDocumentLink( document.getIdentifier() ) );
    }
  }
  return data;
}

代码示例来源:origin: kiegroup/jbpm-wb

protected Map<String, Object> processData(DocumentServicesClient documentClient,
                     Map<String, Object> data) {
  if (data == null || data.isEmpty()) {
    return data;
  }
  for (Map.Entry<String, Object> entry : data.entrySet()) {
    if (entry.getValue() instanceof Document) {
      Document document = ((Document) entry.getValue());
      document.setLink(documentClient.getDocumentLink(document.getIdentifier()));
    }
  }
  return data;
}

代码示例来源:origin: org.jbpm/jbpm-console-ng-documents-backend

@Override
public Object read(ObjectInputStream os) throws IOException,
    ClassNotFoundException {
  String objectId = os.readUTF();
  String canonicalName = os.readUTF();
  String link = os.readUTF();
  try {
    DocumentSummary doc = (DocumentSummary)this.documentService.getDocument(objectId);
    Document document = (Document) Class.forName(canonicalName).newInstance();
    document.setIdentifier(objectId);
    document.setLink(link);
    document.setName(doc.getName());
    document.setSize(10);
    document.setLastModified(new Date());
    document.setAttributes(new HashMap<String, String>());
    document.setContent(doc.getContent());
    return document;
  } catch(Exception e) {
    throw new RuntimeException("Cannot read document", e);
  }
}

代码示例来源:origin: org.jbpm/jbpm-document

@SuppressWarnings({"resource", "unused"})
@Override
public Object unmarshal(Context context, ObjectInputStream objectInputStream, byte[] object, ClassLoader classLoader) throws IOException, ClassNotFoundException {
  DroolsObjectInputStream is = new DroolsObjectInputStream(new ByteArrayInputStream(object), classLoader);
  // first we read out the object id and class name we stored during marshaling
  String objectId = is.readUTF();
  String canonicalName = is.readUTF();
  String link = is.readUTF();
  Document storedDoc = null;
  try {            
    storedDoc = documentStorageService.getDocument(objectId);            
    storedDoc.setLink( link );
    // when loaded, mark it as not updated to avoid not needed marshalling
    storedDoc.addAttribute(Document.UPDATED_ATTRIBUTE, "false");
  } catch (Exception e) {
    throw new RuntimeException("Cannot read document from storage service", e);
  }
  return storedDoc;
}

代码示例来源:origin: org.jbpm/jbpm-console-ng-documents-backend

@Override
public Object unmarshal(Context context,
    ObjectInputStream objectInputStream, byte[] object,
    ClassLoader classLoader) throws IOException, ClassNotFoundException {
  DroolsObjectInputStream is = new DroolsObjectInputStream(
      new ByteArrayInputStream(object), classLoader);
  // first we read out the object id and class name we stored during
  // marshaling
  String objectId = is.readUTF();
  String canonicalName = is.readUTF();
  String link = is.readUTF();
  Document document = null;
  try {
    document = (Document) Class.forName(canonicalName).newInstance();
    DocumentSummary storedDoc = (DocumentSummary)this.documentService.getDocument(objectId);
    document.setIdentifier(storedDoc.getId());
    document.setName(storedDoc.getName());
    document.setLink(link);
    document.setLastModified(new Date());
    document.setSize(10);
    document.setAttributes(new HashMap<String, String>());
    InputStream stream = this.documentService.getDocumentContent(objectId);
    byte[] content = IOUtils.toByteArray(stream);
    document.setContent(content);
  } catch (Exception e) {
    throw new RuntimeException(
        "Cannot read document from storage service", e);
  }
  return document;
}

代码示例来源:origin: org.jbpm/jbpm-document

private Document getDocument(String documentName) {
  Document documentOne = new DocumentImpl();
  documentOne.setIdentifier(documentName);
  documentOne.setLastModified(new Date());
  documentOne.setLink("http://" +  documentName);
  documentOne.setName(documentName + " Name");
  documentOne.setSize(1);
  documentOne.setContent(documentName.getBytes());
  return documentOne;
}

代码示例来源:origin: mswiderski/jbpm-examples

document.addAttribute("type", stream.getMimeType());				
} else {
  document.setLink(contentUrl + document.getIdentifier());

相关文章