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(KewApiConstants.WORKFLOW_DOCUMENT_MAP_ATTR_NAME); if (workflowDocMap == null) { workflowDocMap = new HashMap(); userSession.addObject(KewApiConstants.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(KewApiConstants.WORKFLOW_DOCUMENT_MAP_ATTR_NAME); if (workflowDocMap == null) { workflowDocMap = new HashMap(); } workflowDocMap.put(document.getDocumentId(), document); userSession.addObject(KewApiConstants.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; } ]]> 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.getMemberType()!=null && org.apache.commons.lang.ObjectUtils.equals(origRoleMemberImpl.getMemberType(), newRoleMember.getMemberType())) && !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; } ]]> getAttributes() { return attributes; } public void setAttributes(Map attributes) { this.attributes = Collections.unmodifiableMap(Maps.newHashMap(attributes)); } @Override public Responsibility build() { ]]> 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(KewApiConstants.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"); } ]]> 0) { recipientsExist = true; for (String userRecipientId : userRecipients) { if (isUserRecipientValid(userRecipientId, errors)) { NotificationRecipient recipient = new NotificationRecipient(); recipient.setRecipientType(KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.getCode()); 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.getCode()); 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; ]]> 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); } ]]> 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()) { ]]> 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", KewApiConstants.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 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; } } ]]> > Object getVal(U toConv) { Object o = toConv.getValue(); if (o instanceof DateTime) { return new Timestamp(((DateTime) o).getMillis()); } return o; } //this is unsafe b/c values could be converted resulting in a classcast exception @SuppressWarnings("unchecked") private static > Set getValsUnsafe(Set toConv) { return (Set) getVals(toConv); } private static Set getVals(Set> toConv) { final Set values = new HashSet(); for (CriteriaValue value : toConv) { values.add(getVal(value)); } return values; } //eliding performance for function composition.... private static Set toUpper(Set strs) { final Set values = new HashSet(); for (String value : strs) { values.add(value.toUpperCase()); } return values; } private String getUpperFunction() { ]]> 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"); } ]]> 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 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 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); } ]]> predicates = new ArrayList(); //principalId doesn't exist on 'Group'. Lets do this predicate conversion separately if (StringUtils.isNotBlank(criteriaMap.get(KimConstants.UniqueKeyConstants.PRINCIPAL_NAME))) { String principalId = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName( criteriaMap.get(KimConstants.UniqueKeyConstants.PRINCIPAL_NAME)).getPrincipalId(); Timestamp currentTime = new Timestamp(Calendar.getInstance().getTimeInMillis()); predicates.add(and(equal("members.memberId", principalId), equal("members.typeCode", KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.getCode()), and(or(isNull( "members.activeFromDateValue"), greaterThanOrEqual("members.activeFromDateValue", currentTime)), or(isNull("members.activeToDateValue"), lessThan("members.activeToDateValue", currentTime))))); } criteriaMap.remove(KimConstants.UniqueKeyConstants.PRINCIPAL_NAME); predicates.add(PredicateUtils.convertMapToPredicate(criteriaMap)); criteria.setPredicates(and(predicates.toArray(new Predicate[predicates.size()]))); } GroupQueryResults groupResults = getGroupService().findGroups(criteria.build()); ]]> 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)); } ]]> 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 List getAdditionalDocumentTypeNames() { return additionalDocumentTypeNames; ]]> )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() { ]]> 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) { ]]> roles = getKimRoleService().findRoles(toQuery(fieldValues)).getResults(); List roleEbos = new ArrayList(roles.size()); for (Role role : roles) { roleEbos.add(RoleEbo.from(role)); } return (List)roleEbos; } else if (GroupContract.class.isAssignableFrom( externalizableBusinessObjectClass)) { List groups = getGroupService().findGroups(toQuery(fieldValues)).getResults(); List groupEbos = new ArrayList(groups.size()); for (Group group : groups) { groupEbos.add(GroupEbo.from(group)); } return (List)groupEbos; } // otherwise, use the default implementation return super.getExternalizableBusinessObjectsListForLookup(externalizableBusinessObjectClass, fieldValues, unbounded); ]]> )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"; ]]> \r\n" ); for ( JoinColumn col : keys ) { sb.append( " \r\n" ); } sb.append( " \r\n" ); } } } } private static String getPropertyFromField( Class 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 ""; } } ]]> > getDocumentAttributeValues() { return this.documentAttributeValues; } @Override public String getSaveName() { return this.saveName; ]]> > 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 } } } ]]> 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); } ]]> (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 ( MemberType.PRINCIPAL.equals(rm.getMemberType()) ) { 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).setPreviousRuleId(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 LessThanPredicate() { ]]> value; @SuppressWarnings("unused") @XmlAnyElement private final Collection _futureElements = null; /** * Should only be invoked by JAXB. */ @SuppressWarnings("unused") private NotEqualPredicate() { ]]> criteria.getMaxResults()) { results.setMoreResultsAvailable(true); //remove the extra row that was returned rows.remove(criteria.getMaxResults().intValue()); } results.setResults(transformResults(rows, transform)); return results.build(); } private static List transformResults(List results, LookupCustomizer.Transform transform) { final List list = new ArrayList(); for (T r : results) { list.add(transform.apply(r)); } return list; } /** gets results where only the count is requested. */ private GenericQueryResults forCountOnly(final Class queryClass, final QueryByCriteria criteria, final Criteria ojbCriteria) { ]]> 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) { ]]> workgroupIds) { Set workgroupIdStrings = new HashSet(); for (Long workgroupId : workgroupIds) { workgroupIdStrings.add(workgroupId.toString()); } Criteria responsibilityCrit = new Criteria(); responsibilityCrit.addIn("ruleResponsibilityName", workgroupIds); responsibilityCrit.addEqualTo("ruleResponsibilityType", KewApiConstants.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")); ]]> 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(); ]]> 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); ]]> GenericQueryResults forRowResults(final Class queryClass, final QueryByCriteria criteria, final Criteria ojbCriteria, CountFlag flag, LookupCustomizer.Transform transform) { ]]> ():origDelegationImplTemp.getMembers(); newKimDelegation.setMembers(getDelegationMembers(roleDocumentDelegation.getMembers(), origMembers, activatingInactive, newDelegationIdAssigned)); kimDelegations.add(newKimDelegation); activatingInactive = false; } } return kimDelegations; } protected List getDelegationMembers(List delegationMembers, ]]> 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"); } ]]> 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; } ]]> 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 ); } } ]]> GenericQueryResults lookup(final Class queryClass, final QueryByCriteria criteria) { return lookup(queryClass, criteria, LookupCustomizer.Builder.create().build()); } @Override public GenericQueryResults lookup(final Class queryClass, final QueryByCriteria criteria, LookupCustomizer customizer) { if (queryClass == null) { throw new IllegalArgumentException("queryClass is null"); } if (criteria == null) { throw new IllegalArgumentException("criteria is null"); } if (customizer == null) { throw new IllegalArgumentException("customizer is null"); } final Criteria parent = new Criteria(); ]]> 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 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); ]]> * * * * * jitrue * * * 0000394389 * * * * * */ if (param.getParamValue().length() == 0 && required == true) { ]]> 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.getMemberType(), roleMemberBo.getAttributes()).build(); las.add(mi); } else { results.add(roleMemberBo.getAttributes()); } } else if (MemberType.ROLE.equals(roleMemberBo.getMemberType())) { ]]> 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() { ]]> 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)); ]]> qualification = getRoleQualification(form, methodToCall); if(!KimApiServiceLocator.getPermissionService().isAuthorized(principalId, namespaceCode, permissionName, permissionDetails, qualification)) { ParameterService parameterSerivce = CoreFrameworkServiceLocator.getParameterService(); String messageParamNamespaceCode = moduleService.getModuleConfiguration().getNamespaceCode(); String messageParamComponentCode = KRADConstants.DetailTypes.OLTP_LOCKOUT_DETAIL_TYPE; String messageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_MESSAGE_PARM; String lockoutMessage = parameterSerivce.getParameterValueAsString(messageParamNamespaceCode, messageParamComponentCode, messageParamName); if(StringUtils.isBlank(lockoutMessage)) { String defaultMessageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_DEFAULT_MESSAGE; lockoutMessage = parameterSerivce.getParameterValueAsString(KRADConstants.KRAD_NAMESPACE, messageParamComponentCode, defaultMessageParamName); } request.setAttribute(MODULE_LOCKED_MESSAGE, lockoutMessage); ]]> 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) { ]]> getAttributeFields(@WebParam(name = "krmsTypeId") String krmsTypeId) throws RiceIllegalArgumentException { if (StringUtils.isBlank(krmsTypeId)) { throw new RiceIllegalArgumentException("krmsTypeId must be non-null and non-blank"); } List results = new ArrayList(); // keep track of how to sort these final Map sortCodeMap = new HashMap(); KrmsTypeDefinition krmsType = KrmsRepositoryServiceLocator.getKrmsTypeRepositoryService().getTypeById(krmsTypeId); if (krmsType == null) { throw new RiceIllegalArgumentException("krmsTypeId must be a valid id of a KRMS type"); } else { // translate attributes List typeAttributes = krmsType.getAttributes(); ]]> )} 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"); ]]> rules) { PerformanceLogger performanceLogger = new PerformanceLogger(); boolean isGenerateRuleArs = true; String generateRuleArs = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(KewApiConstants.KEW_NAMESPACE, KRADConstants.DetailTypes.RULE_DETAIL_TYPE, KewApiConstants.RULE_GENERATE_ACTION_REQESTS_IND); if (!StringUtils.isBlank(generateRuleArs)) { isGenerateRuleArs = KewApiConstants.YES_RULE_CHANGE_AR_GENERATION_VALUE.equalsIgnoreCase(generateRuleArs); } Set responsibilityIds = new HashSet(); Map rulesToSave = new HashMap(); Collections.sort(rules, new RuleDelegationSorter()); ]]> )} 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) { ]]> 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()); } ]]> "+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(KewApiConstants.RULE_XML_ATTRIBUTE_TYPE)) { ((GenericXMLRuleAttribute) workflowAttribute).setExtensionDefinition(RuleAttribute.to(ruleAttribute)); } ]]>