本文整理汇总了Java中org.kuali.rice.kew.xml.DocumentTypeXmlParser类的典型用法代码示例。如果您正苦于以下问题:Java DocumentTypeXmlParser类的具体用法?Java DocumentTypeXmlParser怎么用?Java DocumentTypeXmlParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DocumentTypeXmlParser类属于org.kuali.rice.kew.xml包,在下文中一共展示了DocumentTypeXmlParser类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadXml
import org.kuali.rice.kew.xml.DocumentTypeXmlParser; //导入依赖的package包/类
public void loadXml(InputStream inputStream, String principalId) {
DocumentTypeXmlParser parser = new DocumentTypeXmlParser();
try {
parser.parseDocumentTypes(inputStream);
} catch (Exception e) {
WorkflowServiceErrorException wsee = new WorkflowServiceErrorException("Error parsing documentType XML file", new WorkflowServiceErrorImpl("Error parsing documentType XML file", XML_FILE_PARSE_ERROR));
wsee.initCause(e);
throw wsee;
}
}
示例2: saveBusinessObject
import org.kuali.rice.kew.xml.DocumentTypeXmlParser; //导入依赖的package包/类
/**
* This is a complete override which does not call into
* {@link KualiMaintainableImpl}. This method calls
* {@link DocumentTypeService#versionAndSave(DocumentType)}.
*
*/
@Override
public void saveBusinessObject() {
DocumentTypeService docTypeService = KEWServiceLocator.getDocumentTypeService();
DocumentType newDocumentType = (DocumentType) getBusinessObject();
String documentTypeName = newDocumentType.getName();
DocumentType docTypeFromDatabase = docTypeService.findByName(documentTypeName);
if (docTypeFromDatabase == null) {
docTypeService.versionAndSave(newDocumentType);
}
else {
Boolean applyRetroactively = newDocumentType.getApplyRetroactively();
DocumentType newDocumentTypeFromDatabase;
DocumentTypeXmlParser parser = new DocumentTypeXmlParser();
try {
newDocumentTypeFromDatabase = parser.generateNewDocumentTypeFromExisting(documentTypeName);
} catch (Exception e) {
throw new WorkflowRuntimeException("Error while attempting to generate new document type from existing " +
"database document type with name '" + documentTypeName + "'", e);
}
newDocumentTypeFromDatabase.populateDataDictionaryEditableFields(constructUserInterfaceEditablePropertyNamesList(), newDocumentType);
docTypeService.versionAndSave(newDocumentTypeFromDatabase);
if (KRADUtils.isNotNull(applyRetroactively) && applyRetroactively.booleanValue()) {
// save all previous instances of document type with the same name
// fields: label, description, unresolvedHelpDefinitionUrl
List<DocumentType> previousDocTypeInstances = docTypeService.findPreviousInstances(documentTypeName);
for (DocumentType prevDocType : previousDocTypeInstances) {
// set up fields
prevDocType.setLabel(newDocumentType.getLabel());
prevDocType.setDescription(newDocumentType.getDescription());
prevDocType.setUnresolvedHelpDefinitionUrl(newDocumentType.getUnresolvedHelpDefinitionUrl());
prevDocType.setUnresolvedDocSearchHelpUrl(newDocumentType.getUnresolvedDocSearchHelpUrl());
docTypeService.save(prevDocType);
}
// save all former/current action items matching document type name
// fields: docLabel
ActionListService actionListService = KEWServiceLocator.getActionListService();
Collection<ActionItem> items = actionListService.findByDocumentTypeName(documentTypeName);
for (ActionItem actionItem : items) {
actionItem.setDocLabel(newDocumentType.getLabel());
actionListService.saveActionItem(actionItem);
}
// save all former/current outbox action items matching document type name
// fields: docLabel
Collection<OutboxItem> outboxItems = actionListService.getOutboxItemsByDocumentType(documentTypeName);
for (OutboxItem outboxItem : outboxItems) {
outboxItem.setDocLabel(newDocumentType.getLabel());
actionListService.saveOutboxItem(outboxItem);
}
}
}
}
示例3: saveBusinessObject
import org.kuali.rice.kew.xml.DocumentTypeXmlParser; //导入依赖的package包/类
/**
* This is a complete override which does not call into
* {@link KualiMaintainableImpl}. This method calls
* {@link DocumentTypeService#versionAndSave(DocumentType)}.
*
*/
@Override
public void saveBusinessObject() {
DocumentTypeService docTypeService = KEWServiceLocator.getDocumentTypeService();
DocumentType newDocumentType = (DocumentType) getBusinessObject();
String documentTypeName = newDocumentType.getName();
DocumentType docTypeFromDatabase = docTypeService.findByName(documentTypeName);
if (ObjectUtils.isNull(docTypeFromDatabase)) {
docTypeService.versionAndSave(newDocumentType);
}
else {
Boolean applyRetroactively = newDocumentType.getApplyRetroactively();
DocumentType newDocumentTypeFromDatabase;
DocumentTypeXmlParser parser = new DocumentTypeXmlParser();
try {
newDocumentTypeFromDatabase = parser.generateNewDocumentTypeFromExisting(documentTypeName);
} catch (Exception e) {
throw new WorkflowRuntimeException("Error while attempting to generate new document type from existing " +
"database document type with name '" + documentTypeName + "'", e);
}
newDocumentTypeFromDatabase.populateDataDictionaryEditableFields(constructUserInterfaceEditablePropertyNamesList(), newDocumentType);
docTypeService.versionAndSave(newDocumentTypeFromDatabase);
if (ObjectUtils.isNotNull(applyRetroactively) && applyRetroactively.booleanValue()) {
// save all previous instances of document type with the same name
// fields: label, description, unresolvedHelpDefinitionUrl
List<DocumentType> previousDocTypeInstances = docTypeService.findPreviousInstances(documentTypeName);
for (DocumentType prevDocType : previousDocTypeInstances) {
// set up fields
prevDocType.setLabel(newDocumentType.getLabel());
prevDocType.setDescription(newDocumentType.getDescription());
prevDocType.setUnresolvedHelpDefinitionUrl(newDocumentType.getUnresolvedHelpDefinitionUrl());
prevDocType.setUnresolvedDocSearchHelpUrl(newDocumentType.getUnresolvedDocSearchHelpUrl());
docTypeService.save(prevDocType);
}
// save all former/current action items matching document type name
// fields: docLabel
ActionListService actionListService = KEWServiceLocator.getActionListService();
Collection<ActionItem> items = actionListService.findByDocumentTypeName(documentTypeName);
for (ActionItem actionItem : items) {
actionItem.setDocLabel(newDocumentType.getLabel());
actionListService.saveActionItem(actionItem);
}
// save all former/current outbox action items matching document type name
// fields: docLabel
Collection<OutboxItemActionListExtension> outboxItems = actionListService.getOutboxItemsByDocumentType(documentTypeName);
for (ActionItem outboxItem : outboxItems) {
outboxItem.setDocLabel(newDocumentType.getLabel());
actionListService.saveActionItem(outboxItem);
}
}
}
}