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 (ruleTemplateNameParam != null && !ruleTemplateNameParam.equals("")) { rows = new ArrayList(); RuleTemplate ruleTemplate = null; ruleTemplate = getRuleTemplateService().findByRuleTemplateName(ruleTemplateNameParam); int i = 0; for (Iterator iter = ruleTemplate.getActiveRuleTemplateAttributes().iterator(); iter.hasNext();) { RuleTemplateAttribute ruleTemplateAttribute = (RuleTemplateAttribute) iter.next(); if (!ruleTemplateAttribute.isWorkflowAttribute()) { continue; } WorkflowAttribute attribute = ruleTemplateAttribute.getWorkflowAttribute(); RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute(); if (ruleAttribute.getType().equals(KEWConstants.RULE_XML_ATTRIBUTE_TYPE)) { ((GenericXMLRuleAttribute) attribute).setRuleAttribute(ruleAttribute); } // run through the attributes fields once to populate field values we have to do this // to allow rows dependent on another row value to populate correctly in the loop below List searchRows = null; if (attribute instanceof OddSearchAttribute) { searchRows = ((OddSearchAttribute) attribute).getSearchRows(); } else { searchRows = attribute.getRuleRows(); } for (Iterator iterator = searchRows.iterator(); iterator.hasNext();) { Row row = iterator.next(); List fields = new ArrayList(); for (Iterator iterator2 = row.getFields().iterator(); iterator2.hasNext();) { Field field = (Field) iterator2.next(); if (fieldValues.get(field.getPropertyName()) != null) { field.setPropertyValue(fieldValues.get(field.getPropertyName())); } fields.add(field); fieldValues.put(field.getPropertyName(), field.getPropertyValue()); } } if (attribute instanceof OddSearchAttribute) { ((OddSearchAttribute) attribute).validateSearchData(fieldValues); } else { attribute.validateRuleData(fieldValues);// populate attribute } if (attribute instanceof OddSearchAttribute) { searchRows = ((OddSearchAttribute) attribute).getSearchRows(); } else { searchRows = attribute.getRuleRows(); } for (Iterator iterator = searchRows.iterator(); iterator.hasNext();) { Row row = (Row) iterator.next(); List fields = new ArrayList(); for (Iterator iterator2 = row.getFields().iterator(); iterator2.hasNext();) { Field field = iterator2.next(); if (fieldValues.get(field.getPropertyName()) != null) { field.setPropertyValue(fieldValues.get(field.getPropertyName())); } fields.add(field); fieldValues.put(field.getPropertyName(), field.getPropertyValue()); } row.setFields(fields); rows.add(row); } } return true; } rows.clear(); return false; } @Override public List getSearchResults(Map fieldValues) { List errors = new ArrayList(); String parentRuleBaseValueId = (String) fieldValues.get(PARENT_RULE_ID_PROPERTY_NAME); ]]> 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); } ]]> assignedToRoles = new TypedArrayList(RoleImpl.class); protected String assignedToRoleNamespaceForLookup; protected String assignedToRoleNameForLookup; protected RoleImpl assignedToRole; protected String assignedToPrincipalNameForLookup; protected Person assignedToPrincipal; protected String assignedToGroupNamespaceForLookup; protected String assignedToGroupNameForLookup; protected GroupImpl assignedToGroup; protected String attributeName; protected String attributeValue; protected String detailCriteria; /** * @return the assignedToRoles */ public String getAssignedToRolesToDisplay() { StringBuffer assignedToRolesToDisplay = new StringBuffer(); for(RoleImpl roleImpl: assignedToRoles){ assignedToRolesToDisplay.append(getRoleDetailsToDisplay(roleImpl)); } return StringUtils.chomp( assignedToRolesToDisplay.toString(), KimConstants.KimUIConstants.COMMA_SEPARATOR); } public String getRoleDetailsToDisplay(RoleImpl roleImpl){ return roleImpl.getNamespaceCode().trim()+" "+roleImpl.getRoleName().trim()+KimConstants.KimUIConstants.COMMA_SEPARATOR; } /** * @return the assignedToGroupNameForLookup */ public String getAssignedToGroupNameForLookup() { return this.assignedToGroupNameForLookup; } /** * @param assignedToGroupNameForLookup the assignedToGroupNameForLookup to set */ public void setAssignedToGroupNameForLookup(String assignedToGroupNameForLookup) { this.assignedToGroupNameForLookup = assignedToGroupNameForLookup; } /** * @return the assignedToGroupNamespaceForLookup */ public String getAssignedToGroupNamespaceForLookup() { return this.assignedToGroupNamespaceForLookup; } /** * @param assignedToGroupNamespaceForLookup the assignedToGroupNamespaceForLookup to set */ public void setAssignedToGroupNamespaceForLookup( String assignedToGroupNamespaceForLookup) { this.assignedToGroupNamespaceForLookup = assignedToGroupNamespaceForLookup; } /** * @return the assignedToPrincipalNameForLookup */ public String getAssignedToPrincipalNameForLookup() { return this.assignedToPrincipalNameForLookup; } /** * @param assignedToPrincipalNameForLookup the assignedToPrincipalNameForLookup to set */ public void setAssignedToPrincipalNameForLookup( String assignedToPrincipalNameForLookup) { this.assignedToPrincipalNameForLookup = assignedToPrincipalNameForLookup; } /** * @return the assignedToRoleNameForLookup */ public String getAssignedToRoleNameForLookup() { return this.assignedToRoleNameForLookup; } /** * @param assignedToRoleNameForLookup the assignedToRoleNameForLookup to set */ public void setAssignedToRoleNameForLookup(String assignedToRoleNameForLookup) { this.assignedToRoleNameForLookup = assignedToRoleNameForLookup; } /** * @return the assignedToRoleNamespaceForLookup */ public String getAssignedToRoleNamespaceForLookup() { return this.assignedToRoleNamespaceForLookup; } /** * @param assignedToRoleNamespaceForLookup the assignedToRoleNamespaceForLookup to set */ public void setAssignedToRoleNamespaceForLookup( String assignedToRoleNamespaceForLookup) { this.assignedToRoleNamespaceForLookup = assignedToRoleNamespaceForLookup; } /** * @return the attributeValue */ public String getAttributeValue() { return this.attributeValue; } /** * @param attributeValue the attributeValue to set */ public void setAttributeValue(String attributeValue) { this.attributeValue = attributeValue; } /** * @return the assignedToRoles */ public List getAssignedToRoles() { return this.assignedToRoles; } /** * @param assignedToRoles the assignedToRoles to set */ public void setAssignedToRoles(List assignedToRoles) { this.assignedToRoles = assignedToRoles; } /** * @return the assignedToGroup */ public GroupImpl getAssignedToGroup() { return this.assignedToGroup; } /** * @param assignedToGroup the assignedToGroup to set */ public void setAssignedToGroup(GroupImpl assignedToGroup) { this.assignedToGroup = assignedToGroup; } /** * @return the assignedToPrincipal */ public Person getAssignedToPrincipal() { return this.assignedToPrincipal; } /** * @param assignedToPrincipal the assignedToPrincipal to set */ public void setAssignedToPrincipal(Person assignedToPrincipal) { this.assignedToPrincipal = assignedToPrincipal; } /** * @return the assignedToRole */ public RoleImpl getAssignedToRole() { return this.assignedToRole; } /** * @param assignedToRole the assignedToRole to set */ public void setAssignedToRole(RoleImpl assignedToRole) { this.assignedToRole = assignedToRole; } /** * @return the detailCriteria */ public String getDetailCriteria() { return this.detailCriteria; } /** * @param detailCriteria the detailCriteria to set */ public void setDetailCriteria(String detailCriteria) { this.detailCriteria = detailCriteria; } /** * @return the attributeName */ public String getAttributeName() { return this.attributeName; } /** * @param attributeName the attributeName to set */ public void setAttributeName(String attributeName) { this.attributeName = attributeName; } } ]]> 0) { recipientsExist = true; for (String userRecipientId : userRecipients) { if (isUserRecipientValid(userRecipientId, errors)) { NotificationRecipient recipient = new NotificationRecipient(); recipient.setRecipientType(KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE); recipient.setRecipientId(userRecipientId); notification.addRecipient(recipient); } } } if (workgroupRecipients != null && workgroupRecipients.length > 0) { recipientsExist = true; if (workgroupNamespaceCodes != null && workgroupNamespaceCodes.length > 0) { if (workgroupNamespaceCodes.length == workgroupRecipients.length) { for (int i = 0; i < workgroupRecipients.length; i++) { if (isWorkgroupRecipientValid(workgroupRecipients[i], workgroupNamespaceCodes[i], errors)) { NotificationRecipient recipient = new NotificationRecipient(); recipient.setRecipientType(KimGroupMemberTypes.GROUP_MEMBER_TYPE); recipient.setRecipientId( getIdentityManagementService().getGroupByName(workgroupNamespaceCodes[i], workgroupRecipients[i]).getGroupId()); 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; ]]> 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 RuntimeException(message.toString()); } } try { def.setXmlContent(XmlHelper.writeNode(e, true)); } catch (TransformerException te) { throw generateSerializationException(EDLXmlUtils.EDL_E, te); } return def; } ]]> findDelegateMembersCompleteInfo(final Map fieldValues){ List delegateMembersCompleteInfo = new ArrayList(); DelegateMemberCompleteInfo delegateMemberCompleteInfo; List delegations = (List)getLookupService().findCollectionBySearchHelper( KimDelegationImpl.class, fieldValues, true); if(delegations!=null && !delegations.isEmpty()){ Map delegationMemberFieldValues = new HashMap(); for(String key: fieldValues.keySet()){ if(key.startsWith(KimConstants.KimUIConstants.MEMBER_ID_PREFIX)){ delegationMemberFieldValues.put( key.substring(key.indexOf( KimConstants.KimUIConstants.MEMBER_ID_PREFIX)+KimConstants.KimUIConstants.MEMBER_ID_PREFIX.length()), fieldValues.get(key)); } } StringBuffer memberQueryString = new StringBuffer(); for(KimDelegationImpl delegation: delegations) memberQueryString.append(delegation.getDelegationId()+KimConstants.KimUIConstants.OR_OPERATOR); delegationMemberFieldValues.put(KimConstants.PrimaryKeyConstants.DELEGATION_ID, KimCommonUtils.stripEnd(memberQueryString.toString(), KimConstants.KimUIConstants.OR_OPERATOR)); List delegateMembers = (List)getLookupService().findCollectionBySearchHelper( KimDelegationMemberImpl.class, delegationMemberFieldValues, true); KimDelegationImpl delegationTemp; for(KimDelegationMemberImpl delegateMember: delegateMembers){ delegateMemberCompleteInfo = delegateMember.toSimpleInfo(); delegationTemp = getDelegationImpl(delegations, delegateMember.getDelegationId()); delegateMemberCompleteInfo.setRoleId(delegationTemp.getRoleId()); delegateMemberCompleteInfo.setDelegationTypeCode(delegationTemp.getDelegationTypeCode()); Object member = getMember(delegateMemberCompleteInfo.getMemberTypeCode(), delegateMemberCompleteInfo.getMemberId()); delegateMemberCompleteInfo.setMemberName(getMemberName(member)); delegateMemberCompleteInfo.setMemberNamespaceCode(getMemberNamespaceCode(member)); delegateMembersCompleteInfo.add(delegateMemberCompleteInfo); } } return delegateMembersCompleteInfo; } ]]> params) { for (Map.Entry param : params.entrySet()) { Object value = param.getValue(); if (value instanceof BigDecimal) { value = new Long(((BigDecimal)value).longValue()); } if (value instanceof String) { value = ((String)value).replaceAll("\\*", "%"); } query.setParameter(param.getKey(), value); } for (Iterator iterator = tokens.iterator(); iterator.hasNext();) { Object token = (Object) iterator.next(); if (token instanceof Criteria) { prepareParameters(query, ((Criteria)token).tokens, ((Criteria)token).params); } } } private class AndCriteria extends Criteria { public AndCriteria(Criteria and) { super(and.entityName, and.alias); this.tokens = new ArrayList(and.tokens); this.params = new HashMap(and.params); } } private class OrCriteria extends Criteria { public OrCriteria(Criteria or) { super(or.entityName, or.alias); this.tokens = new ArrayList(or.tokens); this.params = new HashMap(or.params); } } public Integer getSearchLimit() { return this.searchLimit; } public void setSearchLimit(Integer searchLimit) { this.searchLimit = searchLimit; } public void notNull(String attribute) { tokens.add(alias + "." + attribute + " IS NOT NULL "); } public void distinct(boolean distinct){ this.distinct = distinct; } /** * This method ... * * @param string * @param timestamp * @param timestamp2 */ public void notBetween(String attribute, Object value1, Object value2) { ]]> 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; } ]]> l = Arrays.asList(valueEntered.split("\\.\\.")); for(String value : l){ bSplit = true; if(!isPassesDefaultValidation(value)){ bRet = false; } } } if (StringUtils.contains(valueEntered, KNSConstants.OR_LOGICAL_OPERATOR)) { //splitValueList.addAll(Arrays.asList(StringUtils.split(valueEntered, KNSConstants.OR_LOGICAL_OPERATOR))); List l = Arrays.asList(StringUtils.split(valueEntered, KNSConstants.OR_LOGICAL_OPERATOR)); for(String value : l){ bSplit = true; if(!isPassesDefaultValidation(value)){ bRet = false; } } } if (StringUtils.contains(valueEntered, KNSConstants.AND_LOGICAL_OPERATOR)) { //splitValueList.addAll(Arrays.asList(StringUtils.split(valueEntered, KNSConstants.AND_LOGICAL_OPERATOR))); List l = Arrays.asList(StringUtils.split(valueEntered, KNSConstants.AND_LOGICAL_OPERATOR)); 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(SqlBuilder.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()) { ]]> 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."); } ]]> model = new HashMap(); String view; try { document = new NotificationWorkflowDocument( initiator, 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.getDocumentContent().setApplicationContent(notificationAsXml); document.getDocumentContent().setAttributeContent("" + gac.generateContent(attrFields) + ""); document.setTitle(notification.getTitle()); document.routeDocument("This message was submitted via the simple notification message submission form by user " ]]> 0; --i) { previousRouteLevels.add(new KeyValue(Integer.toString(i - 1), Integer.toString(i - 1))); } } return previousRouteLevels; }*/ /** * @return Returns the superUserSearch. */ public boolean isSuperUserSearch() { return (command != null && command.equals(KEWConstants.SUPERUSER_COMMAND)); } public String getDocTypeName() { return docTypeName; } public void setDocTypeName(String docTypeName) { this.docTypeName = docTypeName; } public void setAppSpecificPersonId(String networkId){ if(networkId != null && !networkId.trim().equals("")){ getAppSpecificRouteRecipient().setId(networkId); } getAppSpecificRouteRecipient().setType("person"); } public void setAppSpecificWorkgroupId(String workgroupId){ if(workgroupId != null){ Group workgroup = KIMServiceLocator.getIdentityManagementService().getGroup(workgroupId); if(workgroup != null){ ]]> 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 (Iterator iterator = columns.iterator(); iterator.hasNext();) { Column col = (Column) iterator.next(); ]]> getResponsibilityActions( @WebParam(name="namespaceCode") String namespaceCode, @WebParam(name="responsibilityName") String responsibilityName, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification, @WebParam(name="responsibilityDetails") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet responsibilityDetails); List getResponsibilityActionsByTemplateName( @WebParam(name="namespaceCode") String namespaceCode, @WebParam(name="responsibilityTemplateName") String responsibilityTemplateName, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification, @WebParam(name="responsibilityDetails") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet responsibilityDetails); /** * Lets the system know (mainly for UI purposes) whether this responsibility expects RoleResponsibilityAction * records to be given at the assignment level or are global to the responsibility. (I.e., they apply * to any member assigned to the responsibility.) */ boolean areActionsAtAssignmentLevelById( @WebParam(name="responsibilityId") String responsibilityId ); ]]> 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( ]]> getPermissionAssignees( @WebParam(name="namespaceCode") String namespaceCode, ]]> 0) { cacheKey.append(","); } // handle weird cache bug: // if you call a one-arg method foo with a null arg i.e. foo(null), // and then call it with an argument whose toString evaluates to "null", // OSCache gets stuck in an infinite wait() call because it somehow thinks // another thread is already updating this cache entry // // workaround: change so that args which are actually null literal have // some weird, unlikely-to-be-encountered String representation if (argValues[i] == null) { cacheKey.append(""); } else { cacheKey.append(argValues[i]); } } } return cacheKey.toString(); } /** * @param key * @return true if the cache contains an entry with the given key */ public boolean containsCacheKey(String key) { boolean contains = false; try { cache.getFromCache(key); contains = true; } catch (NeedsRefreshException e) { // it is imperative that you call cancelUpdate if you aren't going to update the cache entry that caused the // NeedsRefreshException above cache.cancelUpdate(key); contains = false; } return contains; } /** * Removes a method cache if one exists for the given key. * @param cacheKey - key for method signature and parameters - see buildCacheKey */ public void removeCacheKey(String cacheKey) { if (!containsCacheKey(cacheKey)) { return; } if ( LOG.isDebugEnabled() ) { LOG.debug("removing method cache for key: " + cacheKey); } cache.cancelUpdate(cacheKey); cache.flushEntry(cacheKey); } // Kuali Foundation modification: removed getCacheKey(String, String, Object[]) // end Kuali Foundation modification } ]]> maxResultCap) { LOG.warn("Document Search Generator (" + docSearchGenerator.getClass().getName() + ") gives result set cap of " + resultCap + " which is greater than parameter " + KEWConstants.DOC_SEARCH_RESULT_CAP + " value of " + maxResultCap); resultCap = maxResultCap; } else if (maxResultCap <= 0) { LOG.warn(KEWConstants.DOC_SEARCH_RESULT_CAP + " was less than or equal to zero. Please use a positive integer."); } } catch (NumberFormatException e) { LOG.warn(KEWConstants.DOC_SEARCH_RESULT_CAP + " is not a valid number. Value was " + resultCapValue); } } return resultCap; } // TODO delyea: use searchable attribute count here? private int getFetchMoreIterationLimit() { int fetchMoreLimit = DEFAULT_FETCH_MORE_ITERATION_LIMIT; String fetchMoreLimitValue = Utilities.getKNSParameterValue(KEWConstants.KEW_NAMESPACE, KNSConstants.DetailTypes.DOCUMENT_SEARCH_DETAIL_TYPE, KEWConstants.DOC_SEARCH_FETCH_MORE_ITERATION_LIMIT); if (!StringUtils.isBlank(fetchMoreLimitValue)) { try { fetchMoreLimit = Integer.parseInt(fetchMoreLimitValue); if (fetchMoreLimit < 0) { LOG.warn(KEWConstants.DOC_SEARCH_FETCH_MORE_ITERATION_LIMIT + " was less than zero. Please use a value greater than or equal to zero."); fetchMoreLimit = DEFAULT_FETCH_MORE_ITERATION_LIMIT; } } catch (NumberFormatException e) { LOG.warn(KEWConstants.DOC_SEARCH_FETCH_MORE_ITERATION_LIMIT + " is not a valid number. Value was " + fetchMoreLimitValue); } } return fetchMoreLimit; } // // protected DatabasePlatform getPlatform() { // return (DatabasePlatform)GlobalResourceLoader.getService(KEWServiceLocator.DB_PLATFORM); // } } ]]> 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; } ]]> 1) ) { // no user and more than one workgroup id ruleResponsibilityNameCrit = new Criteria(); ruleResponsibilityNameCrit.addIn("ruleResponsibilityName", workgroupIds); ruleResponsibilityNameCrit.addEqualTo("ruleResponsibilityType", KEWConstants.RULE_RESPONSIBILITY_GROUP_ID); } if (ruleResponsibilityNameCrit != null) { ]]> generatedActionItems = new ArrayList(); List requests = new ArrayList(); if ( context.isSimulation() ) { for ( ActionRequestValue ar : context.getDocument().getActionRequests() ) { // logic check below duplicates behavior of the // ActionRequestService.findPendingRootRequestsByDocIdAtRouteNode(routeHeaderId, // routeNodeInstanceId) method if ( ar.getCurrentIndicator() && (KEWConstants.ACTION_REQUEST_INITIALIZED.equals( ar.getStatus() ) || KEWConstants.ACTION_REQUEST_ACTIVATED .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.getRouteHeaderId(), nodeInstance.getRouteNodeInstanceId() ); } if ( LOG.isDebugEnabled() ) { LOG.debug( "Pending Root Requests " + requests.size() ); } boolean requestActivated = activateRequestsCustom( context, requests, generatedActionItems, ]]> 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) { ]]> 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( " 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"); } ]]> 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."); } ]]> 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(KNSConstants.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) { ]]> iter = this.getRows().iterator(); iter.hasNext();) { Row row = iter.next(); for (Iterator iterator = row.getFields().iterator(); iterator.hasNext();) { Field field = iterator.next(); if (field.getPropertyName() != null && !field.getPropertyName().equals("")) { if (this.getParameters().get(field.getPropertyName()) != null) { if(!Field.MULTI_VALUE_FIELD_TYPES.contains(field.getFieldType())) { field.setPropertyValue(((String[])this.getParameters().get(field.getPropertyName()))[0]); } else { //multi value, set to values field.setPropertyValues((String[])this.getParameters().get(field.getPropertyName())); } ]]> > STACK = new ThreadLocal>() { protected List initialValue() { return new ArrayList(5); } }; private static List getStack() { return STACK.get(); } public static void bind(ClassLoader cl) { List stack = getStack(); Thread current = Thread.currentThread(); //log.debug("[bind] Switching CCL from " + current.getContextClassLoader() + " to " + cl); // push the current context classloader on the stack stack.add(current.getContextClassLoader()); current.setContextClassLoader(cl); } public static void unbind() { List stack = getStack(); if (stack.size() == 0) { throw new IllegalStateException("No context classloader to unbind!"); } // pop the last context classloader off the stack ClassLoader lastClassLoader = stack.get(stack.size() - 1); //log.debug("[unbind] Switching CCL from " + Thread.currentThread().getContextClassLoader() + " to " + lastClassLoader); stack.remove(stack.size() - 1); Thread.currentThread().setContextClassLoader(lastClassLoader); } } ]]> 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"); } RuleTemplate ruleTemplate = getRuleTemplateService().findByRuleTemplateName(ruleTemplateName); Long ruleTemplateId = null; if (ruleTemplate != null) { ruleTemplateId = ruleTemplate.getRuleTemplateId(); } 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) { ]]> 1) { String expandedNot = "!" + StringUtils.join(splitPropVal, KNSConstants.AND_LOGICAL_OPERATOR + KNSConstants.NOT_LOGICAL_OPERATOR); // we know that since this method was called, treatWildcardsAndOperatorsAsLiteral must be false addCriteria(propertyName, expandedNot, propertyType, caseInsensitive, false, criteria); } else { // only one so add a not like criteria.addNotLike(propertyName, splitPropVal[0]); ]]> \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 ""; } } ]]> 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); } ]]> 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.kns.service.PersistenceStructureService#listReferenceObjectFieldNames(org.kuali.rice.kns.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()); } @Cached public boolean isReferenceUpdatable(Class boClass, String referenceName) { ]]> parameters) { WebRuleUtils.processRuleForCopy(document.getDocumentNumber(), getOldRule(document), getNewRule(document)); super.processAfterCopy(document, parameters); } @Override public void processAfterEdit(MaintenanceDocument document, Map parameters) { if (!getOldRule(document).getCurrentInd()) { throw new RiceRuntimeException("Cannot edit a non-current version of a rule."); } WebRuleUtils.populateForCopyOrEdit(getOldRule(document), getNewRule(document)); getNewRule(document).setPreviousVersionId(getOldRule(document).getRuleBaseValuesId()); getNewRule(document).setRouteHeaderId(new Long(document.getDocumentHeader().getDocumentNumber())); super.processAfterEdit(document, parameters); } ]]> userGroupIds = new ArrayList(); for(String id:KIMServiceLocator.getIdentityManagementService().getGroupIdsForPrincipal(principalId)){ userGroupIds.add(id); } if (!userGroupIds.isEmpty()) { groupCrit.in("delegatorGroupId", userGroupIds); } orCrit.or(userCrit); orCrit.or(groupCrit); crit.and(orCrit); crit.eq("delegationType", KEWConstants.DELEGATION_PRIMARY); filter.setDelegationType(KEWConstants.DELEGATION_PRIMARY); filter.setExcludeDelegationType(false); addToFilterDescription(filteredByItems, "Primary Delegator Id"); addedDelegationCriteria = true; filterOn = true; } ]]> options = new ArrayList(); List selectedOptions = new ArrayList(); for (int k = 0; k < childNode.getChildNodes().getLength(); k++) { Node displayChildNode = childNode.getChildNodes().item(k); if ("type".equals(displayChildNode.getNodeName())) { ]]> 0) { actionItemMap.put(potentialActionItem.getRouteHeaderId(), 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", KEWConstants.RULE_RESPONSIBILITY_GROUP_ID); ReportQueryByCriteria query = QueryFactory.newReportQuery(RuleResponsibility.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()); } } } ]]> criteriaComponentsByFormKey = new HashMap(); for (SearchableAttribute searchableAttribute : docType.getSearchableAttributes()) { for (Row row : searchableAttribute.getSearchingRows( DocSearchUtils.getDocumentSearchContext("", docType.getName(), ""))) { for (org.kuali.rice.kns.web.ui.Field field : row.getFields()) { if (field instanceof Field) { SearchableAttributeValue searchableAttributeValue = DocSearchUtils.getSearchableAttributeValueByDataTypeString(field.getFieldDataType()); SearchAttributeCriteriaComponent sacc = new SearchAttributeCriteriaComponent(field.getPropertyName(), null, field.getPropertyName(), searchableAttributeValue); sacc.setRangeSearch(field.isMemberOfRange()); sacc.setCaseSensitive(!field.isUpperCase()); ]]> 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")); ]]> 0 && !basePath.endsWith(File.separator)) { basePath += File.separator; } return basePath; } /** * Configures the default config location by first checking the init params * for default locations and then falling back to the standard default * config location. */ protected void addDefaultConfigLocation(ServletContext context, List configLocations) { String defaultConfigLocation = context.getInitParameter(KEWConstants.DEFAULT_CONFIG_LOCATION_PARAM); if (!StringUtils.isEmpty(defaultConfigLocation)) { String[] locations = defaultConfigLocation.split(","); for (String location : locations) { configLocations.add(location); } } else { configLocations.add(KEWConstants.DEFAULT_SERVER_CONFIG_LOCATION); } } // public void configureLifeCycles() { // lifeCycles.add(new Log4jLifeCycle()); // String springLocation = ConfigContext.getCurrentContextConfig().getAlternateSpringFile(); // if (springLocation == null) { // springLocation = "ServerSpring.xml"; // } // lifeCycles.add(new SpringLifeCycle(springLocation)); // lifeCycles.add(new WebApplicationGlobalResourceLifecycle()); // lifeCycles.add(new ServiceDelegatingLifecycle(KEWServiceLocator.THREAD_POOL)); // lifeCycles.add(new ServiceDelegatingLifecycle(KEWServiceLocator.CACHE_ADMINISTRATOR)); // lifeCycles.add(new ServiceDelegatingLifecycle(KEWServiceLocator.SERVICE_REGISTRY)); // lifeCycles.add(new XmlPipelineLifeCycle()); // lifeCycles.add(new EmailReminderLifecycle()); // } public void contextDestroyed(ServletContextEvent sce) { LOG.info("Shutting down workflow."); ]]> return value"); record.setReturnUrl(returnUrl.toString()); String destinationUrl = "report"; record.setDestinationUrl(destinationUrl); displayList.add(ruleDelegation); ]]> (); } attributes = new HashMap(); for (Iterator iter = ruleTemplate.getActiveRuleTemplateAttributes().iterator(); iter.hasNext();) { RuleTemplateAttribute ruleTemplateAttribute = (RuleTemplateAttribute) iter.next(); if (!ruleTemplateAttribute.isWorkflowAttribute()) { continue; } WorkflowAttribute attribute = (WorkflowAttribute)GlobalResourceLoader.getObject(new ObjectDefinition(ruleTemplateAttribute.getRuleAttribute().getClassName(), ruleTemplateAttribute.getRuleAttribute().getServiceNamespace()));//SpringServiceLocator.getExtensionService().getWorkflowAttribute(ruleTemplateAttribute.getRuleAttribute().getClassName()); RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute(); if (ruleAttribute.getType().equals(KEWConstants.RULE_XML_ATTRIBUTE_TYPE)) { ((GenericXMLRuleAttribute) attribute).setRuleAttribute(ruleAttribute); } attribute.setRequired(false); List searchRows = null; ]]> ():origDelegationImplTemp.getMembers(); newKimDelegation.setMembers(getDelegationMembers(roleDocumentDelegation.getMembers(), origMembers, activatingInactive, newDelegationIdAssigned)); kimDelegations.add(newKimDelegation); activatingInactive = false; } } return kimDelegations; } protected List getDelegationMembers(List delegationMembers, ]]> 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 ); } } ]]> )attribute.validateRuleData(fieldValues)) { GlobalVariables.getMessageMap().putError(wsei.getMessage(), RiceKeyConstants.ERROR_CUSTOM, wsei.getArg1()); } try { List curExts = ruleTemplateAttribute.getRuleExtensions(); for (Iterator extIter = curExts.iterator(); extIter.hasNext();) { RuleExtension curExt = (RuleExtension) iter.next(); curExtId = curExt.getRuleExtensionId(); RuleBaseValues curRule = curExt.getRuleBaseValues(); attribute.validateRuleData(WebRuleUtils.getFieldMapForRuleTemplateAttribute(curRule, ruleTemplateAttribute)); } } catch (Exception e) { LOG.warn("Exception caught attempting to validate attribute data for extension id:" + curExtId + ". Reason: " + e.getCause()); } searchRows = attribute.getRuleRows(); ]]> primaryKeys = new ArrayList(); primaryKeys.add("code"); Namespace parameterNamespace = new Namespace(); parameterNamespace.setCode((String)ObjectUtils.getPropertyValue(businessObject, attributeName)); return getInquiryUrlForPrimaryKeys(Namespace.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); } ]]> constructSortableByKey() { Map sortable = new HashMap(); sortable .put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_ROUTE_HEADER_ID, Boolean.TRUE); sortable .put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_DOC_TYPE_LABEL, Boolean.TRUE); sortable .put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_DOCUMENT_TITLE, Boolean.TRUE); sortable .put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_ROUTE_STATUS_DESC, Boolean.TRUE); sortable.put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_DOC_STATUS, Boolean.TRUE); sortable.put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_INITIATOR, Boolean.TRUE); sortable .put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_DATE_CREATED, Boolean.TRUE); sortable.put( KEWPropertyConstants.DOC_SEARCH_RESULT_PROPERTY_NAME_ROUTE_LOG, Boolean.FALSE); return sortable; } public Map getLabelsByKey() { ]]> delegatorGroupIds = KIMServiceLocator.getIdentityManagementService().getGroupIdsForPrincipal(principalId); if (delegatorGroupIds != null && !delegatorGroupIds.isEmpty()) { groupCrit.addIn("delegatorGroupId", delegatorGroupIds); } orCrit.addOrCriteria(userCrit); orCrit.addOrCriteria(groupCrit); crit.addAndCriteria(orCrit); crit.addEqualTo("delegationType", KEWConstants.DELEGATION_PRIMARY); filter.setDelegationType(KEWConstants.DELEGATION_PRIMARY); filter.setExcludeDelegationType(false); addToFilterDescription(filteredByItems, "Primary Delegator Id"); addedDelegationCriteria = true; filterOn = true; } ]]> parameterMap = getFieldMapForRuleTemplateAttribute(rule, ruleTemplateAttribute); ]]> m = new LinkedHashMap(); m.put( "groupMemberId", groupMemberId ); m.put( "groupId", groupId ); m.put( "memberId", getMemberId() ); m.put( "memberTypeCode", getMemberTypeCode() ); return m; } ]]> (rulesToVersion.values())); } /** * If a rule has been modified and is no longer current since the original request was made, we need to * be sure to NOT update the rule. */ protected boolean shouldChangeRuleInvolvement(Long documentId, RuleBaseValues rule) { ]]> (); } /** * 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(); } } ]]> 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); } ]]> ") || propertyValue.startsWith("<") ) ) { addStringRangeCriteria(propertyName, propertyValue, criteria); } else { if (treatWildcardsAndOperatorsAsLiteral) { propertyValue = StringUtils.replace(propertyValue, "*", "\\*"); } criteria.addLike(propertyName, propertyValue); ]]> )wsee.getServiceErrors()) { if(workflowServiceError.getMessageMap() != null && workflowServiceError.getMessageMap().hasErrors()){ // merge the message maps GlobalVariables.getMessageMap().merge(workflowServiceError.getMessageMap()); }else{ //TODO: can we add something to this to get it to highlight the right field too? Maybe in arg1 GlobalVariables.getMessageMap().putError(workflowServiceError.getMessage(), RiceKeyConstants.ERROR_CUSTOM, workflowServiceError.getMessage()); } }; } if(!GlobalVariables.getMessageMap().hasNoErrors()) { throw new ValidationException("errors in search criteria"); ]]> 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); ]]> las = roleIdToMembershipMap.get( rm.getRoleId() ); if ( las == null ) { las = new ArrayList(); roleIdToMembershipMap.put( rm.getRoleId(), las ); } RoleMembershipInfo mi = new RoleMembershipInfo( rm.getRoleId(), rm.getRoleMemberId(), rm.getMemberId(), rm.getMemberTypeCode(), rm.getQualifier() ); las.add( mi ); } else { results.add(rm.getQualifier()); } } ]]> 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 + "%"); ]]> result = components.getSearchResults(); // for (DocumentSearchResult documentSearchResult : result) { displayList = result;//.getResultContainers(); // } //####BEGIN COPIED CODE######### setBackLocation((String) lookupForm.getFieldsForLookup().get(KNSConstants.BACK_LOCATION)); setDocFormKey((String) lookupForm.getFieldsForLookup().get(KNSConstants.DOC_FORM_KEY)); //###COMENTED OUT // Collection displayList; // // call search method to get results // if (bounded) { // displayList = getSearchResults(lookupForm.getFieldsForLookup()); // } // else { // displayList = getSearchResultsUnbounded(lookupForm.getFieldsForLookup()); // } //##COMENTED OUT HashMap propertyTypes = new HashMap(); boolean hasReturnableRow = false; List returnKeys = getReturnKeys(); List pkNames = getBusinessObjectMetaDataService().listPrimaryKeyFieldNames(getBusinessObjectClass()); Person user = GlobalVariables.getUserSession().getPerson(); ]]> 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; ]]> fieldsToClear = new HashMap(); //for (Row row : this.getRows()) { // for (Field field : row.getFields()) { // String[] propertyValue = {}; // if(!Field.MULTI_VALUE_FIELD_TYPES.contains(field.getFieldType())) { // propertyValue = new String[]{field.getPropertyValue()}; // } else { // propertyValue = field.getPropertyValues(); // } // fieldsToClear.put(field.getPropertyName(), propertyValue); // } //} Map fixedParameters = new HashMap(); Map changedDateFields = preprocessDateFields(lookupForm.getFieldsForLookup()); fixedParameters.putAll(this.getParameters()); for (Map.Entry prop : changedDateFields.entrySet()) { fixedParameters.remove(prop.getKey()); fixedParameters.put(prop.getKey(), new String[]{prop.getValue()}); } ]]>