本文整理汇总了Java中org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue.setDocContent方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentRouteHeaderValue.setDocContent方法的具体用法?Java DocumentRouteHeaderValue.setDocContent怎么用?Java DocumentRouteHeaderValue.setDocContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue
的用法示例。
在下文中一共展示了DocumentRouteHeaderValue.setDocContent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupDocumentRouteHeaderValueWithRouteHeaderAssigned
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
protected DocumentRouteHeaderValue setupDocumentRouteHeaderValueWithRouteHeaderAssigned(String documentTypeId) {
DocumentRouteHeaderValue routeHeader = new DocumentRouteHeaderValue();
routeHeader.setDocumentId(KewDocumentTypeJpaTest.TEST_DOC_ID);
routeHeader.setAppDocId("Test");
routeHeader.setApprovedDate(null);
routeHeader.setCreateDate(new Timestamp(new Date().getTime()));
routeHeader.setDocContent("test");
routeHeader.setDocRouteLevel(1);
routeHeader.setDocRouteStatus(KewApiConstants.ROUTE_HEADER_ENROUTE_CD);
routeHeader.setDocTitle("Test");
routeHeader.setDocumentTypeId(documentTypeId);
routeHeader.setDocVersion(KewApiConstants.DocumentContentVersions.CURRENT);
routeHeader.setRouteStatusDate(new Timestamp(new Date().getTime()));
routeHeader.setDateModified(new Timestamp(new Date().getTime()));
routeHeader.setInitiatorWorkflowId("someone");
return getDataObjectService().save(routeHeader, PersistenceOption.FLUSH);
}
示例2: setupDocumentRouteHeaderValue
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
private DocumentRouteHeaderValue setupDocumentRouteHeaderValue() {
DocumentRouteHeaderValue routeHeader = new DocumentRouteHeaderValue();
routeHeader.setAppDocId("Test");
routeHeader.setApprovedDate(null);
routeHeader.setCreateDate(new Timestamp(new Date().getTime()));
routeHeader.setDocContent("test");
routeHeader.setDocRouteLevel(1);
routeHeader.setDocRouteStatus(KewApiConstants.ROUTE_HEADER_ENROUTE_CD);
routeHeader.setDocTitle("Test");
routeHeader.setDocumentTypeId("1");
routeHeader.setDocVersion(KewApiConstants.DocumentContentVersions.CURRENT);
routeHeader.setRouteStatusDate(new Timestamp(new Date().getTime()));
routeHeader.setDateModified(new Timestamp(new Date().getTime()));
routeHeader.setInitiatorWorkflowId("someone");
return KRADServiceLocator.getDataObjectService().save(routeHeader, PersistenceOption.FLUSH);
}
示例3: setupDocumentRouteHeaderValueWithRouteHeaderAssigned
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
private DocumentRouteHeaderValue setupDocumentRouteHeaderValueWithRouteHeaderAssigned() {
DocumentRouteHeaderValue routeHeader = new DocumentRouteHeaderValue();
routeHeader.setDocumentId(TEST_DOC_ID);
routeHeader.setAppDocId("Test");
routeHeader.setApprovedDate(null);
routeHeader.setCreateDate(new Timestamp(new Date().getTime()));
routeHeader.setDocContent("test");
routeHeader.setDocRouteLevel(1);
routeHeader.setDocRouteStatus(KewApiConstants.ROUTE_HEADER_ENROUTE_CD);
routeHeader.setDocTitle("Test");
routeHeader.setDocumentTypeId("1");
routeHeader.setDocVersion(KewApiConstants.DocumentContentVersions.CURRENT);
routeHeader.setRouteStatusDate(new Timestamp(new Date().getTime()));
routeHeader.setDateModified(new Timestamp(new Date().getTime()));
routeHeader.setInitiatorWorkflowId("someone");
return KRADServiceLocator.getDataObjectService().save(routeHeader);
}
示例4: generateDocRouteHeader
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
private DocumentRouteHeaderValue generateDocRouteHeader() {
DocumentRouteHeaderValue routeHeader = new DocumentRouteHeaderValue();
routeHeader.setAppDocId("Test");
routeHeader.setApprovedDate(null);
routeHeader.setCreateDate(new Timestamp(new Date().getTime()));
routeHeader.setDocContent("test");
routeHeader.setDocRouteLevel(1);
routeHeader.setDocRouteStatus(KewApiConstants.ROUTE_HEADER_ENROUTE_CD);
routeHeader.setDocTitle("Test");
routeHeader.setDocumentTypeId("1");
routeHeader.setDocVersion(KewApiConstants.DocumentContentVersions.CURRENT);
routeHeader.setRouteStatusDate(new Timestamp(new Date().getTime()));
routeHeader.setDateModified(new Timestamp(new Date().getTime()));
routeHeader.setInitiatorWorkflowId("someone");
return routeHeader;
}
示例5: createDocument
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
public DocumentRouteHeaderValue createDocument(String principalId, DocumentRouteHeaderValue routeHeader) throws WorkflowException {
if (routeHeader.getDocumentId() != null) { // this is a debateable
// check - means the
// client is off
throw new InvalidActionTakenException("Document already has a Document id");
}
Principal principal = loadPrincipal(principalId);
boolean canInitiate = KEWServiceLocator.getDocumentTypePermissionService().canInitiate(principalId, routeHeader.getDocumentType());
if (!canInitiate) {
throw new InvalidActionTakenException("Principal with name '" + principal.getPrincipalName() + "' is not authorized to initiate documents of type '" + routeHeader.getDocumentType().getName());
}
if (!routeHeader.getDocumentType().isDocTypeActive()) {
// don't allow creation if document type is inactive
throw new IllegalDocumentTypeException("Document type '" + routeHeader.getDocumentType().getName() + "' is inactive");
}
routeHeader.setInitiatorWorkflowId(principalId);
if (routeHeader.getDocRouteStatus() == null) {
routeHeader.setDocRouteStatus(KewApiConstants.ROUTE_HEADER_INITIATED_CD);
}
if (routeHeader.getDocRouteLevel() == null) {
routeHeader.setDocRouteLevel(Integer.valueOf(KewApiConstants.ADHOC_ROUTE_LEVEL));
}
if (routeHeader.getCreateDate() == null) {
routeHeader.setCreateDate(new Timestamp(new Date().getTime()));
}
if (routeHeader.getDocVersion() == null) {
routeHeader.setDocVersion(Integer.valueOf(KewApiConstants.DocumentContentVersions.CURRENT));
}
if (routeHeader.getDocContent() == null) {
routeHeader.setDocContent(KewApiConstants.DEFAULT_DOCUMENT_CONTENT);
}
routeHeader.setDateModified(new Timestamp(new Date().getTime()));
routeHeader = KEWServiceLocator.getRouteHeaderService().saveRouteHeader(routeHeader);
OrchestrationConfig config = new OrchestrationConfig(EngineCapability.STANDARD);
KEWServiceLocator.getWorkflowEngineFactory().newEngine(config).initializeDocument(routeHeader);
routeHeader = KEWServiceLocator.getRouteHeaderService().saveRouteHeader(routeHeader);
return routeHeader;
}
示例6: init
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
protected DocumentRouteHeaderValue init(DocumentActionParameters parameters) {
String documentId = parameters.getDocumentId();
String principalId = parameters.getPrincipalId();
DocumentUpdate documentUpdate = parameters.getDocumentUpdate();
DocumentContentUpdate documentContentUpdate = parameters.getDocumentContentUpdate();
incomingParamCheck(documentId, "documentId");
incomingParamCheck(principalId, "principalId");
if (LOG.isDebugEnabled()) {
LOG.debug("Initializing Document from incoming documentId: " + documentId);
}
KEWServiceLocator.getRouteHeaderService().lockRouteHeader(documentId);
DocumentRouteHeaderValue document = KEWServiceLocator.getRouteHeaderService().getRouteHeader(documentId);
if (document == null) {
throw new RiceIllegalArgumentException("Failed to locate a document for document id: " + documentId);
}
boolean modified = false;
if (documentUpdate != null) {
document.applyDocumentUpdate(documentUpdate);
modified = true;
}
if (documentContentUpdate != null) {
String newDocumentContent = DTOConverter.buildUpdatedDocumentContent(document.getDocContent(),
documentContentUpdate, document.getDocumentTypeName());
document.setDocContent(newDocumentContent);
modified = true;
}
if (modified) {
document = KEWServiceLocator.getRouteHeaderService().saveRouteHeader(document);
/*
* Branch data is not persisted when we call saveRouteHeader so we must Explicitly
* save the branch. Noticed issue in: KULRICE-4074 when the future action request info,
* which is stored in the branch, was not being persisted.
*
* The call to setRouteHeaderData will ensure that the variable data is in the branch, but we have
* to persist the route header before we can save the branch info.
*
* Placing here to minimize system impact. We should investigate placing this logic into
* saveRouteHeader... but at that point we should just turn auto-update = true on the branch relationship
*
*/
this.saveRouteNodeInstances(document);
}
return document;
}
示例7: create
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
@Override
public Document create(String documentTypeName,
String initiatorPrincipalId, DocumentUpdate documentUpdate,
DocumentContentUpdate documentContentUpdate)
throws RiceIllegalArgumentException, IllegalDocumentTypeException, InvalidActionTakenException {
incomingParamCheck(documentTypeName, "documentTypeName");
incomingParamCheck(initiatorPrincipalId, "initiatorPrincipalId");
if (LOG.isDebugEnabled()) {
LOG.debug("Create Document [documentTypeName=" + documentTypeName + ", initiatorPrincipalId="
+ initiatorPrincipalId + "]");
}
String documentTypeId = documentTypeService.getIdByName(documentTypeName);
if (documentTypeId == null) {
throw new RiceIllegalArgumentException("Failed to locate a document type with the given name: "
+ documentTypeName);
}
DocumentRouteHeaderValue documentBo = new DocumentRouteHeaderValue();
documentBo.setDocumentTypeId(documentTypeId);
documentBo.setInitiatorWorkflowId(initiatorPrincipalId);
if (documentUpdate != null) {
documentBo.setDocTitle(documentUpdate.getTitle());
documentBo.setAppDocId(documentUpdate.getApplicationDocumentId());
}
if (documentContentUpdate != null) {
String newDocumentContent = DTOConverter.buildUpdatedDocumentContent(null, documentContentUpdate,
documentTypeName);
documentBo.setDocContent(newDocumentContent);
}
try {
documentBo = KEWServiceLocator.getWorkflowDocumentService()
.createDocument(initiatorPrincipalId, documentBo);
} catch (WorkflowException e) {
// TODO remove this once we stop throwing WorkflowException everywhere!
translateException(e);
}
return DocumentRouteHeaderValue.to(documentBo);
}