permissionDetails = new HashMap();
permissionDetails.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME,
documentTypeName);
return getPermissionService().isAuthorizedByTemplateName(
user.getPrincipalId(), nameSpaceCode,
KimConstants.PermissionTemplateNames.INITIATE_DOCUMENT,
permissionDetails, Collections.emptyMap());
}
public final boolean canReceiveAdHoc(Document document, Person user,
String actionRequestCode) {
Map additionalPermissionDetails = new HashMap();
additionalPermissionDetails.put(KimConstants.AttributeConstants.ACTION_REQUEST_CD, actionRequestCode);
return isAuthorizedByTemplate(document,
KRADConstants.KUALI_RICE_WORKFLOW_NAMESPACE,
KimConstants.PermissionTemplateNames.AD_HOC_REVIEW_DOCUMENT,
user.getPrincipalId(), additionalPermissionDetails, null );
]]>
model)
throws IllegalArgumentException, ErrorList {
ErrorList errors = new ErrorList();
Notification notification = new Notification();
// grab data from form
// channel name
String channelName = request.getParameter("channelName");
if (StringUtils.isEmpty(channelName) || StringUtils.equals(channelName, NONE_CHANNEL)) {
errors.addError("You must choose a channel.");
} else {
model.put("channelName", channelName);
}
// priority name
String priorityName = request.getParameter("priorityName");
if (StringUtils.isEmpty(priorityName)) {
errors.addError("You must choose a priority.");
} else {
model.put("priorityName", priorityName);
}
// sender names
String senderNames = request.getParameter("senderNames");
String[] senders = null;
if (StringUtils.isEmpty(senderNames)) {
errors.addError("You must enter at least one sender.");
} else {
senders = StringUtils.split(senderNames, ",");
model.put("senderNames", senderNames);
}
// delivery type
String deliveryType = request.getParameter("deliveryType");
if (StringUtils.isEmpty(deliveryType)) {
errors.addError("You must choose a type.");
} else {
if (deliveryType
.equalsIgnoreCase(NotificationConstants.DELIVERY_TYPES.FYI)) {
deliveryType = NotificationConstants.DELIVERY_TYPES.FYI;
} else {
deliveryType = NotificationConstants.DELIVERY_TYPES.ACK;
}
model.put("deliveryType", deliveryType);
}
// get datetime when form was initially rendered
String originalDateTime = request.getParameter("originalDateTime");
Date origdate = null;
Date senddate = null;
Date removedate = null;
try {
origdate = Util.parseUIDateTime(originalDateTime);
} catch (ParseException pe) {
errors.addError("Original date is invalid.");
}
// send date time
String sendDateTime = request.getParameter("sendDateTime");
if (StringUtils.isBlank(sendDateTime)) {
sendDateTime = Util.getCurrentDateTime();
}
try {
senddate = Util.parseUIDateTime(sendDateTime);
} catch (ParseException pe) {
errors.addError("You specified an invalid Send Date/Time. Please use the calendar picker.");
}
if (senddate != null && senddate.before(origdate)) {
errors.addError("Send Date/Time cannot be in the past.");
}
model.put("sendDateTime", sendDateTime);
// auto remove date time
String autoRemoveDateTime = request.getParameter("autoRemoveDateTime");
if (StringUtils.isNotBlank(autoRemoveDateTime)) {
try {
removedate = Util.parseUIDateTime(autoRemoveDateTime);
} catch (ParseException pe) {
errors.addError("You specified an invalid Auto-Remove Date/Time. Please use the calendar picker.");
}
if (removedate != null) {
if (removedate.before(origdate)) {
errors.addError("Auto-Remove Date/Time cannot be in the past.");
} else if (senddate != null && removedate.before(senddate)) {
errors.addError("Auto-Remove Date/Time cannot be before the Send Date/Time.");
}
}
}
model.put("autoRemoveDateTime", autoRemoveDateTime);
// user recipient names
String[] userRecipients = parseUserRecipients(request);
// workgroup recipient names
String[] workgroupRecipients = parseWorkgroupRecipients(request);
// workgroup namespace codes
String[] workgroupNamespaceCodes = parseWorkgroupNamespaceCodes(request);
// title
String title = request.getParameter("title");
if (!StringUtils.isEmpty(title)) {
model.put("title", title);
} else {
errors.addError("You must fill in a title");
}
// message
String message = request.getParameter("message");
if (StringUtils.isEmpty(message)) {
errors.addError("You must fill in a message.");
} else {
model.put("message", message);
}
]]>
primaryKeys = new HashMap(4);
primaryKeys.put(SESSION_ID, sessionId);
if (documentNumber != null) {
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
}
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
SessionDocument sessionDoc = getBusinessObjectService().findByPrimaryKey(SessionDocument.class, primaryKeys);
if (sessionDoc != null) {
byte[] formAsBytes = sessionDoc.getSerializedDocumentForm();
if (sessionDoc.isEncrypted()) {
formAsBytes = getEncryptionService().decryptBytes(formAsBytes);
}
ByteArrayInputStream baip = new ByteArrayInputStream(formAsBytes);
ObjectInputStream ois = new ObjectInputStream(baip);
return ois.readObject();
}
return null;
}
@Override
public WorkflowDocument getDocumentFromSession(UserSession userSession, String docId) {
@SuppressWarnings("unchecked") Map workflowDocMap =
(Map) userSession
.retrieveObject(KEWConstants.WORKFLOW_DOCUMENT_MAP_ATTR_NAME);
if (workflowDocMap == null) {
workflowDocMap = new HashMap();
userSession.addObject(KEWConstants.WORKFLOW_DOCUMENT_MAP_ATTR_NAME, workflowDocMap);
return null;
}
return workflowDocMap.get(docId);
}
/**
* @see org.kuali.rice.krad.service.SessionDocumentService#addDocumentToUserSession(org.kuali.rice.krad.UserSession,
* org.kuali.rice.krad.workflow.service.KualiWorkflowDocument)
*/
@Override
public void addDocumentToUserSession(UserSession userSession, WorkflowDocument document) {
@SuppressWarnings("unchecked") Map workflowDocMap =
(Map) userSession
.retrieveObject(KEWConstants.WORKFLOW_DOCUMENT_MAP_ATTR_NAME);
if (workflowDocMap == null) {
workflowDocMap = new HashMap();
}
workflowDocMap.put(document.getDocumentId(), document);
userSession.addObject(KEWConstants.WORKFLOW_DOCUMENT_MAP_ATTR_NAME, workflowDocMap);
}
/**
* @see org.kuali.rice.krad.service.SessionDocumentService#purgeDocumentForm(String
* documentNumber, String docFormKey, UserSession userSession)
*/
@Override
public void purgeDocumentForm(String documentNumber, String docFormKey, UserSession userSession, String ipAddress) {
synchronized (userSession) {
LOG.debug("purge document form from session");
userSession.removeObject(docFormKey);
try {
LOG.debug("purge document form from database");
HashMap primaryKeys = new HashMap(4);
primaryKeys.put(SESSION_ID, userSession.getKualiSessionId());
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
getBusinessObjectService().deleteMatching(SessionDocument.class, primaryKeys);
} catch (Exception e) {
LOG.error("purgeDocumentForm failed for SessId/DocNum/PrinId/IP:" + userSession.getKualiSessionId() +
"/" + documentNumber + "/" + userSession.getPrincipalId() + "/" + ipAddress, e);
}
}
}
@Override
public void setDocumentForm(DocumentFormBase form, UserSession userSession, String ipAddress) {
]]>
propertyTypes = new HashMap();
boolean hasReturnableRow = false;
List returnKeys = getReturnKeys();
List pkNames = getBusinessObjectMetaDataService().listPrimaryKeyFieldNames(getBusinessObjectClass());
Person user = GlobalVariables.getUserSession().getPerson();
// iterate through result list and wrap rows with return url and action urls
for (Iterator iter = displayList.iterator(); iter.hasNext();) {
BusinessObject element = (BusinessObject) iter.next();
if(element instanceof PersistableBusinessObject){
lookupForm.setLookupObjectId(((PersistableBusinessObject)element).getObjectId());
}
BusinessObjectRestrictions businessObjectRestrictions = getBusinessObjectAuthorizationService().getLookupResultRestrictions(element, user);
HtmlData returnUrl = getReturnUrl(element, lookupForm, returnKeys, businessObjectRestrictions);
String actionUrls = getActionUrls(element, pkNames, businessObjectRestrictions);
//Fix for JIRA - KFSMI-2417
if("".equals(actionUrls)){
actionUrls = ACTION_URLS_EMPTY;
}
]]>
getAttributes() {
return attributes;
}
public void setAttributes(Map attributes) {
this.attributes = Collections.unmodifiableMap(Maps.newHashMap(attributes));
}
@Override
public Responsibility build() {
]]>
getRoleMembers(IdentityManagementRoleDocument identityManagementRoleDocument, List origRoleMembers){
List roleMembers = new ArrayList();
RoleMemberBo newRoleMember;
RoleMemberBo origRoleMemberImplTemp;
List origAttributes;
boolean activatingInactive = false;
String newRoleMemberIdAssigned = "";
identityManagementRoleDocument.setKimType(KimApiServiceLocator.getKimTypeInfoService().getKimType(identityManagementRoleDocument.getRoleTypeId()));
KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(identityManagementRoleDocument.getKimType());
if(CollectionUtils.isNotEmpty(identityManagementRoleDocument.getMembers())){
for(KimDocumentRoleMember documentRoleMember: identityManagementRoleDocument.getMembers()){
origRoleMemberImplTemp = null;
newRoleMember = new RoleMemberBo();
KimCommonUtilsInternal.copyProperties(newRoleMember, documentRoleMember);
newRoleMember.setRoleId(identityManagementRoleDocument.getRoleId());
if(ObjectUtils.isNotNull(origRoleMembers)){
for(RoleMemberBo origRoleMemberImpl: origRoleMembers){
if((origRoleMemberImpl.getRoleId()!=null && StringUtils.equals(origRoleMemberImpl.getRoleId(), newRoleMember.getRoleId())) &&
(origRoleMemberImpl.getMemberId()!=null && StringUtils.equals(origRoleMemberImpl.getMemberId(), newRoleMember.getMemberId())) &&
(origRoleMemberImpl.getMemberTypeCode()!=null && StringUtils.equals(origRoleMemberImpl.getMemberTypeCode(), newRoleMember.getMemberTypeCode())) &&
!origRoleMemberImpl.isActive(new Timestamp(System.currentTimeMillis())) &&
!kimTypeService.validateAttributesAgainstExisting(identityManagementRoleDocument.getKimType().getId(),
documentRoleMember.getQualifierAsMap(), origRoleMemberImpl.getAttributes()).isEmpty()) {
//TODO: verify if you want to add && newRoleMember.isActive() condition to if...
newRoleMemberIdAssigned = newRoleMember.getRoleMemberId();
newRoleMember.setRoleMemberId(origRoleMemberImpl.getRoleMemberId());
activatingInactive = true;
}
if(origRoleMemberImpl.getRoleMemberId()!=null && StringUtils.equals(origRoleMemberImpl.getRoleMemberId(), newRoleMember.getRoleMemberId())){
newRoleMember.setVersionNumber(origRoleMemberImpl.getVersionNumber());
origRoleMemberImplTemp = origRoleMemberImpl;
}
}
}
origAttributes = (origRoleMemberImplTemp==null || origRoleMemberImplTemp.getAttributes()==null)?
new ArrayList():origRoleMemberImplTemp.getAttributeDetails();
newRoleMember.setActiveFromDateValue(documentRoleMember.getActiveFromDate());
newRoleMember.setActiveToDateValue(documentRoleMember.getActiveToDate());
newRoleMember.setAttributeDetails(getRoleMemberAttributeData(documentRoleMember.getQualifiers(), origAttributes, activatingInactive, newRoleMemberIdAssigned));
newRoleMember.setRoleRspActions(getRoleMemberResponsibilityActions(documentRoleMember, origRoleMemberImplTemp, activatingInactive, newRoleMemberIdAssigned));
roleMembers.add(newRoleMember);
activatingInactive = false;
}
}
return roleMembers;
}
]]>
loadAffiliations(List affiliations, List empInfos) {
List docAffiliations = new ArrayList();
if(ObjectUtils.isNotNull(affiliations)){
for (EntityAffiliation affiliation: affiliations) {
if(affiliation.isActive()){
PersonDocumentAffiliation docAffiliation = new PersonDocumentAffiliation();
docAffiliation.setAffiliationTypeCode(affiliation.getAffiliationType().getCode());
docAffiliation.setCampusCode(affiliation.getCampusCode());
docAffiliation.setActive(affiliation.isActive());
docAffiliation.setDflt(affiliation.isDefaultValue());
docAffiliation.setEntityAffiliationId(affiliation.getId());
docAffiliation.refreshReferenceObject("affiliationType");
// EntityAffiliationImpl does not define empinfos as collection
docAffiliations.add(docAffiliation);
docAffiliation.setEdit(true);
// employment informations
List docEmploymentInformations = new ArrayList();
if(ObjectUtils.isNotNull(empInfos)){
for (EntityEmployment empInfo: empInfos) {
if (empInfo.isActive()
&& StringUtils.equals(docAffiliation.getEntityAffiliationId(),
(empInfo.getEntityAffiliation() != null ? empInfo.getEntityAffiliation().getId() : null))) {
PersonDocumentEmploymentInfo docEmpInfo = new PersonDocumentEmploymentInfo();
docEmpInfo.setEntityEmploymentId(empInfo.getEmployeeId());
docEmpInfo.setEmployeeId(empInfo.getEmployeeId());
docEmpInfo.setEmploymentRecordId(empInfo.getEmploymentRecordId());
docEmpInfo.setBaseSalaryAmount(empInfo.getBaseSalaryAmount());
docEmpInfo.setPrimaryDepartmentCode(empInfo.getPrimaryDepartmentCode());
docEmpInfo.setEmploymentStatusCode(empInfo.getEmployeeStatus() != null ? empInfo.getEmployeeStatus().getCode() : null);
docEmpInfo.setEmploymentTypeCode(empInfo.getEmployeeType() != null ? empInfo.getEmployeeType().getCode() : null);
docEmpInfo.setActive(empInfo.isActive());
docEmpInfo.setPrimary(empInfo.isPrimary());
docEmpInfo.setEntityAffiliationId(empInfo.getEntityAffiliation() != null ? empInfo.getEntityAffiliation().getId() : null);
// there is no version number on KimEntityEmploymentInformationInfo
//docEmpInfo.setVersionNumber(empInfo.getVersionNumber());
docEmpInfo.setEdit(true);
docEmpInfo.refreshReferenceObject("employmentType");
docEmploymentInformations.add(docEmpInfo);
}
}
}
docAffiliation.setEmpInfos(docEmploymentInformations);
}
}
}
return docAffiliations;
}
protected List loadNames( IdentityManagementPersonDocument personDoc, String principalId, List names, boolean suppressDisplay ) {
]]>
();
for (RuleTemplateAttribute ruleTemplateAttribute : ruleTemplate.getActiveRuleTemplateAttributes()) {
/*WorkflowRuleAttribute attribute = (WorkflowRuleAttribute)GlobalResourceLoader.getObject(new ObjectDefinition(ruleTemplateAttribute.getRuleAttribute().getResourceDescriptor(), ruleTemplateAttribute.getRuleAttribute().getApplicationId()));//SpringServiceLocator.getExtensionService().getWorkflowAttribute(ruleTemplateAttribute.getRuleAttribute().getClassName());
RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
ExtensionDefinition extensionDefinition = RuleAttribute.to(ruleAttribute);
if (ruleAttribute.getType().equals(KEWConstants.RULE_XML_ATTRIBUTE_TYPE)) {
((GenericXMLRuleAttribute) attribute).setExtensionDefinition(extensionDefinition);
}
attribute.setRequired(false);*/
List searchRows = null;
String curExtId = "0";//debugging for EN-1682
String attributeName = ruleTemplateAttribute.getRuleAttribute().getName();
WorkflowRuleAttributeHandlerService wrahs = KewFrameworkServiceLocator.getWorkflowRuleAttributeHandlerService();
ValidationResults validationResults = wrahs.validateRuleData(attributeName, fieldValues);
for (Map.Entry entry : validationResults.getErrors().entrySet()) {
GlobalVariables.getMessageMap().putError(entry.getValue(), RiceKeyConstants.ERROR_CUSTOM, entry.getKey());
}
//Validate extension data
Map curExts = ruleTemplateAttribute.getRuleExtensionMap();
ValidationResults extensionValidationResults = wrahs.validateRuleData(attributeName, curExts);
if (!extensionValidationResults.getErrors().isEmpty()) {
for (Map.Entry entry : extensionValidationResults.getErrors().entrySet()) {
LOG.warn("Exception caught attempting to validate attribute data for extension id:" + entry.getKey() + ". Reason: " + entry.getValue());
}
}
searchRows = wrahs.getSearchRows(attributeName);
for (RemotableAttributeField field : searchRows) {
if (fieldValues.get(field.getName()) != null) {
String attributeParam = fieldValues.get(field.getName());
if (StringUtils.isNotBlank(attributeParam)) {
attributes.put(field.getName(), attributeParam.trim());
}
}
if (field.getControl() instanceof RemotableTextInput || field.getControl() instanceof RemotableSelect
|| field.getControl() instanceof RemotableCheckboxGroup
|| field.getControl() instanceof RemotableRadioButtonGroup) {
myColumns.getColumns().add(new ConcreteKeyValue(field.getName(), ruleTemplateAttribute.getId()));
}
}
}
}
if (!StringUtils.isEmpty(ruleDescription)) {
ruleDescription = ruleDescription.replace('*', '%');
ruleDescription = "%" + ruleDescription.trim() + "%";
}
if (!GlobalVariables.getMessageMap().hasNoErrors()) {
throw new ValidationException("errors in search criteria");
}
]]>
attributes = null;
MyColumns myColumns = new MyColumns();
if (StringUtils.isNotBlank(ruleTemplateNameParam) || StringUtils.isNotBlank(ruleTemplateIdParam) && !"null".equals(ruleTemplateIdParam)) {
RuleTemplate ruleTemplate = null;
if (StringUtils.isNotBlank(ruleTemplateIdParam)) {
ruleTemplate = KewApiServiceLocator.getRuleService().getRuleTemplate(ruleTemplateIdParam);
} else {
ruleTemplate = KewApiServiceLocator.getRuleService().getRuleTemplateByName(ruleTemplateNameParam.trim());
]]>
groups = getGroupService().getGroups(getGroupService().getDirectGroupIdsByPrincipalId(
identityManagementPersonDocument.getPrincipalId()));
loadGroupToPersonDoc(identityManagementPersonDocument, groups);
loadRoleToPersonDoc(identityManagementPersonDocument);
loadDelegationsToPersonDoc(identityManagementPersonDocument);
}
]]>
0) {
recipientsExist = true;
for (String userRecipientId : userRecipients) {
if (isUserRecipientValid(userRecipientId, errors)) {
NotificationRecipient recipient = new NotificationRecipient();
recipient.setRecipientType(KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE);
recipient.setRecipientId(userRecipientId);
notification.addRecipient(recipient);
}
}
}
if (workgroupRecipients != null && workgroupRecipients.length > 0) {
recipientsExist = true;
if (workgroupNamespaceCodes != null && workgroupNamespaceCodes.length > 0) {
if (workgroupNamespaceCodes.length == workgroupRecipients.length) {
for (int i = 0; i < workgroupRecipients.length; i++) {
if (isWorkgroupRecipientValid(workgroupRecipients[i], workgroupNamespaceCodes[i], errors)) {
NotificationRecipient recipient = new NotificationRecipient();
recipient.setRecipientType(KimGroupMemberTypes.GROUP_MEMBER_TYPE);
recipient.setRecipientId(
getGroupService().getGroupByNameAndNamespaceCode(workgroupNamespaceCodes[i],
workgroupRecipients[i]).getId());
notification.addRecipient(recipient);
}
}
} else {
errors.addError("The number of groups must match the number of namespace codes");
}
} else {
errors.addError("You must specify a namespace code for every group name");
}
} else if (workgroupNamespaceCodes != null && workgroupNamespaceCodes.length > 0) {
errors.addError("You must specify a group name for every namespace code");
}
// check to see if there were any errors
if (errors.getErrors().size() > 0) {
throw errors;
}
notification.setTitle(title);
notification.setDeliveryType(deliveryType);
// simpledateformat is not threadsafe, have to sync and validate
Date d = null;
]]>
l = Arrays.asList(valueEntered.split("\\.\\."));
for(String value : l){
bSplit = true;
if(!isPassesDefaultValidation(value)){
bRet = false;
}
}
}
if (StringUtils.contains(valueEntered, SearchOperator.OR.op())) {
//splitValueList.addAll(Arrays.asList(StringUtils.split(valueEntered, KRADConstants.OR_LOGICAL_OPERATOR)));
List l = Arrays.asList(StringUtils.split(valueEntered, SearchOperator.OR.op()));
for(String value : l){
bSplit = true;
if(!isPassesDefaultValidation(value)){
bRet = false;
}
}
}
if (StringUtils.contains(valueEntered, SearchOperator.AND.op())) {
//splitValueList.addAll(Arrays.asList(StringUtils.split(valueEntered, KRADConstants.AND_LOGICAL_OPERATOR)));
List l = Arrays.asList(StringUtils.split(valueEntered, SearchOperator.AND.op()));
for(String value : l){
bSplit = true;
if(!isPassesDefaultValidation(value)){
bRet = false;
}
}
}
if(bSplit){
return bRet;
}
Pattern pattern = Pattern.compile(DEFAULT_VALIDATION_REGEX_EXPRESSION);
Matcher matcher = pattern.matcher(SQLUtils.cleanNumericOfValidOperators(valueEntered).trim());
if(!matcher.matches()){
bRet = false;
}
return bRet;
}
/* (non-Javadoc)
* @see org.kuali.rice.kew.docsearch.SearchableAttributeValue#isRangeValid(java.lang.String, java.lang.String)
*/
public Boolean isRangeValid(String lowerValue, String upperValue) {
if (allowsRangeSearches()) {
]]>
getDocumentStatuses() {
return this.documentStatuses;
}
@Override
public List getDocumentStatusCategories() {
return this.documentStatusCategories;
}
@Override
public String getTitle() {
return this.title;
}
@Override
public String getApplicationDocumentId() {
return this.applicationDocumentId;
}
@Override
public String getApplicationDocumentStatus() {
return this.applicationDocumentStatus;
}
@Override
public String getInitiatorPrincipalName() {
return this.initiatorPrincipalName;
}
@Override
public String getViewerPrincipalName() {
return this.viewerPrincipalName;
}
@Override
public String getViewerGroupId() {
return this.viewerGroupId;
}
@Override
public String getApproverPrincipalName() {
return this.approverPrincipalName;
}
@Override
public String getRouteNodeName() {
return this.routeNodeName;
}
@Override
public RouteNodeLookupLogic getRouteNodeLookupLogic() {
return this.routeNodeLookupLogic;
}
@Override
public String getDocumentTypeName() {
return this.documentTypeName;
}
@Override
public DateTime getDateCreatedFrom() {
return this.dateCreatedFrom;
}
@Override
public DateTime getDateCreatedTo() {
return this.dateCreatedTo;
}
@Override
public DateTime getDateLastModifiedFrom() {
return this.dateLastModifiedFrom;
}
@Override
public DateTime getDateLastModifiedTo() {
return this.dateLastModifiedTo;
}
@Override
public DateTime getDateApprovedFrom() {
return this.dateApprovedFrom;
}
@Override
public DateTime getDateApprovedTo() {
return this.dateApprovedTo;
}
@Override
public DateTime getDateFinalizedFrom() {
return this.dateFinalizedFrom;
}
@Override
public DateTime getDateFinalizedTo() {
return this.dateFinalizedTo;
}
@Override
public DateTime getDateApplicationDocumentStatusChangedFrom() {
return dateApplicationDocumentStatusChangedFrom;
}
@Override
public DateTime getDateApplicationDocumentStatusChangedTo() {
return dateApplicationDocumentStatusChangedTo;
}
@Override
public Map> getDocumentAttributeValues() {
return this.documentAttributeValues;
}
@Override
public String getSaveName() {
return this.saveName;
]]>
getFields() {
]]>
getSecurePotentiallyHiddenSectionIds() {
return new HashSet();
}
public Set getSecurePotentiallyReadOnlySectionIds() {
return new HashSet();
}
@SuppressWarnings("unchecked")
@Override
protected void addRoleQualification(Object dataObject, Map attributes) {
super.addRoleQualification(dataObject, attributes);
if (dataObject instanceof MaintenanceDocument) {
MaintenanceDocument maintDoc = (MaintenanceDocument) dataObject;
if (maintDoc.getNewMaintainableObject() != null) {
attributes.putAll(KRADUtils
.getNamespaceAndComponentSimpleName(maintDoc.getNewMaintainableObject().getDataObjectClass()));
}
}
}
@SuppressWarnings("unchecked")
@Override
protected void addPermissionDetails(Object dataObject, Map attributes) {
super.addPermissionDetails(dataObject, attributes);
if (dataObject instanceof MaintenanceDocument) {
MaintenanceDocument maintDoc = (MaintenanceDocument) dataObject;
if (maintDoc.getNewMaintainableObject() != null) {
attributes.putAll(KRADUtils
.getNamespaceAndComponentSimpleName(maintDoc.getNewMaintainableObject().getDataObjectClass()));
attributes.put(KRADConstants.MAINTENANCE_ACTN,
maintDoc.getNewMaintainableObject().getMaintenanceAction());
}
}
}
]]>
unpopulatedFields = new ArrayList();
// yelp if nulls were passed in
if (bo == null) {
throw new IllegalArgumentException("The Class passed in for the BusinessObject argument was null.");
}
if (StringUtils.isBlank(referenceName)) {
throw new IllegalArgumentException("The String passed in for the referenceName argument was null or empty.");
}
PropertyDescriptor propertyDescriptor = null;
// make sure the attribute exists at all, throw exception if not
try {
propertyDescriptor = PropertyUtils.getPropertyDescriptor(bo, referenceName);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (propertyDescriptor == null) {
throw new ReferenceAttributeDoesntExistException("Requested attribute: '" + referenceName + "' does not exist " + "on class: '" + bo.getClass().getName() + "'.");
}
// get the class of the attribute name
Class referenceClass = propertyDescriptor.getPropertyType();
// make sure the class of the attribute descends from BusinessObject,
// otherwise throw an exception
if (!PersistableBusinessObject.class.isAssignableFrom(referenceClass)) {
throw new ObjectNotABusinessObjectRuntimeException("Attribute requested (" + referenceName + ") is of class: " + "'" + referenceClass.getName() + "' and is not a " + "descendent of BusinessObject. Only descendents of BusinessObject " + "can be used.");
}
]]>
primaryKeys = new HashMap(4);
primaryKeys.put(SESSION_ID, sessionId);
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
SessionDocument sessionDocument =
getBusinessObjectService().findByPrimaryKey(SessionDocument.class, primaryKeys);
if (sessionDocument == null) {
sessionDocument = new SessionDocument();
sessionDocument.setSessionId(sessionId);
sessionDocument.setDocumentNumber(documentNumber);
sessionDocument.setPrincipalId(userSession.getPrincipalId());
sessionDocument.setIpAddress(ipAddress);
}
sessionDocument.setSerializedDocumentForm(formAsBytes);
sessionDocument.setEncrypted(encryptContent);
sessionDocument.setLastUpdatedDate(currentTime);
businessObjectService.save(sessionDocument);
} catch (Exception e) {
final String className = form != null ? form.getClass().getName() : "null";
LOG.error("setDocumentForm failed for SessId/DocNum/PrinId/IP/class:" + userSession.getKualiSessionId() +
"/" + documentNumber + "/" + userSession.getPrincipalId() + "/" + ipAddress + "/" + className, e);
}
}
/**
* @see org.kuali.rice.krad.service.SessionDocumentService#purgeAllSessionDocuments(java.sql.Timestamp)
*/
@Override
public void purgeAllSessionDocuments(Timestamp expirationDate) {
sessionDocumentDao.purgeAllSessionDocuments(expirationDate);
}
protected SessionDocumentDao getSessionDocumentDao() {
return this.sessionDocumentDao;
}
public void setSessionDocumentDao(SessionDocumentDao sessionDocumentDao) {
this.sessionDocumentDao = sessionDocumentDao;
}
protected BusinessObjectService getBusinessObjectService() {
return this.businessObjectService;
}
public void setBusinessObjectService(BusinessObjectService businessObjectService) {
this.businessObjectService = businessObjectService;
}
]]>
model = new HashMap();
String view;
try {
document = NotificationWorkflowDocument.createNotificationDocument(
initiatorId,
NotificationConstants.KEW_CONSTANTS.SEND_NOTIFICATION_REQ_DOC_TYPE);
//parse out the application content into a Notification BO
Notification notification = populateNotificationInstance(request,
model);
// now get that content in an understandable XML format and pass into document
String notificationAsXml = messageContentService
.generateNotificationMessage(notification);
Map attrFields = new HashMap();
List reviewers = notification.getChannel().getReviewers();
int ui = 0;
int gi = 0;
for (NotificationChannelReviewer reviewer : reviewers) {
String prefix;
int index;
if (KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.equals(reviewer.getReviewerType())) {
prefix = "user";
index = ui;
ui++;
} else if (KimGroupMemberTypes.GROUP_MEMBER_TYPE.equals(reviewer.getReviewerType())) {
prefix = "group";
index = gi;
gi++;
} else {
LOG.error("Invalid type for reviewer " + reviewer.getReviewerId() + ": "
+ reviewer.getReviewerType());
continue;
}
attrFields.put(prefix + index, reviewer.getReviewerId());
}
GenericAttributeContent gac = new GenericAttributeContent("channelReviewers");
document.setApplicationContent(notificationAsXml);
document.setAttributeContent("" + gac.generateContent(attrFields) + "");
document.setTitle(notification.getTitle());
document.route("This message was submitted via the simple notification message submission form by user "
]]>
attributes) {
super.addPermissionDetails(dataObject, attributes);
if (dataObject instanceof Document) {
addStandardAttributes((Document) dataObject, attributes);
}
}
@Override
protected void addRoleQualification(Object dataObject,
Map attributes) {
super.addRoleQualification(dataObject, attributes);
if (dataObject instanceof Document) {
addStandardAttributes((Document) dataObject, attributes);
}
}
protected void addStandardAttributes(Document document,
Map attributes) {
WorkflowDocument wd = document.getDocumentHeader()
.getWorkflowDocument();
attributes.put(KimConstants.AttributeConstants.DOCUMENT_NUMBER, document
.getDocumentNumber());
attributes.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME, wd.getDocumentTypeName());
if (wd.isInitiated() || wd.isSaved()) {
attributes.put(KimConstants.AttributeConstants.ROUTE_NODE_NAME,
PRE_ROUTING_ROUTE_NAME);
} else {
attributes.put(KimConstants.AttributeConstants.ROUTE_NODE_NAME, KRADServiceLocatorWeb.getWorkflowDocumentService().getCurrentRouteNodeNames(wd));
}
attributes.put(KimConstants.AttributeConstants.ROUTE_STATUS_CODE, wd.getStatus().getCode());
}
protected boolean isDocumentInitiator(Document document, Person user) {
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
return workflowDocument.getInitiatorPrincipalId().equalsIgnoreCase(user.getPrincipalId());
}
}
]]>
REASONABLE_IMMEDIATE_TIME_THRESHOLD;
LOG.info("Time: " + new Date(time) + " is in the future? " + future);
return future;
}
/**
* Returns whether the specified Notification can be reasonably expected to have recipients.
* This is determined on whether the channel has default recipients, is subscribably, and
* whether the send date time is far enough in the future to expect that if there are no
* subscribers, there may actually be some by the time the notification is sent.
* @param notification the notification to test
* @return whether the specified Notification can be reasonably expected to have recipients
*/
private boolean hasPotentialRecipients(Notification notification) {
LOG.info("notification channel " + notification.getChannel() + " is subscribable: "
+ notification.getChannel().isSubscribable());
return notification.getChannel().getRecipientLists().size() > 0
||
notification.getChannel().getSubscriptions().size() > 0
||
(notification.getChannel().isSubscribable() && timeIsInTheFuture(notification.getSendDateTime()
.getTime()));
}
protected NotificationService notificationService;
protected NotificationWorkflowDocumentService notificationWorkflowDocService;
protected NotificationChannelService notificationChannelService;
protected NotificationRecipientService notificationRecipientService;
protected NotificationMessageContentService messageContentService;
protected GenericDao businessObjectDao;
/**
* Set the NotificationService
* @param notificationService
*/
public void setNotificationService(NotificationService notificationService) {
this.notificationService = notificationService;
}
/**
* This method sets the NotificationWorkflowDocumentService
* @param s
*/
public void setNotificationWorkflowDocumentService(
NotificationWorkflowDocumentService s) {
this.notificationWorkflowDocService = s;
}
/**
* Sets the notificationChannelService attribute value.
* @param notificationChannelService The notificationChannelService to set.
*/
public void setNotificationChannelService(
NotificationChannelService notificationChannelService) {
this.notificationChannelService = notificationChannelService;
}
/**
* Sets the notificationRecipientService attribute value.
* @param notificationRecipientService
*/
public void setNotificationRecipientService(
NotificationRecipientService notificationRecipientService) {
this.notificationRecipientService = notificationRecipientService;
}
/**
* Sets the messageContentService attribute value.
* @param messageContentService
*/
public void setMessageContentService(
NotificationMessageContentService notificationMessageContentService) {
this.messageContentService = notificationMessageContentService;
}
/**
* Sets the businessObjectDao attribute value.
* @param businessObjectDao The businessObjectDao to set.
*/
public void setBusinessObjectDao(GenericDao businessObjectDao) {
this.businessObjectDao = businessObjectDao;
}
/**
* Handles the display of the form for sending a simple notification message
* @param request : a servlet request
* @param response : a servlet response
* @throws ServletException : an exception
* @throws IOException : an exception
* @return a ModelAndView object
*/
public ModelAndView sendSimpleNotificationMessage(
]]>
1) ) {
// no user and more than one workgroup id
ruleResponsibilityNameCrit = new Criteria();
ruleResponsibilityNameCrit.addIn("ruleResponsibilityName", workgroupIds);
ruleResponsibilityNameCrit.addEqualTo("ruleResponsibilityType", KEWConstants.RULE_RESPONSIBILITY_GROUP_ID);
}
if (ruleResponsibilityNameCrit != null) {
]]>
generatedActionItems = new ArrayList();
List requests = new ArrayList();
if ( context.isSimulation() ) {
for ( ActionRequestValue ar : context.getDocument().getActionRequests() ) {
// logic check below duplicates behavior of the
// ActionRequestService.findPendingRootRequestsByDocIdAtRouteNode(documentId,
// routeNodeInstanceId) method
if ( ar.getCurrentIndicator()
&& (ActionRequestStatus.INITIALIZED.getCode().equals( ar.getStatus() ) || ActionRequestStatus.ACTIVATED.getCode()
.equals( ar.getStatus() ))
&& ar.getNodeInstance().getRouteNodeInstanceId().equals(
nodeInstance.getRouteNodeInstanceId() )
&& ar.getParentActionRequest() == null ) {
requests.add( ar );
}
}
requests.addAll( context.getEngineState().getGeneratedRequests() );
} else {
requests = KEWServiceLocator.getActionRequestService()
.findPendingRootRequestsByDocIdAtRouteNode( document.getDocumentId(),
nodeInstance.getRouteNodeInstanceId() );
}
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Pending Root Requests " + requests.size() );
}
boolean requestActivated = activateRequestsCustom( context, requests, generatedActionItems,
]]>
emptyMap();
this.active = builder.isActive();
this.versionNumber = builder.getVersionNumber();
this.objectId = builder.getObjectId();
}
/**
* @see ResponsibilityContract#getId()
*/
@Override
public String getId() {
return id;
}
/**
* @see ResponsibilityContract#getNamespaceCode()
*/
@Override
public String getNamespaceCode() {
return namespaceCode;
}
/**
* @see ResponsibilityContract#getName()
*/
@Override
public String getName() {
return name;
}
/**
* @see ResponsibilityContract#getDescription()
*/
@Override
public String getDescription() {
return description;
}
/**
* @see ResponsibilityContract#getTemplate()
*/
@Override
public Template getTemplate() {
return template;
}
/**
* @see org.kuali.rice.core.api.mo.common.active.Inactivatable#isActive()
*/
@Override
public boolean isActive() {
return active;
}
/**
*
* @see ResponsibilityContract#getAttributes()
*/
@Override
public Map getAttributes() {
return this.attributes;
}
/**
* @see org.kuali.rice.core.api.mo.common.Versioned#getVersionNumber()
*/
@Override
public Long getVersionNumber() {
return versionNumber;
}
/**
* @see org.kuali.rice.core.api.mo.common.GloballyUnique#getObjectId()
*/
@Override
public String getObjectId() {
return objectId;
}
/**
* This builder constructs a Responsibility enforcing the constraints of the {@link ResponsibilityContract}.
*/
public static final class Builder implements ResponsibilityContract, ModelBuilder, Serializable {
]]>
additionalPermissionDetails = new HashMap();
additionalPermissionDetails.put(KimConstants.AttributeConstants.ACTION_REQUEST_CD,
actionRequestCode);
return isAuthorizedByTemplate(document, KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.TAKE_REQUESTED_ACTION,
user.getPrincipalId(), additionalPermissionDetails, null);
]]>
getPolicies() {
return this.policies;
}
@Override
public Long getVersionNumber() {
return this.versionNumber;
}
public void setId(String id) {
]]>
getRows() {
List superRows = super.getRows();
List returnRows = new ArrayList();
returnRows.addAll(superRows);
returnRows.addAll(rows);
return returnRows;
}
@Override
public boolean checkForAdditionalFields(Map fieldValues) {
String ruleTemplateNameParam = (String) fieldValues.get(RULE_TEMPLATE_PROPERTY_NAME);
if (StringUtils.isNotBlank(ruleTemplateNameParam)) {
rows = new ArrayList();
RuleTemplate ruleTemplate = KewApiServiceLocator.getRuleService().getRuleTemplateByName(ruleTemplateNameParam);
for (RuleTemplateAttribute ruleTemplateAttribute : ruleTemplate.getActiveRuleTemplateAttributes()) {
List attributeFields = null;
WorkflowRuleAttributeHandlerService wrahs = KewFrameworkServiceLocator
.getWorkflowRuleAttributeHandlerService();
String attributeName = ruleTemplateAttribute.getRuleAttribute().getName();
attributeFields = wrahs.getSearchRows(attributeName);
List searchRows = FieldUtils.convertRemotableAttributeFields(attributeFields);
rows.addAll(searchRows);
}
return true;
}
rows.clear();
return false;
}
@Override
public List extends BusinessObject> getSearchResults(Map fieldValues) {
]]>
getColumns() {
List columns = super.getColumns();
for (Row row : rows) {
for (Field field : row.getFields()) {
Column newColumn = new Column();
newColumn.setColumnTitle(field.getFieldLabel());
newColumn.setMaxLength(field.getMaxLength());
newColumn.setPropertyName(field.getPropertyName());
columns.add(newColumn);
}
}
return columns;
}
@Override
public List getCustomActionUrls(BusinessObject businessObject,
List pkNames) {
]]>
getResourceLoadersToRegister() throws Exception {
// create the plugin registry
PluginRegistry registry = null;
String pluginRegistryEnabled = ConfigContext.getCurrentContextConfig().getProperty("plugin.registry.enabled");
if (!StringUtils.isBlank(pluginRegistryEnabled) && Boolean.valueOf(pluginRegistryEnabled).booleanValue()) {
registry = new PluginRegistryFactory().createPluginRegistry();
}
final Collection rls = new ArrayList();
for (ResourceLoader rl : RiceResourceLoaderFactory.getSpringResourceLoaders()) {
CoreResourceLoader coreResourceLoader =
new CoreResourceLoader(rl, registry);
coreResourceLoader.start();
//wait until core resource loader is started to attach to GRL; this is so startup
//code can depend on other things hooked into GRL without incomplete KEW resources
//messing things up.
GlobalResourceLoader.addResourceLoader(coreResourceLoader);
// now start the plugin registry if there is one
if (registry != null) {
registry.start();
// the registry resourceloader is now being handled by the CoreResourceLoader
//GlobalResourceLoader.addResourceLoader(registry);
}
rls.add(coreResourceLoader);
}
return rls;
}
private ClientProtocol getClientProtocol() {
return ClientProtocol.valueOf(ConfigContext.getCurrentContextConfig().getProperty("client.protocol"));
}
public DataSource getDataSource() {
return dataSource;
}
public void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
}
}
]]>
clazz, StringBuffer sb, Map overrides ) {
// first get annotation overrides
if ( overrides == null ) {
overrides = new HashMap();
}
if ( clazz.getAnnotation( AttributeOverride.class ) != null ) {
AttributeOverride ao = (AttributeOverride)clazz.getAnnotation( AttributeOverride.class );
if ( !overrides.containsKey(ao.name() ) ) {
overrides.put(ao.name(), ao);
}
}
if ( clazz.getAnnotation( AttributeOverrides.class ) != null ) {
for ( AttributeOverride ao : ((AttributeOverrides)clazz.getAnnotation( AttributeOverrides.class )).value() ) {
if ( !overrides.containsKey(ao.name() ) ) {
overrides.put(ao.name(), ao);
}
overrides.put(ao.name(),ao);
}
}
for ( Field field : clazz.getDeclaredFields() ) {
Id id = (Id)field.getAnnotation( Id.class );
Column column = (Column)field.getAnnotation( Column.class );
if ( column != null ) {
sb.append( "
loadAddresses(IdentityManagementPersonDocument identityManagementPersonDocument, String principalId, List entityAddresses, boolean suppressDisplay ) {
List docAddresses = new ArrayList();
if(ObjectUtils.isNotNull(entityAddresses)){
for (EntityAddress address: entityAddresses) {
if(address.isActive()){
PersonDocumentAddress docAddress = new PersonDocumentAddress();
docAddress.setEntityTypeCode(address.getEntityTypeCode());
docAddress.setAddressTypeCode(address.getAddressType().getCode());
//We do not need to check the privacy setting here - The UI should care of it
docAddress.setLine1(address.getLine1Unmasked());
docAddress.setLine2(address.getLine2Unmasked());
docAddress.setLine3(address.getLine3Unmasked());
docAddress.setStateProvinceCode(address.getStateProvinceCodeUnmasked());
docAddress.setPostalCode(address.getPostalCodeUnmasked());
docAddress.setCountryCode(address.getCountryCodeUnmasked());
docAddress.setCity(address.getCityUnmasked());
docAddress.setActive(address.isActive());
docAddress.setDflt(address.isDefaultValue());
docAddress.setEntityAddressId(address.getId());
docAddress.setEdit(true);
docAddresses.add(docAddress);
}
}
}
return docAddresses;
}
protected List loadEmails(IdentityManagementPersonDocument identityManagementPersonDocument, String principalId, List entityEmails, boolean suppressDisplay ) {
]]>
1) {
throw new RuntimeException(
"EBO Links don't work for relationships with multiple-field primary keys.");
}
String boProperty = rd.getPrimitiveAttributes().get(0).getSourceName();
String eboProperty = rd.getPrimitiveAttributes().get(0).getTargetName();
StringBuffer boPropertyValue = new StringBuffer();
// loop over the results, making a string that the lookup
// DAO will convert into an
// SQL "IN" clause
for (Object ebo : eboResults) {
if (boPropertyValue.length() != 0) {
boPropertyValue.append(SearchOperator.OR.op());
}
try {
boPropertyValue.append(PropertyUtils.getProperty(ebo, eboProperty).toString());
} catch (Exception ex) {
LOG.warn("Unable to get value for " + eboProperty + " on " + ebo);
}
}
if (eboParentPropertyName == null) {
// non-nested property containing the EBO
nonEboFieldValues.put(boProperty, boPropertyValue.toString());
} else {
// property nested within the main searched-for BO that
// contains the EBO
nonEboFieldValues.put(eboParentPropertyName + "." + boProperty, boPropertyValue.toString());
}
}
}
]]>
getInverseForeignKeysForCollection(Class boClass, String collectionName) {
// yelp if nulls were passed in
if (boClass == null) {
throw new IllegalArgumentException("The Class passed in for the boClass argument was null.");
}
if (collectionName == null) {
throw new IllegalArgumentException("The String passed in for the attributeName argument was null.");
}
PropertyDescriptor propertyDescriptor = null;
// make an instance of the class passed
Object classInstance;
try {
classInstance = boClass.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
// make sure the attribute exists at all, throw exception if not
try {
propertyDescriptor = PropertyUtils.getPropertyDescriptor(classInstance, collectionName);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (propertyDescriptor == null) {
throw new ReferenceAttributeDoesntExistException("Requested attribute: '" + collectionName + "' does not exist " + "on class: '" + boClass.getName() + "'. GFK");
}
// get the class of the attribute name
Class attributeClass = propertyDescriptor.getPropertyType();
// make sure the class of the attribute descends from BusinessObject,
// otherwise throw an exception
if (!Collection.class.isAssignableFrom(attributeClass)) {
throw new ObjectNotABusinessObjectRuntimeException("Attribute requested (" + collectionName + ") is of class: " + "'" + attributeClass.getName() + "' and is not a " + "descendent of Collection");
}
]]>
roleMemberTypeClass = null;
String roleMemberIdName = "";
if(KimConstants.KimUIConstants.MEMBER_TYPE_PRINCIPAL_CODE.equals(memberTypeCode)){
roleMemberTypeClass = PrincipalBo.class;
roleMemberIdName = KimConstants.PrimaryKeyConstants.PRINCIPAL_ID;
Principal principalInfo = getIdentityService().getPrincipal(memberId);
if (principalInfo != null) {
}
} else if(KimConstants.KimUIConstants.MEMBER_TYPE_GROUP_CODE.equals(memberTypeCode)){
roleMemberTypeClass = GroupBo.class;
roleMemberIdName = KimConstants.PrimaryKeyConstants.GROUP_ID;
Group groupInfo = null;
groupInfo = getGroupService().getGroup(memberId);
if (groupInfo != null) {
}
} else if(KimConstants.KimUIConstants.MEMBER_TYPE_ROLE_CODE.equals(memberTypeCode)){
roleMemberTypeClass = RoleBo.class;
roleMemberIdName = KimConstants.PrimaryKeyConstants.ROLE_ID;
Role role = getRoleService().getRole(memberId);
if (role != null) {
}
}
Map criteria = new HashMap();
criteria.put(roleMemberIdName, memberId);
return getBusinessObjectService().findByPrimaryKey(roleMemberTypeClass, criteria);
}
]]>
0) {
RuleAttribute ruleAttrib = KEWServiceLocator.getRuleAttributeService().findByName(attribute);
if (ruleAttrib == null) {
LOG.error("Invalid attribute referenced in EDocLite definition: " + attribute);
invalidAttributes.add("Attribute '" + attribute + "' referenced in field '" + fieldName + "' not found");
}
}
}
}
if (invalidAttributes.size() > 0) {
LOG.error("Invalid attributes referenced in EDocLite definition");
StringBuffer message = new StringBuffer("EDocLite definition contains references to non-existent attributes;\n");
Iterator it = invalidAttributes.iterator();
while (it.hasNext()) {
message.append(it.next());
message.append("\n");
}
throw new XmlIngestionException(message.toString());
]]>
* @param
* @param toConvert
* @param xform
* @return
*/
public static List transform(List extends A> toConvert, Transformer xform) {
if (CollectionUtils.isEmpty(toConvert)) {
return new ArrayList();
} else {
List results = new ArrayList(toConvert.size());
for (A elem : toConvert) {
results.add(xform.transform(elem));
}
return results;
}
}
public static Set transform(Set extends A> toConvert, Transformer xform) {
if (CollectionUtils.isEmpty(toConvert)) {
return new HashSet();
} else {
Set results = new HashSet(toConvert.size());
for (A elem : toConvert) {
results.add(xform.transform(elem));
}
return results;
}
}
public interface Transformer {
public B transform(A input);
}
]]>
loadNames( IdentityManagementPersonDocument personDoc, String principalId, List names, boolean suppressDisplay ) {
List docNames = new ArrayList();
if(ObjectUtils.isNotNull(names)){
for (EntityName name: names) {
if(name.isActive()){
PersonDocumentName docName = new PersonDocumentName();
if (name.getNameType() != null) {
docName.setNameCode(name.getNameType().getCode());
}
//We do not need to check the privacy setting here - The UI should care of it
docName.setFirstName(name.getFirstNameUnmasked());
docName.setLastName(name.getLastNameUnmasked());
docName.setMiddleName(name.getMiddleNameUnmasked());
docName.setNamePrefix(name.getNamePrefixUnmasked());
docName.setNameSuffix(name.getNameSuffixUnmasked());
docName.setActive(name.isActive());
docName.setDflt(name.isDefaultValue());
docName.setEdit(true);
docName.setEntityNameId(name.getId());
docNames.add(docName);
}
}
}
return docNames;
}
]]>
listReferenceObjectFields(Class boClass) {
// validate parameter
if (boClass == null) {
throw new IllegalArgumentException("Class specified in the parameter was null.");
}
if (!PersistableBusinessObject.class.isAssignableFrom(boClass)) {
throw new IllegalArgumentException("Class specified [" + boClass.getName() + "] must be a class that " + "inherits from BusinessObject.");
}
]]>
getParametersFromViewConfiguration(PropertyValues propertyValues) {
Map parameters = new HashMap();
String viewName = ViewModelUtils.getStringValFromPVs(propertyValues, UifParameters.VIEW_NAME);
String dataObjectClassName = ViewModelUtils.getStringValFromPVs(propertyValues,
UifParameters.DATA_OBJECT_CLASS_NAME);
parameters.put(UifParameters.VIEW_NAME, viewName);
parameters.put(UifParameters.DATA_OBJECT_CLASS_NAME, dataObjectClassName);
return parameters;
}
/**
* @see org.kuali.rice.krad.uif.service.ViewTypeService#getParametersFromRequest(java.util.Map)
*/
public Map getParametersFromRequest(Map requestParameters) {
Map parameters = new HashMap();
if (requestParameters.containsKey(UifParameters.VIEW_NAME)) {
parameters.put(UifParameters.VIEW_NAME, requestParameters.get(UifParameters.VIEW_NAME));
}
else {
parameters.put(UifParameters.VIEW_NAME, UifConstants.DEFAULT_VIEW_NAME);
}
if (requestParameters.containsKey(UifParameters.DATA_OBJECT_CLASS_NAME)) {
parameters.put(UifParameters.DATA_OBJECT_CLASS_NAME,
requestParameters.get(UifParameters.DATA_OBJECT_CLASS_NAME));
}
]]>
)getSearchResultsUnbounded(lookupForm.getFieldsForLookup());
}
HashMap propertyTypes = new HashMap();
boolean hasReturnableRow = false;
List returnKeys = getReturnKeys();
List pkNames = getBusinessObjectMetaDataService().listPrimaryKeyFieldNames(getBusinessObjectClass());
Person user = GlobalVariables.getUserSession().getPerson();
// iterate through result list and wrap rows with return url and action urls
for (Iterator iter = displayList.iterator(); iter.hasNext();) {
BusinessObject element = (BusinessObject) iter.next();
if(element instanceof PersistableBusinessObject){
lookupForm.setLookupObjectId(((PersistableBusinessObject)element).getObjectId());
}
BusinessObjectRestrictions businessObjectRestrictions = getBusinessObjectAuthorizationService().getLookupResultRestrictions(element, user);
HtmlData returnUrl = getReturnUrl(element, lookupForm, returnKeys, businessObjectRestrictions);
String actionUrls = getActionUrls(element, pkNames, businessObjectRestrictions);
//Fix for JIRA - KFSMI-2417
if("".equals(actionUrls)){
actionUrls = ACTION_URLS_EMPTY;
}
List columns = getColumns();
for (Object element2 : columns) {
Column col = (Column) element2;
]]>
0 ) {
if ( cleanedValue.charAt( 0 ) == '-' ) {
cleanedValue = "-" + cleanedValue.replaceAll( "-", "" );
} else {
cleanedValue = cleanedValue.replaceAll( "-", "" );
}
}
// ensure only one decimal in the string
int decimalLoc = cleanedValue.lastIndexOf( '.' );
if ( cleanedValue.indexOf( '.' ) != decimalLoc ) {
cleanedValue = cleanedValue.substring( 0, decimalLoc ).replaceAll( "\\.", "" ) + cleanedValue.substring( decimalLoc );
}
try {
return new BigDecimal( cleanedValue );
} catch ( NumberFormatException ex ) {
GlobalVariables.getMessageMap().putError(KRADConstants.DOCUMENT_ERRORS, RiceKeyConstants.ERROR_CUSTOM, new String[] { "Invalid Numeric Input: " + value });
return null;
}
}
/**
* Adds to the criteria object based on query characters given
*/
private void addNumericRangeCriteria(String propertyName, String propertyValue, boolean treatWildcardsAndOperatorsAsLiteral, Criteria criteria) {
]]>
loadPhones(IdentityManagementPersonDocument identityManagementPersonDocument, String principalId, List entityPhones, boolean suppressDisplay ) {
List docPhones = new ArrayList();
if(ObjectUtils.isNotNull(entityPhones)){
for (EntityPhone phone: entityPhones) {
if(phone.isActive()){
PersonDocumentPhone docPhone = new PersonDocumentPhone();
if (phone.getPhoneType() != null) {
docPhone.setPhoneTypeCode(phone.getPhoneType().getCode());
}
//docPhone.setPhoneType(((KimEntityPhoneImpl)phone).getPhoneType());
docPhone.setEntityTypeCode(phone.getEntityTypeCode());
//We do not need to check the privacy setting here - The UI should care of it
docPhone.setPhoneNumber(phone.getPhoneNumberUnmasked());
docPhone.setCountryCode(phone.getCountryCodeUnmasked());
docPhone.setExtensionNumber(phone.getExtensionNumberUnmasked());
docPhone.setActive(phone.isActive());
docPhone.setDflt(phone.isDefaultValue());
docPhone.setEntityPhoneId(phone.getId());
docPhone.setEdit(true);
docPhones.add(docPhone);
}
}
}
return docPhones;
}
]]>
getVariables() {
return this.variables;
]]>
getQualifier() {
return this.qualifier;
}
@Override
public List getDelegates() {
]]>
RULE_ATTRIBUTE_TYPE_MAP;
static {
RULE_ATTRIBUTE_TYPE_MAP = new HashMap();
RULE_ATTRIBUTE_TYPE_MAP.put(RULE_ATTRIBUTE_TYPE, RULE_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(SEARCHABLE_ATTRIBUTE_TYPE, SEARCHABLE_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(RULE_XML_ATTRIBUTE_TYPE, RULE_XML_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(SEARCHABLE_XML_ATTRIBUTE_TYPE, SEARCHABLE_XML_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(EXTENSION_ATTRIBUTE_TYPE, EXTENSION_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(EMAIL_ATTRIBUTE_TYPE, EMAIL_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(NOTE_ATTRIBUTE_TYPE, NOTE_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(ACTION_LIST_ATTRIBUTE_TYPE, ACTION_LIST_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(RULE_VALIDATION_ATTRIBUTE_TYPE, RULE_VALIDATION_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(SEARCH_GENERATOR_ATTRIBUTE_TYPE, SEARCH_GENERATOR_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(SEARCH_RESULT_PROCESSOR_ATTRIBUTE_TYPE, SEARCH_RESULT_PROCESSOR_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(SEARCH_RESULT_XML_PROCESSOR_ATTRIBUTE_TYPE, SEARCH_RESULT_XML_PROCESSOR_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(DOCUMENT_SEARCH_SECURITY_FILTER_ATTRIBUTE_TYPE, DOCUMENT_SEARCH_SECURITY_FILTER_ATTRIBUTE_TYPE_LABEL);
RULE_ATTRIBUTE_TYPE_MAP.put(QUALIFIER_RESOLVER_ATTRIBUTE_TYPE, QUALIFIER_RESOLVER_ATTRIBUTE_TYPE_LABEL);
}
]]>
primaryKeys = new HashMap();
primaryKeys.put(propertyName, "code");
inquiry.buildInquiryLink(dataObject, propertyName, NamespaceBo.class, primaryKeys);
} else if(DETAIL_OBJECTS.equals(propertyName)){
//return getAttributesInquiryUrl(businessObject, DETAIL_OBJECTS);
super.buildInquirableLink(dataObject, propertyName, inquiry);
} else if(ASSIGNED_TO_ROLES.equals(propertyName)){
// return getAssignedRoleInquiryUrl(businessObject);
super.buildInquirableLink(dataObject, propertyName, inquiry);
}else{
super.buildInquirableLink(dataObject, propertyName, inquiry);
}
}
@Override
public HtmlData getInquiryUrl(BusinessObject businessObject, String attributeName, boolean forceInquiry) {
/*
* - permission detail values (attribute name and value separated by colon, commas between attributes)
* - required role qualifiers (attribute name and value separated by colon, commas between attributes)
* - list of roles assigned: role type, role namespace, role name
*/
if(NAME.equals(attributeName) || NAME_TO_DISPLAY.equals(attributeName)){
List primaryKeys = new ArrayList();
primaryKeys.add(KimConstants.PrimaryKeyConstants.PERMISSION_ID);
]]>
_futureElements = null;
/**
* This constructor should never be called. It is only present for use during JAXB unmarshalling.
*/
private KrmsAttributeDefinition() {
]]>
actionRequestCodes) {
if ( (StringUtils.isEmpty(docTypeName)) &&
(StringUtils.isEmpty(ruleTemplateName)) &&
(StringUtils.isEmpty(ruleDescription)) &&
(StringUtils.isEmpty(groupId)) &&
(StringUtils.isEmpty(principalId)) &&
(extensionValues.isEmpty()) &&
(actionRequestCodes.isEmpty()) ) {
// all fields are empty
throw new IllegalArgumentException("At least one criterion must be sent");
}
RuleTemplateBo ruleTemplate = getRuleTemplateService().findByRuleTemplateName(ruleTemplateName);
String ruleTemplateId = null;
if (ruleTemplate != null) {
ruleTemplateId = ruleTemplate.getId();
}
if ( ( (extensionValues != null) && (!extensionValues.isEmpty()) ) &&
(ruleTemplateId == null) ) {
// cannot have extensions without a correct template
throw new IllegalArgumentException("A Rule Template Name must be given if using Rule Extension values");
}
Collection workgroupIds = new ArrayList();
if (principalId != null) {
]]>
)getSearchResultsUnbounded(lookupForm.getFieldsForLookup());
}
HashMap propertyTypes = new HashMap();
boolean hasReturnableRow = false;
List returnKeys = getReturnKeys();
List pkNames = getBusinessObjectMetaDataService().listPrimaryKeyFieldNames(getBusinessObjectClass());
Person user = GlobalVariables.getUserSession().getPerson();
// iterate through result list and wrap rows with return url and action urls
for (Iterator iter = displayList.iterator(); iter.hasNext();) {
BusinessObject element = (BusinessObject) iter.next();
if(element instanceof PersistableBusinessObject){
lookupForm.setLookupObjectId(((PersistableBusinessObject)element).getObjectId());
}
BusinessObjectRestrictions businessObjectRestrictions = getBusinessObjectAuthorizationService().getLookupResultRestrictions(element, user);
HtmlData returnUrl = getReturnUrl(element, lookupForm, returnKeys, businessObjectRestrictions);
String actionUrls = getActionUrls(element, pkNames, businessObjectRestrictions);
//Fix for JIRA - KFSMI-2417
if("".equals(actionUrls)){
actionUrls = ACTION_URLS_EMPTY;
}
]]>
userGroupIds = new ArrayList();
for(String id: KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(principalId)){
userGroupIds.add(id);
}
if (!userGroupIds.isEmpty()) {
groupCrit.in("delegatorGroupId", userGroupIds);
}
orCrit.or(userCrit);
orCrit.or(groupCrit);
crit.and(orCrit);
crit.eq("delegationType", DelegationType.PRIMARY.getCode());
filter.setDelegationType(DelegationType.PRIMARY.getCode());
filter.setExcludeDelegationType(false);
addToFilterDescription(filteredByItems, "Primary Delegator Id");
addedDelegationCriteria = true;
filterOn = true;
}
]]>
> values) {
if (StringUtils.isBlank(propertyPath)) {
throw new IllegalArgumentException("Property path cannot be null or blank.");
}
CriteriaSupportUtils.validateValuesForMultiValuedPredicate(values);
this.propertyPath = propertyPath;
if (values == null) {
this.values = Collections.emptySet();
} else {
final Set> temp = new HashSet>();
for (CriteriaValue> value: values) {
if (value != null) {
temp.add(value);
}
}
this.values = Collections.unmodifiableSet(temp);
}
}
@Override
public String getPropertyPath() {
return propertyPath;
}
@Override
public Set> getValues() {
return Collections.unmodifiableSet(values);
}
/**
* Defines some internal constants used on this class.
*/
static class Constants {
final static String ROOT_ELEMENT_NAME = "notIn";
]]>
parameters = proposition.getParameters();
if (parameters != null && parameters.size() == 3){
setParameterDisplayString(getParamValue(parameters.get(0))
+ " " + getParamValue(parameters.get(2))
+ " " + getParamValue(parameters.get(1)));
} else {
// should not happen
}
}
}
private String getParamValue(PropositionParameterBo prop){
if (PropositionParameterType.TERM.getCode().equalsIgnoreCase(prop.getParameterType())){
//TODO: use termBoService
String termId = prop.getValue();
TermBo term = getBoService().findBySinglePrimaryKey(TermBo.class,termId);
]]>
\r\n" );
for ( JoinColumn col : keys ) {
sb.append( " \r\n" );
}
sb.append( " \r\n" );
}
}
}
}
private static String getPropertyFromField( Class extends Object> clazz, String colName ) {
for ( Field field : clazz.getDeclaredFields() ) {
Column column = (Column)field.getAnnotation( Column.class );
if ( column != null ) {
if ( column.name().equals( colName ) ) {
return field.getName();
}
}
}
return "";
}
}
]]>
> originalCollections = orig.buildListOfDeletionAwareLists();
if (originalCollections != null && !originalCollections.isEmpty()) {
/*
* Prior to being saved, the version in the database will not yet reflect any deleted collections. So, a freshly
* retrieved version will contain objects that need to be removed:
*/
try {
List> copyCollections = copy.buildListOfDeletionAwareLists();
int size = originalCollections.size();
if (copyCollections.size() != size) {
throw new RuntimeException("size mismatch while attempting to process list of Collections to manage");
}
for (int i = 0; i < size; i++) {
Collection origSource = originalCollections.get(i);
Collection copySource = copyCollections.get(i);
List list = findUnwantedElements(copySource, origSource);
cleanse(template, origSource, list);
}
}
catch (ObjectRetrievalFailureException orfe) {
// object wasn't found, must be pre-save
}
}
}
]]>
formType() {
return UILayoutTestForm.class;
}
@Override
@RequestMapping(params = "methodToCall=start")
public ModelAndView start(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
HttpServletRequest request, HttpServletResponse response) {
UILayoutTestForm uiTestForm = (UILayoutTestForm) form;
return super.start(uiTestForm, result, request, response);
}
@RequestMapping(method = RequestMethod.POST, params = "methodToCall=save")
public ModelAndView save(@ModelAttribute("KualiForm") UILayoutTestForm uiTestForm, BindingResult result,
HttpServletRequest request, HttpServletResponse response) {
return getUIFModelAndView(uiTestForm, "page2");
}
@RequestMapping(method = RequestMethod.POST, params = "methodToCall=close")
public ModelAndView close(@ModelAttribute("KualiForm") UILayoutTestForm uiTestForm, BindingResult result,
HttpServletRequest request, HttpServletResponse response) {
return getUIFModelAndView(uiTestForm, "page1");
}
]]>
subscriptions = this.userPreferenceService.getCurrentSubscriptions(userid);
Map currentsubs = new HashMap();
Iterator i = subscriptions.iterator();
while (i.hasNext()) {
UserChannelSubscription sub = i.next();
String subid = Long.toString(sub.getChannel().getId());
currentsubs.put(subid, subid);
LOG.debug("currently subscribed to: "+sub.getChannel().getId());
}
// get all subscribable channels
Collection channels = this.notificationChannelService.getSubscribableChannels();
Map model = new HashMap();
model.put("channels", channels);
model.put("currentsubs", currentsubs);
return new ModelAndView(view, model);
}
]]>
getKeyLabels() {
return keyLabels;
}
public static final class Builder extends RemotableAbstractControl.Builder implements KeyLabeled {
private Map keyLabels;
private Builder(Map keyLabels) {
setKeyLabels(keyLabels);
}
public static Builder create(Map keyLabels) {
return new Builder(keyLabels);
}
@Override
public Map getKeyLabels() {
return keyLabels;
}
public void setKeyLabels(Map keyLabels) {
if (keyLabels == null || keyLabels.isEmpty()) {
throw new IllegalArgumentException("keyLabels must be non-null & non-empty");
}
this.keyLabels = Collections.unmodifiableMap(new HashMap(keyLabels));
}
@Override
public RemotableRadioButtonGroup build() {
]]>
(getPermissionDetailValues(dataObject));
}
return getPermissionService().isAuthorized(principalId, namespaceCode, permissionName,
permissionDetails, roleQualifiers);
}
public final boolean isAuthorizedByTemplate(Object dataObject, String namespaceCode, String permissionTemplateName,
String principalId, Map collectionOrFieldLevelPermissionDetails,
Map collectionOrFieldLevelRoleQualification) {
Map roleQualifiers = new HashMap(getRoleQualification(dataObject, principalId));
Map permissionDetails = new HashMap(getPermissionDetailValues(dataObject));
if (collectionOrFieldLevelRoleQualification != null) {
roleQualifiers.putAll(collectionOrFieldLevelRoleQualification);
}
if (collectionOrFieldLevelPermissionDetails != null) {
permissionDetails.putAll(collectionOrFieldLevelPermissionDetails);
}
return getPermissionService().isAuthorizedByTemplateName(principalId, namespaceCode,
permissionTemplateName, permissionDetails, roleQualifiers);
}
/**
* Returns a role qualification map based off data from the primary business
* object or the document. DO NOT MODIFY THE MAP RETURNED BY THIS METHOD
*
* @param primaryDataObjectOrDocument
* the primary data object (i.e. the main object instance behind
* the lookup result row or inquiry) or the document
* @return a Map containing role qualifications
*/
protected final Map getRoleQualification(Object primaryDataObjectOrDocument) {
]]>
roleIds = getRoleIdsForPermissionTemplate( namespaceCode, permissionTemplateName, permissionDetails);
if ( roleIds.isEmpty() ) {
return Collections.emptyList();
}
Collection roleMembers = roleService.getRoleMembers( roleIds,qualification);
List results = new ArrayList();
for ( RoleMembership rm : roleMembers ) {
List delegateBuilderList = new ArrayList();
if (!rm.getDelegates().isEmpty()) {
for (DelegateType delegate : rm.getDelegates()){
delegateBuilderList.add(DelegateType.Builder.create(delegate));
}
}
if ( rm.getMemberTypeCode().equals( Role.PRINCIPAL_MEMBER_TYPE ) ) {
results.add (Assignee.Builder.create(rm.getMemberId(), null, delegateBuilderList).build());
} else { // a group membership
]]>
getActionRequestCodes() {
return this.actionRequestCodes;
}
@Override
public String getResponsiblePrincipalId() {
return this.responsiblePrincipalId;
}
@Override
public String getResponsibleGroupId() {
return this.responsibleGroupId;
}
@Override
public String getResponsibleRoleName() {
return this.responsibleRoleName;
}
@Override
public Map getRuleExtensions() {
return this.ruleExtensions;
}
@Override
public boolean isActive() {
return this.active;
}
@Override
public boolean isConsiderGroupMembership() {
return this.considerGroupMembership;
}
@Override
public boolean isIncludeDelegations() {
return this.includeDelegations;
}
public void setRuleDescription(String ruleDescription) {
]]>
listCollectionObjectTypes(PersistableBusinessObject bo) {
// validate parameter
if (bo == null) {
throw new IllegalArgumentException("BO specified in the parameter was null.");
}
if (!(bo instanceof PersistableBusinessObject)) {
throw new IllegalArgumentException("BO specified [" + bo.getClass().getName() + "] must be a class that " + "inherits from BusinessObject.");
}
return listCollectionObjectTypes(bo.getClass());
}
/**
* @see org.kuali.rice.krad.service.PersistenceStructureService#listReferenceObjectFieldNames(org.kuali.rice.krad.bo.BusinessObject)
*/
public Map listReferenceObjectFields(PersistableBusinessObject bo) {
// validate parameter
if (bo == null) {
throw new IllegalArgumentException("BO specified in the parameter was null.");
}
if (!(bo instanceof PersistableBusinessObject)) {
throw new IllegalArgumentException("BO specified [" + bo.getClass().getName() + "] must be a class that " + "inherits from BusinessObject.");
}
return listReferenceObjectFields(bo.getClass());
}
public boolean isReferenceUpdatable(Class boClass, String referenceName) {
]]>
0) {
totalPrice = totalPrice - (totalPrice * entry.getDiscount().doubleValue() / 100);
}
}
entry.setTotalPrice(new KualiDecimal(totalPrice));
]]>
parameters) {
WebRuleUtils.processRuleForCopy(document.getDocumentNumber(), getOldRule(document), getNewRule(document));
super.processAfterCopy(document, parameters);
}
@Override
public void processAfterEdit(MaintenanceDocument document,
Map parameters) {
if (!getOldRule(document).getCurrentInd()) {
throw new RiceRuntimeException("Cannot edit a non-current version of a rule.");
}
WebRuleUtils.populateForCopyOrEdit(getOldRule(document), getNewRule(document));
getNewRule(document).setPreviousVersionId(getOldRule(document).getId());
getNewRule(document).setDocumentId(document.getDocumentHeader().getDocumentNumber());
super.processAfterEdit(document, parameters);
}
]]>
fieldConversionsMap = new HashMap();
Node fieldConversionsChildNode = lookupNode.getChildNodes().item(lcIndex);
if ("fieldConversions".equals(fieldConversionsChildNode)) {
for (int fcIndex = 0; fcIndex < fieldConversionsChildNode.getChildNodes().getLength(); fcIndex++) {
Node fieldConversionChildNode = fieldConversionsChildNode.getChildNodes().item(fcIndex);
if ("fieldConversion".equals(fieldConversionChildNode)) {
NamedNodeMap fieldConversionAttributes = fieldConversionChildNode.getAttributes();
String lookupFieldName = fieldConversionAttributes.getNamedItem("lookupFieldName").getNodeValue();
String localFieldName = fieldConversionAttributes.getNamedItem("localFieldName").getNodeValue();
fieldConversionsMap.put(lookupFieldName, localFieldName);
}
}
}
]]>
value;
@SuppressWarnings("unused")
@XmlAnyElement
private final Collection _futureElements = null;
/**
* Should only be invoked by JAXB.
*/
@SuppressWarnings("unused")
private NotEqualPredicate() {
]]>
0) {
actionItemMap.put(potentialActionItem.getDocumentId(), potentialActionItem);
}
}
return actionItemMap.values();
}
/**
* Creates an Action List from the given collection of Action Items. The Action List should
* contain only one action item per user. The action item chosen should be the most "critical"
* or "important" one on the document.
*
* @return the Action List as a Collection of ActionItems
*/
private Collection createActionListForRouteHeader(Collection actionItems) {
Map actionItemMap = new HashMap();
ActionListPriorityComparator comparator = new ActionListPriorityComparator();
for (ActionItem potentialActionItem: actionItems) {
ActionItem existingActionItem = actionItemMap.get(potentialActionItem.getPrincipalId());
if (existingActionItem == null || comparator.compare(potentialActionItem, existingActionItem) > 0) {
actionItemMap.put(potentialActionItem.getPrincipalId(), potentialActionItem);
}
}
return actionItemMap.values();
}
private Collection getActionItemsInActionList(Class objectsToRetrieve, String principalId, ActionListFilter filter) {
]]>
components;
try {
components = KRADServiceLocatorWeb.getRiceApplicationConfigurationMediationService().getNonDatabaseComponents();
} catch (DataDictionaryException ex) {
throw new RuntimeException(
"Problem parsing data dictionary during full load required for inquiry to function: " +
ex.getMessage(), ex);
}
for (Component pdt : components) {
if (parameterDetailTypeCode.equals(pdt.getCode()) &&
parameterNamespaceCode.equals(pdt.getNamespaceCode())) {
result = ComponentBo.from(pdt);
break;
}
}
}
return result;
}
]]>
workgroupIds) {
Set workgroupIdStrings = new HashSet();
for (Long workgroupId : workgroupIds) {
workgroupIdStrings.add(workgroupId.toString());
}
Criteria responsibilityCrit = new Criteria();
responsibilityCrit.addIn("ruleResponsibilityName", workgroupIds);
responsibilityCrit.addEqualTo("ruleResponsibilityType", KEWConstants.RULE_RESPONSIBILITY_GROUP_ID);
ReportQueryByCriteria query = QueryFactory.newReportQuery(RuleResponsibilityBo.class, responsibilityCrit);
query.setAttributes(new String[] { "ruleBaseValuesId" });
return query;
}
]]>
iterator = nodeInstance.getNextNodeInstances().iterator(); iterator.hasNext();) {
RouteNodeInstance routeNodeInstance = (RouteNodeInstance) iterator.next();
if (routeNodeInstance.getRouteNodeInstanceId() == null) {
routeNodeInstance.setRouteNodeInstanceId(context.getEngineState().getNextSimulationId());
}
}
if (nodeInstance.getProcess() != null && nodeInstance.getProcess().getRouteNodeInstanceId() == null) {
nodeInstance.getProcess().setRouteNodeInstanceId(context.getEngineState().getNextSimulationId());
}
if (nodeInstance.getBranch() != null && nodeInstance.getBranch().getBranchId() == null) {
nodeInstance.getBranch().setBranchId(context.getEngineState().getNextSimulationId());
}
}
}
]]>
queryParameters = new HashMap();
for (Object parameterName : request.getParameterMap().keySet()) {
if (parameterName.toString().startsWith(UifParameters.QUERY_PARAMETER + ".")) {
String fieldName = StringUtils.substringAfter(parameterName.toString(),
UifParameters.QUERY_PARAMETER + ".");
String fieldValue = request.getParameter(parameterName.toString());
queryParameters.put(fieldName, fieldValue);
}
}
// retrieve id for field to perform query for
String queryFieldId = request.getParameter(UifParameters.QUERY_FIELD_ID);
if (StringUtils.isBlank(queryFieldId)) {
throw new RuntimeException("Unable to find id for field to perform query on under request parameter name: "
+ UifParameters.QUERY_FIELD_ID);
}
]]>
> values;
@SuppressWarnings("unused")
@XmlAnyElement
private final Collection _futureElements = null;
/**
* Should only be invoked by JAXB.
*/
@SuppressWarnings("unused")
private NotInPredicate() {
]]>
setupModelForSendSimpleNotification(
HttpServletRequest request) {
Map model = new HashMap();
model.put("defaultSender", request.getRemoteUser());
model.put("channels", notificationChannelService
.getAllNotificationChannels());
model.put("priorities", businessObjectDao
.findAll(NotificationPriority.class));
// set sendDateTime to current datetime if not provided
String sendDateTime = request.getParameter("sendDateTime");
String currentDateTime = Util.getCurrentDateTime();
if (StringUtils.isEmpty(sendDateTime)) {
sendDateTime = currentDateTime;
}
model.put("sendDateTime", sendDateTime);
// retain the original date time or set to current if
// it was not in the request
if (request.getParameter("originalDateTime") == null) {
model.put("originalDateTime", currentDateTime);
} else {
model.put("originalDateTime", request.getParameter("originalDateTime"));
}
model.put("userRecipients", request.getParameter("userRecipients"));
]]>
newPkFields = getDataObjectMetaDataService().getPrimaryKeyFieldValues(newDataObject);
// TODO: Good suggestion from Aaron, dont bother checking the DB, if all of the
// objects PK fields dont have values. If any are null or empty, then
// we're done. The current way wont fail, but it will make a wasteful
// DB call that may not be necessary, and we want to minimize these.
// attempt to do a lookup, see if this object already exists by these Primary Keys
PersistableBusinessObject testBo = getBoService()
.findByPrimaryKey(dataObjectClass.asSubclass(PersistableBusinessObject.class), newPkFields);
// if the retrieve was successful, then this object already exists, and we need
// to complain
if (testBo != null) {
putDocumentError(KRADConstants.DOCUMENT_ERRORS,
RiceKeyConstants.ERROR_DOCUMENT_MAINTENANCE_KEYS_ALREADY_EXIST_ON_CREATE_NEW,
getHumanReadablePrimaryKeyFieldNames(dataObjectClass));
success &= false;
}
}
}
return success;
}
]]>
values) {
if (StringUtils.isBlank(propertyPath)) {
throw new IllegalArgumentException("Property path cannot be null or blank.");
}
this.propertyPath = propertyPath;
if (values == null) {
this.values = Collections.emptySet();
} else {
final Set temp = new HashSet();
for (CriteriaStringValue value: values) {
if (value != null) {
temp.add(value);
}
}
this.values = Collections.unmodifiableSet(temp);
}
}
@Override
public String getPropertyPath() {
return propertyPath;
}
@Override
public Set getValues() {
return Collections.unmodifiableSet(values);
}
/**
* Defines some internal constants used on this class.
*/
static class Constants {
final static String ROOT_ELEMENT_NAME = "notInIgnoreCase";
]]>
activeRequests = new ArrayList();
for ( ActionRequestValue ar : document.getActionRequests() ) {
if ( (ar.getCurrentIndicator() != null && ar.getCurrentIndicator()) && StringUtils.equals( ar.getStatus(), ActionRequestStatus.ACTIVATED.getCode() ) ) {
activeRequests.add(ar);
}
}
for (String actionTakenCode : actionMap.keySet())
{
List parameters = new ArrayList();
parameters.add(new DataDefinition(document));
parameters.add(new DataDefinition(principal));
ActionTakenEvent actionEvent = createAction(actionTakenCode, parameters);
if (StringUtils.isEmpty(actionEvent.validateActionRules(activeRequests)))
{
]]>
1) {
String expandedNot = SearchOperator.NOT + StringUtils.join(splitPropVal, SearchOperator.AND.op() + SearchOperator.NOT.op());
]]>
return value");
record.setReturnUrl(returnUrl.toString());
String destinationUrl = "report";
record.setDestinationUrl(destinationUrl);
displayList.add(ruleDelegation);
]]>
():origDelegationImplTemp.getMembers();
newKimDelegation.setMembers(getDelegationMembers(roleDocumentDelegation.getMembers(), origMembers, activatingInactive, newDelegationIdAssigned));
kimDelegations.add(newKimDelegation);
activatingInactive = false;
}
}
return kimDelegations;
}
protected List getDelegationMembers(List delegationMembers,
]]>
ticketContext = new HashMap();
ticketContext.put(KRADPropertyConstants.DOCUMENT_NUMBER, document.getDocumentNumber());
ticketContext.put(KRADConstants.CALLING_METHOD, caller);
ticketContext.put(KRADPropertyConstants.NAME, fieldName);
boolean questionAsked = GlobalVariables.getUserSession().hasMatchingSessionTicket(
KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET, ticketContext);
// start in logic for confirming the sensitive data
if (containsSensitiveData && warnForSensitiveData && !questionAsked) {
Object question = request.getParameter(KRADConstants.QUESTION_INST_ATTRIBUTE_NAME);
if (question == null || !KRADConstants.DOCUMENT_SENSITIVE_DATA_QUESTION.equals(question)) {
]]>
roleQualifier = new HashMap(getRoleQualification(form, methodToCall));
Map permissionDetails = KRADUtils.getNamespaceAndActionClass(this.getClass());
if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplateName(principalId,
KRADConstants.KRAD_NAMESPACE, KimConstants.PermissionTemplateNames.USE_SCREEN, permissionDetails,
roleQualifier)) {
throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(),
methodToCall, this.getClass().getSimpleName());
}
}
/**
* Override this method to add data from the form for role qualification in
* the authorization check
*/
protected Map getRoleQualification(UifFormBase form, String methodToCall) {
]]>
delegatorGroupIds = KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(
principalId);
if (delegatorGroupIds != null && !delegatorGroupIds.isEmpty()) {
groupCrit.addIn("delegatorGroupId", delegatorGroupIds);
}
orCrit.addOrCriteria(userCrit);
orCrit.addOrCriteria(groupCrit);
crit.addAndCriteria(orCrit);
crit.addEqualTo("delegationType", DelegationType.PRIMARY.getCode());
filter.setDelegationType(DelegationType.PRIMARY.getCode());
filter.setExcludeDelegationType(false);
addToFilterDescription(filteredByItems, "Primary Delegator Id");
addedDelegationCriteria = true;
filterOn = true;
}
]]>
value;
@SuppressWarnings("unused")
@XmlAnyElement
private final Collection _futureElements = null;
/**
* Should only be invoked by JAXB.
*/
@SuppressWarnings("unused")
private LessThanPredicate() {
]]>
clazz, StringBuffer sb ) {
for ( Field field : clazz.getDeclaredFields() ) {
JoinColumns multiKey = (JoinColumns)field.getAnnotation( JoinColumns.class );
JoinColumn singleKey = (JoinColumn)field.getAnnotation( JoinColumn.class );
if ( multiKey != null || singleKey != null ) {
List keys = new ArrayList();
if ( singleKey != null ) {
keys.add( singleKey );
}
if ( multiKey != null ) {
for ( JoinColumn col : multiKey.value() ) {
keys.add( col );
}
}
]]>
getConfiguration() {
return this.configuration;
}
@Override
public Long getVersionNumber() {
return this.versionNumber;
}
public void setId(String id) {
]]>
primaryKeys = new ArrayList();
primaryKeys.add("code");
NamespaceBo parameterNamespace = new NamespaceBo();
parameterNamespace.setCode((String)ObjectUtils.getPropertyValue(businessObject, attributeName));
return getInquiryUrlForPrimaryKeys(NamespaceBo.class, parameterNamespace, primaryKeys, null);
} else if(DETAIL_OBJECTS.equals(attributeName)){
//return getAttributesInquiryUrl(businessObject, DETAIL_OBJECTS);
} else if(ASSIGNED_TO_ROLES.equals(attributeName)){
return getAssignedRoleInquiryUrl(businessObject);
}
return super.getInquiryUrl(businessObject, attributeName, forceInquiry);
}
]]>
getConfigurationParameters() {
]]>
getTargetPrincipalIds() {
return this.targetPrincipalIds;
}
@Override
public String getRoutingPrincipalId() {
return this.routingPrincipalId;
}
@Override
public String getDocumentTypeName() {
return this.documentTypeName;
}
@Override
public String getXmlContent() {
return this.xmlContent;
}
@Override
public List getRuleTemplateNames() {
return this.ruleTemplateNames;
}
@Override
public List getNodeNames() {
return this.nodeNames;
}
@Override
public List getActionsToTake() {
]]>
getState() {
return this.state;
}
@Override
public String getDocumentId() {
return this.documentId;
}
@Override
public String getBranchId() {
return this.branchId;
}
@Override
public String getRouteNodeId() {
return this.routeNodeId;
}
@Override
public String getProcessId() {
return this.processId;
}
@Override
public boolean isActive() {
return this.active;
}
@Override
public boolean isComplete() {
return this.complete;
}
@Override
public boolean isInitial() {
return this.initial;
}
@Override
public String getId() {
return this.id;
}
@Override
public List getNextNodeInstances() {
]]>
Collection findMatching(Class clazz, Map fieldValues);
/**
* Finds all entities matching the passed in Rice JPA criteria
*
* @param the type of the entity that will be returned
* @param criteria the criteria to form the query with
* @return a Collection (most likely a List) of all matching entities
*/
//public abstract Collection findMatching(Criteria criteria);
/**
* This method retrieves a count of the business objects populated with data which match the criteria in the given Map.
*
* @param clazz
* @param fieldValues
* @return number of businessObjects of the given class whose fields match the values in the given expected-value Map
*/
public int countMatching(Class clazz, Map fieldValues);
/**
* This method retrieves a count of the business objects populated with data which match both the positive criteria
* and the negative criteria in the given Map.
*
* @param clazz
* @param positiveFieldValues
* @param negativeFieldValues
* @return number of businessObjects of the given class whose fields match the values in the given expected-value Maps
*/
public int countMatching(Class clazz, Map positiveFieldValues, Map negativeFieldValues);
/**
* This method retrieves a collection of business objects populated with data, such that each record in the database populates a
* new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs,
* specifically attribute name and its expected value. Performs an order by on sort field.
*
* @param clazz
* @param fieldValues
* @return
*/
public Collection findMatchingOrderBy(Class clazz, Map fieldValues, String sortField, boolean sortAscending);
/**
* Deletes a business object from the database.
*
* @param bo
*/
public void delete(PersistableBusinessObject bo);
/**
* Deletes each business object in the given List.
*
* @param boList
*/
public void delete(List extends PersistableBusinessObject> boList);
/**
* Deletes the object(s) matching the given field values
*
* @param clazz
* @param fieldValues
*/
public void deleteMatching(Class clazz, Map fieldValues);
/**
*
* This method attempts to retrieve the reference from a BO if it exists.
*
* @param bo - populated BusinessObject instance that includes the referenceName property
* @param referenceName - name of the member/property to load
* @return A populated object from the DB, if it exists
*
*/
public BusinessObject getReferenceIfExists(BusinessObject bo, String referenceName);
]]>
las = roleIdToMembershipMap.get(roleMemberBo.getRoleId());
if (las == null) {
las = new ArrayList();
roleIdToMembershipMap.put(roleMemberBo.getRoleId(), las);
}
RoleMembership mi = RoleMembership.Builder.create(
roleMemberBo.getRoleId(),
roleMemberBo.getRoleMemberId(),
roleMemberBo.getMemberId(),
roleMemberBo.getMemberTypeCode(),
roleMemberBo.getAttributes()).build();
las.add(mi);
} else {
results.add(roleMemberBo.getAttributes());
}
} else if (roleMemberBo.getMemberTypeCode().equals(Role.ROLE_MEMBER_TYPE)) {
]]>
extensionValues) {
Criteria crit = new Criteria();
crit.addEqualTo("currentInd", Boolean.TRUE);
crit.addEqualTo("templateRuleInd", Boolean.FALSE);
if (activeInd != null) {
crit.addEqualTo("active", activeInd);
}
if (docTypeName != null) {
crit.addLike("UPPER(docTypeName)", docTypeName.toUpperCase());
}
if (ruleDescription != null && !ruleDescription.trim().equals("")) {
crit.addLike("UPPER(description)", ruleDescription.toUpperCase());
}
if (ruleTemplateId != null) {
crit.addEqualTo("ruleTemplateId", ruleTemplateId);
}
if (extensionValues != null && !extensionValues.isEmpty()) {
]]>
());
person.setExternalIdentifiers(new ArrayList());
final EntityExternalIdentifier.Builder externalId = EntityExternalIdentifier.Builder.create();
externalId.setExternalIdentifierTypeCode(getConstants().getTaxExternalIdTypeCode());
externalId.setExternalId(entityId);
person.getExternalIdentifiers().add(externalId);
person.setAffiliations((List) getAffiliationMapper().mapFromContext(context));
person.setEntityTypes(new ArrayList());
]]>
")
|| propertyValue.startsWith("<") ) ) {
addStringRangeCriteria(propertyName, propertyValue, criteria);
} else {
if (treatWildcardsAndOperatorsAsLiteral) {
propertyValue = StringUtils.replace(propertyValue, "*", "\\*");
}
criteria.addLike(propertyName, propertyValue);
]]>
();
}
/**
* The number of property elements in this state object.
*
* @return
*/
public int numPropertyElements() {
return pathElements.size();
}
/**
* Adds an additional state element into this object.
*
* @param elementName
* @param propertyType the type of the property when it was serialized
*/
public void addSerializedProperty(String elementName, PropertyType propertyType) {
SerializationPropertyElement serializationPropertyElement = new SerializationPropertyElement(elementName, propertyType);
pathElements.add(serializationPropertyElement);
}
/**
* Removes the last added serialized property
*
*/
public void removeSerializedProperty() {
pathElements.remove(pathElements.size() - 1);
}
/**
* Retrieves the element name of the state element. A parameter value of 0 represents the first element that was added
* by calling {@link #addSerializedProperty(String, PropertyType)} that hasn't been removed, and a value of
* {@link #numPropertyElements()} - 1 represents the element last added that hasn't been removed.
*
* @param propertyIndex most be between 0 and the value returned by {@link #numPropertyElements()} - 1
* @return
*/
public String getElementName(int propertyIndex) {
return pathElements.get(propertyIndex).getElementName();
}
/**
* Retrieves the property type of the state element. A parameter value of 0 represents the first element that was added
* by calling {@link #addSerializedProperty(String, PropertyType)} that hasn't been removed, and a value of
* {@link #numPropertyElements()} - 1 represents the element last added that hasn't been removed.
*
* @param propertyIndex most be between 0 and the value returned by {@link #numPropertyElements()} - 1
* @return
*/
public PropertyType getPropertyType(int propertyIndex) {
return pathElements.get(propertyIndex).getPropertyType();
}
}
]]>
groupIds, String namespaceCode, String roleName, Map qualification){
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId was null or blank");
}
if (groupIds == null) {
throw new RiceIllegalArgumentException("groupIds was null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode was null or blank");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName was null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification was null");
}
]]>
0) {
if (cleanedValue.charAt(0) == '-') {
cleanedValue = "-" + cleanedValue.replaceAll("-", "");
} else {
cleanedValue = cleanedValue.replaceAll("-", "");
}
}
// ensure only one decimal in the string
int decimalLoc = cleanedValue.lastIndexOf('.');
if (cleanedValue.indexOf('.') != decimalLoc) {
cleanedValue = cleanedValue.substring(0, decimalLoc).replaceAll("\\.", "") + cleanedValue.substring(decimalLoc);
}
]]>
());
}
public final boolean canMaintain(Object dataObject, Person user) {
Map permissionDetails = new HashMap(2);
permissionDetails.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME,
]]>
getDelegationRules() {
]]>
permissionDetails = new HashMap();
permissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, parm.getNamespaceCode());
permissionDetails.put(KimConstants.AttributeConstants.COMPONENT_NAME, parm.getComponentCode());
permissionDetails.put(KimConstants.AttributeConstants.PARAMETER_NAME, parm.getName());
allowsEdit = KimApiServiceLocator.getPermissionService().isAuthorizedByTemplateName(
GlobalVariables.getUserSession().getPerson().getPrincipalId(),
KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.MAINTAIN_SYSTEM_PARAMETER,
permissionDetails, Collections.emptyMap());
]]>
additionalPermissionDetails = new HashMap();
if (attachmentTypeCode != null) {
additionalPermissionDetails.put(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE,
attachmentTypeCode);
}
return isAuthorizedByTemplate(document, KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.ADD_NOTE_ATTACHMENT, user
.getPrincipalId(), additionalPermissionDetails, null);
]]>
getParametersFromRequest(Map requestParameters) {
Map parameters = new HashMap();
if (requestParameters.containsKey(UifParameters.VIEW_NAME)) {
parameters.put(UifParameters.VIEW_NAME, requestParameters.get(UifParameters.VIEW_NAME));
}
else {
parameters.put(UifParameters.VIEW_NAME, UifConstants.DEFAULT_VIEW_NAME);
}
if (requestParameters.containsKey(UifParameters.DATA_OBJECT_CLASS_NAME)) {
parameters.put(UifParameters.DATA_OBJECT_CLASS_NAME,
requestParameters.get(UifParameters.DATA_OBJECT_CLASS_NAME));
}
else if (requestParameters.containsKey(KRADPropertyConstants.DOC_ID)) {
]]>
groupIds, String namespaceCode, String roleName, Map qualification){
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId was null or blank");
}
if (groupIds == null) {
throw new RiceIllegalArgumentException("groupIds was null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode was null or blank");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName was null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification was null");
}
// FIXME: dangerous - data changes could cause an infinite loop - should add thread-local to trap state and abort
return getPermissionService().isAuthorizedByTemplateName(principalId, permissionTemplateNamespace, permissionTemplateName, new HashMap(qualification), new HashMap(qualification));
]]>
getParametersFromRequest(Map requestParameters) {
Map parameters = new HashMap();
if (requestParameters.containsKey(UifParameters.VIEW_NAME)) {
parameters.put(UifParameters.VIEW_NAME, requestParameters.get(UifParameters.VIEW_NAME));
}
else {
parameters.put(UifParameters.VIEW_NAME, UifConstants.DEFAULT_VIEW_NAME);
}
if (requestParameters.containsKey(UifParameters.DATA_OBJECT_CLASS_NAME)) {
parameters.put(UifParameters.DATA_OBJECT_CLASS_NAME,
requestParameters.get(UifParameters.DATA_OBJECT_CLASS_NAME));
}
]]>
groupIds, String namespaceCode, String roleName, Map qualification) {
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId was null or blank");
}
if (groupIds == null) {
throw new RiceIllegalArgumentException("groupIds was null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode was null or blank");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName was null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification was null");
}
]]>
m = persistenceStructureService.listCollectionObjectTypes(o.getClass());
c = m.get(parts[0]);
}
// Look into the attribute class to see if it is writeable.
try {
i = c.newInstance();
StringBuffer sb = new StringBuffer();
for (int x = 1; x < parts.length; x++) {
sb.append(1 == x ? "" : ".").append(parts[x]);
}
b = isWriteable(i, sb.toString(), persistenceStructureService);
]]>
getFlattenedNodes(ProcessDefinitionBo process) {
Map nodesMap = new HashMap();
if (process.getInitialRouteNode() != null) {
flattenNodeGraph(nodesMap, process.getInitialRouteNode());
List nodes = new ArrayList(nodesMap.values());
Collections.sort(nodes, new RouteNodeSorter());
return nodes;
} else {
List nodes = new ArrayList();
nodes.add(new RouteNode());
return nodes;
}
}
/**
* Recursively walks the node graph and builds up the map. Uses a map because we will
* end up walking through duplicates, as is the case with Join nodes.
*/
private void flattenNodeGraph(Map nodes, RouteNode node) {
]]>
getAuthorizedPermissionsByTemplateName( String principalId, String namespaceCode, String permissionTemplateName, Map permissionDetails, Map qualification ) {
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId is null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode is null or blank");
}
if (StringUtils.isBlank(permissionTemplateName)) {
throw new RiceIllegalArgumentException("permissionTemplateName is null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification is null");
}
if (permissionDetails == null) {
throw new RiceIllegalArgumentException("permissionDetails is null");
}
// get all the permission objects whose name match that requested
List permissions = getPermissionImplsByTemplateName( namespaceCode, permissionTemplateName );
]]>
getAuthorizedPermissions( String principalId, String namespaceCode, String permissionName, Map permissionDetails, Map qualification ) {
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId is null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode is null or blank");
}
if (StringUtils.isBlank(permissionName)) {
throw new RiceIllegalArgumentException("permissionName is null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification is null");
}
if (permissionDetails == null) {
throw new RiceIllegalArgumentException("permissionDetails is null");
}
// get all the permission objects whose name match that requested
List permissions = getPermissionImplsByName( namespaceCode, permissionName );
]]>
)} and checks the results.
*
*/
@Override
public boolean hasApplicationRole(String principalId, List groupIds, String namespaceCode, String roleName, Map qualification) {
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId was null or blank");
}
if (groupIds == null) {
throw new RiceIllegalArgumentException("groupIds was null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode was null or blank");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName was null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification was null or blank");
]]>
)} and checks the results.
*
*/
@Override
public boolean hasApplicationRole(String principalId, List groupIds, String namespaceCode, String roleName, Map qualification) {
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId was null or blank");
}
if (groupIds == null) {
throw new RiceIllegalArgumentException("groupIds was null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode was null or blank");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName was null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification was null or blank");
]]>
_futureElements = null;
/**
* Private constructor used only by JAXB.
*
*/
private EntityName() {
]]>
roleQualifier = new HashMap(getRoleQualification(form, methodToCall));
Map permissionDetails = KRADUtils.getNamespaceAndActionClass(this.getClass());
if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplateName(principalId, KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.USE_SCREEN, permissionDetails, roleQualifier ))
{
throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(),
]]>
findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName, String documentType, String reviewerName, String type) {
Criteria crit = new Criteria();
]]>
_futureElements = null;
/**
* This constructor should never be called. It is only present for use during JAXB unmarshalling.
*/
private CampusType() {
]]>
(tr.getParameterNames()));
}
if (parameters != null){
this.parameters = Collections.unmodifiableMap(new HashMap(parameters));
} else {
this.parameters = null;
}
}
]]>
paramMap) {
if (StringUtils.isBlank(attributeName)) {
throw new RiceIllegalArgumentException("attributeName was null or blank");
}
WorkflowRuleAttribute attribute = loadAttribute(attributeName);
List errors = attribute.validateRoutingData(paramMap);
ValidationResults.Builder builder = ValidationResults.Builder.create();
for (WorkflowServiceError error : errors) {
builder.addError(error.getArg1(), error.getMessage());
}
return builder.build();
}
@Override
public ValidationResults validateRuleData(@WebParam(name = "attributeName") String attributeName, Map paramMap) {
]]>
0 ? ", " : "";
filteredByItems += "Document Route Status";
}
if (filter.getDocumentTitle() != null && !"".equals(filter.getDocumentTitle().trim())) {
String docTitle = filter.getDocumentTitle();
if (docTitle.trim().endsWith("*")) {
docTitle = docTitle.substring(0, docTitle.length() - 1);
}
if (filter.isExcludeDocumentTitle()) {
crit.addNotLike("docTitle", "%" + docTitle + "%");
]]>
subList) {
]]>
responsibilityIds = new HashSet();
Map rulesToSave = new HashMap();
Collections.sort(rules, new RuleDelegationSorter());
]]>
subscriptions = this.userPreferenceService.getCurrentSubscriptions(userid);
Map currentsubs = new HashMap();;
Iterator i = subscriptions.iterator();
while (i.hasNext()) {
UserChannelSubscription sub = i.next();
String subid = Long.toString(sub.getChannel().getId());
currentsubs.put(subid, subid);
LOG.debug("currently subscribed to: "+sub.getChannel().getId());
}
]]>
> getNestedRoleQualifiersForPrincipal(String principalId, String namespaceCode, String roleName, Map qualification) {
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId is blank or null");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode is blank or null");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName is blank or null");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification is null");
}
String roleId = getRoleIdByNameAndNamespaceCode(namespaceCode, roleName);
if (roleId == null) {
return new ArrayList
"+newStatusCode);
PostProcessor postProcessor = routeHeader.getDocumentType().getPostProcessor();
ProcessDocReport report = postProcessor.doRouteStatusChange(statusChangeEvent);
if (!report.isSuccess()) {
LOG.warn(report.getMessage(), report.getProcessException());
throw new InvalidActionTakenException(report.getMessage());
}
} catch (Exception ex) {
]]>
to) {
int tmp = from;
from = to;
to = tmp;
}
int num;
// not very random huh...
if (from == to) {
num = from;
]]>
roleQualifier = new HashMap(getRoleQualification(form, methodToCall));
Map permissionDetails = KRADUtils.getNamespaceAndActionClass(this.getClass());
if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplateName(principalId,
KRADConstants.KRAD_NAMESPACE, KimConstants.PermissionTemplateNames.USE_SCREEN, permissionDetails,
roleQualifier)) {
throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(),
]]>
ruleTemplateAttributes = ruleTemplate.getActiveRuleTemplateAttributes();
Collections.sort(ruleTemplateAttributes);
List rows = new ArrayList();
for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
if (!ruleTemplateAttribute.isWorkflowAttribute()) {
continue;
}
WorkflowRuleAttribute workflowAttribute = ruleTemplateAttribute.getWorkflowAttribute();
RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
if (ruleAttribute.getType().equals(KEWConstants.RULE_XML_ATTRIBUTE_TYPE)) {
((GenericXMLRuleAttribute) workflowAttribute).setExtensionDefinition(RuleAttribute.to(ruleAttribute));
}
]]>