本文整理汇总了Java中org.kuali.rice.kew.quicklinks.InitiatedDocumentType类的典型用法代码示例。如果您正苦于以下问题:Java InitiatedDocumentType类的具体用法?Java InitiatedDocumentType怎么用?Java InitiatedDocumentType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InitiatedDocumentType类属于org.kuali.rice.kew.quicklinks包,在下文中一共展示了InitiatedDocumentType类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInitiatedDocumentTypesList
import org.kuali.rice.kew.quicklinks.InitiatedDocumentType; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public List<InitiatedDocumentType> getInitiatedDocumentTypesList(final String principalId) {
String documentNames = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(KewApiConstants.KEW_NAMESPACE, KRADConstants.DetailTypes.QUICK_LINK_DETAIL_TYPE, KewApiConstants.QUICK_LINKS_RESTRICT_DOCUMENT_TYPES);
if (documentNames != null) {
documentNames = documentNames.trim();
}
if (documentNames == null || "none".equals(documentNames)) {
documentNames = "";
}
final StringTokenizer st = new StringTokenizer(documentNames, ",");
final List<String> docTypesToRestrict = new ArrayList<String>();
while (st.hasMoreTokens()) {
docTypesToRestrict.add(st.nextToken());
}
try {
final List<Object[]> list = getEntityManager().createNamedQuery(
"DocumentType.QuickLinks.FindInitiatedDocumentTypesListByInitiatorWorkflowId").
setParameter("initiatorWorkflowId", principalId).getResultList();
final List<InitiatedDocumentType> documentTypesByName = new ArrayList<InitiatedDocumentType>(list.size());
for (Object[] doc : list) {
final String docTypeName = (String) doc[0];
final String label = (String) doc[1];
final String docTypeTopParent;
final int firstPeriod = docTypeName.indexOf(".");
if (firstPeriod == -1) {
docTypeTopParent = docTypeName.substring(0);
} else {
docTypeTopParent = docTypeName.substring(0, firstPeriod);
}
if (!docTypesToRestrict.contains(docTypeTopParent)) {
// the document types should be cached so this should be pretty quick
final DocumentType docType = KEWServiceLocator.getDocumentTypeService().findByName(docTypeName);
final DocumentTypePolicy quickInitiatePolicy = docType.getSupportsQuickInitiatePolicy();
if (quickInitiatePolicy.getPolicyValue().booleanValue()) {
documentTypesByName.add(new InitiatedDocumentType(docTypeName, label));
}
}
}
return documentTypesByName;
} catch (Exception e) {
throw new WorkflowRuntimeException("Error getting initiated document types for user: " + principalId, e);
}
}
示例2: getInitiatedDocumentTypesList
import org.kuali.rice.kew.quicklinks.InitiatedDocumentType; //导入依赖的package包/类
@Override
public List<InitiatedDocumentType> getInitiatedDocumentTypesList(String principalId) {
return getQuickLinksDAO().getInitiatedDocumentTypesList(principalId);
}
示例3: getInitiatedDocumentTypesList
import org.kuali.rice.kew.quicklinks.InitiatedDocumentType; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public List<InitiatedDocumentType> getInitiatedDocumentTypesList(final String principalId) {
String documentNames = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(KewApiConstants.KEW_NAMESPACE, KRADConstants.DetailTypes.QUICK_LINK_DETAIL_TYPE, KewApiConstants.QUICK_LINKS_RESTRICT_DOCUMENT_TYPES);
if (documentNames != null) {
documentNames = documentNames.trim();
}
if (documentNames == null || "none".equals(documentNames)) {
documentNames = "";
}
final StringTokenizer st = new StringTokenizer(documentNames, ",");
final List<String> docTypesToRestrict = new ArrayList<String>();
while (st.hasMoreTokens()) {
docTypesToRestrict.add(st.nextToken());
}
try {
final List<Object[]> list = entityManager.createNamedQuery("DocumentType.QuickLinks.FindInitiatedDocumentTypesListByInitiatorWorkflowId").setParameter("initiatorWorkflowId", principalId).getResultList();
final List<InitiatedDocumentType> documentTypesByName = new ArrayList<InitiatedDocumentType>(list.size());
for (Object[] doc : list) {
final String docTypeName = (String) doc[0];
final String label = (String) doc[1];
final String docTypeTopParent;
final int firstPeriod = docTypeName.indexOf(".");
if (firstPeriod == -1) {
docTypeTopParent = docTypeName.substring(0);
} else {
docTypeTopParent = docTypeName.substring(0, firstPeriod);
}
if (!docTypesToRestrict.contains(docTypeTopParent)) {
// the document types should be cached so this should be pretty quick
final DocumentType docType = KEWServiceLocator.getDocumentTypeService().findByName(docTypeName);
final DocumentTypePolicy quickInitiatePolicy = docType.getSupportsQuickInitiatePolicy();
if (quickInitiatePolicy.getPolicyValue().booleanValue()) {
documentTypesByName.add(new InitiatedDocumentType(docTypeName, label));
}
}
}
return documentTypesByName;
} catch (Exception e) {
throw new WorkflowRuntimeException("Error getting initiated document types for user: " + principalId, e);
}
}
示例4: getInitiatedDocumentTypesList
import org.kuali.rice.kew.quicklinks.InitiatedDocumentType; //导入依赖的package包/类
public List<InitiatedDocumentType> getInitiatedDocumentTypesList(String principalId);