The following document contains the results of PMD's CPD 4.2.5.
| File | Line |
|---|---|
| org/kuali/rice/krad/document/authorization/DocumentAuthorizerBase.java | 57 |
| org/kuali/rice/krad/uif/authorization/DocumentAuthorizerBase.java | 53 |
if (LOG.isDebugEnabled()) {
LOG.debug("calling DocumentAuthorizerBase.getDocumentActionFlags for document '"
+ document.getDocumentNumber() + "'. user '" + user.getPrincipalName() + "'");
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_EDIT)
&& !isAuthorizedByTemplate(document, KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.EDIT_DOCUMENT, user.getPrincipalId())) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_EDIT);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_COPY)
&& !isAuthorizedByTemplate(document, KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.COPY_DOCUMENT, user.getPrincipalId())) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_COPY);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_BLANKET_APPROVE)
&& !isAuthorizedByTemplate(document, KRADConstants.KUALI_RICE_WORKFLOW_NAMESPACE,
KimConstants.PermissionTemplateNames.BLANKET_APPROVE_DOCUMENT, user.getPrincipalId())) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_BLANKET_APPROVE);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_CANCEL)
&& !isAuthorizedByTemplate(document, KRADConstants.KUALI_RICE_WORKFLOW_NAMESPACE,
KimConstants.PermissionTemplateNames.CANCEL_DOCUMENT, user.getPrincipalId())) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_CANCEL);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_SAVE)
&& !isAuthorizedByTemplate(document, KRADConstants.KUALI_RICE_WORKFLOW_NAMESPACE,
KimConstants.PermissionTemplateNames.SAVE_DOCUMENT, user.getPrincipalId())) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_SAVE);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_ROUTE)
&& !isAuthorizedByTemplate(document, KRADConstants.KUALI_RICE_WORKFLOW_NAMESPACE,
KimConstants.PermissionTemplateNames.ROUTE_DOCUMENT, user.getPrincipalId())) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_ROUTE);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_ACKNOWLEDGE)
&& !canTakeRequestedAction(document, KEWConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, user)) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_ACKNOWLEDGE);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_FYI)
&& !canTakeRequestedAction(document, KEWConstants.ACTION_REQUEST_FYI_REQ, user)) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_FYI);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_APPROVE)
|| documentActions.contains(KRADConstants.KUALI_ACTION_CAN_DISAPPROVE)) {
if (!canTakeRequestedAction(document, KEWConstants.ACTION_REQUEST_APPROVE_REQ, user)) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_APPROVE);
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_DISAPPROVE);
}
}
if (!canSendAnyTypeAdHocRequests(document, user)) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_ADD_ADHOC_REQUESTS);
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_SEND_ADHOC_REQUESTS);
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_SEND_NOTE_FYI);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_SEND_NOTE_FYI)
&& !canSendAdHocRequests(document, KEWConstants.ACTION_REQUEST_FYI_REQ, user)) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_SEND_NOTE_FYI);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_ANNOTATE)
&& !documentActions.contains(KRADConstants.KUALI_ACTION_CAN_EDIT)) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_ANNOTATE);
}
if (documentActions.contains(KRADConstants.KUALI_ACTION_CAN_EDIT__DOCUMENT_OVERVIEW)
&& !canEditDocumentOverview(document, user)) {
documentActions.remove(KRADConstants.KUALI_ACTION_CAN_EDIT__DOCUMENT_OVERVIEW);
}
return documentActions;
}
public final boolean canInitiate(String documentTypeName, Person user) {
String nameSpaceCode = KRADConstants.KUALI_RICE_SYSTEM_NAMESPACE;
Map<String, String> permissionDetails = new HashMap<String, String>();
permissionDetails.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME,
documentTypeName);
return getPermissionService().isAuthorizedByTemplateName(
user.getPrincipalId(), nameSpaceCode,
KimConstants.PermissionTemplateNames.INITIATE_DOCUMENT,
permissionDetails, Collections.<String, String>emptyMap());
}
public final boolean canReceiveAdHoc(Document document, Person user,
String actionRequestCode) {
Map<String,String> additionalPermissionDetails = new HashMap<String, String>();
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 ); | |
| File | Line |
|---|---|
| org/kuali/rice/krad/document/authorization/DocumentPresentationControllerBase.java | 220 |
| org/kuali/rice/krad/uif/authorization/DocumentPresentationControllerBase.java | 42 |
Document document = ((DocumentFormBase) model).getDocument();
if (canEdit(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_EDIT);
}
if (canAnnotate(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_ANNOTATE);
}
if (canClose(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_CLOSE);
}
if (canSave(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_SAVE);
}
if (canRoute(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_ROUTE);
}
if (canCancel(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_CANCEL);
}
if (canReload(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_RELOAD);
}
if (canCopy(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_COPY);
}
if (canPerformRouteReport(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_PERFORM_ROUTE_REPORT);
}
if (canAddAdhocRequests(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_ADD_ADHOC_REQUESTS);
}
if (canBlanketApprove(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_BLANKET_APPROVE);
}
if (canApprove(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_APPROVE);
}
if (canDisapprove(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_DISAPPROVE);
}
if (canSendAdhocRequests(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_SEND_ADHOC_REQUESTS);
}
if (canSendNoteFyi(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_SEND_NOTE_FYI);
}
if (this.canEditDocumentOverview(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_EDIT__DOCUMENT_OVERVIEW);
}
if (canFyi(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_FYI);
}
if (canAcknowledge(document)) {
documentActions.add(KRADConstants.KUALI_ACTION_CAN_ACKNOWLEDGE);
}
return documentActions;
} | |
| File | Line |
|---|---|
| org/kuali/rice/krad/document/authorization/DocumentPresentationControllerBase.java | 35 |
| org/kuali/rice/krad/uif/authorization/DocumentPresentationControllerBase.java | 119 |
public boolean canInitiate(String documentTypeName) {
return true;
}
/**
* @param document
* @return boolean (true if can edit the document)
*/
protected boolean canEdit(Document document) {
boolean canEdit = false;
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
if (workflowDocument.isInitiated() || workflowDocument.isSaved() || workflowDocument.isEnroute()
|| workflowDocument.isException()) {
canEdit = true;
}
return canEdit;
}
/**
* @param document
* @return boolean (true if can add notes to the document)
*/
protected boolean canAnnotate(Document document) {
return canEdit(document);
}
/**
* @param document
* @return boolean (true if can reload the document)
*/
protected boolean canReload(Document document) {
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
return (canEdit(document) && !workflowDocument.isInitiated());
}
/**
* @param document
* @return boolean (true if can close the document)
*/
protected boolean canClose(Document document) {
return true;
}
/**
* @param document
* @return boolean (true if can save the document)
*/
protected boolean canSave(Document document) {
return canEdit(document);
}
/**
* @param document
* @return boolean (true if can route the document)
*/
protected boolean canRoute(Document document) {
boolean canRoute = false;
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
canRoute = true;
}
return canRoute;
}
/**
* @param document
* @return boolean (true if can cancel the document)
*/
protected boolean canCancel(Document document) {
return canEdit(document);
}
/**
* @param document
* @return boolean (true if can copy the document)
*/
protected boolean canCopy(Document document) {
boolean canCopy = false;
if (document.getAllowsCopy()) {
canCopy = true;
}
return canCopy;
}
/**
* @param document
* @return boolean (true if can perform route report)
*/
protected boolean canPerformRouteReport(Document document) {
return getParameterService().getParameterValueAsBoolean(KRADConstants.KRAD_NAMESPACE,
KRADConstants.DetailTypes.DOCUMENT_DETAIL_TYPE,
KRADConstants.SystemGroupParameterNames.DEFAULT_CAN_PERFORM_ROUTE_REPORT_IND);
}
/**
* @param document
* @return boolean (true if can do ad hoc route)
*/
protected boolean canAddAdhocRequests(Document document) {
return true;
}
/**
* This method ...
*
* @param document
* @return boolean (true if can blanket approve the document)
*/
protected boolean canBlanketApprove(Document document) { | |
| File | Line |
|---|---|
| org/kuali/rice/krad/document/authorization/DocumentAuthorizerBase.java | 262 |
| org/kuali/rice/krad/uif/authorization/DocumentAuthorizerBase.java | 245 |
user.getPrincipalId(), additionalPermissionDetails, null);
}
@Override
protected void addPermissionDetails(Object dataObject,
Map<String, String> attributes) {
super.addPermissionDetails(dataObject, attributes);
if (dataObject instanceof Document) {
addStandardAttributes((Document) dataObject, attributes);
}
}
@Override
protected void addRoleQualification(Object dataObject,
Map<String, String> attributes) {
super.addRoleQualification(dataObject, attributes);
if (dataObject instanceof Document) {
addStandardAttributes((Document) dataObject, attributes);
}
}
protected void addStandardAttributes(Document document,
Map<String, String> 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());
}
} | |
| File | Line |
|---|---|
| org/kuali/rice/krad/document/authorization/DocumentAuthorizerBase.java | 227 |
| org/kuali/rice/krad/uif/authorization/DocumentAuthorizerBase.java | 210 |
.getPrincipalId(), additionalPermissionDetails, null);
}
public boolean canEditDocumentOverview(Document document, Person user){
return isAuthorizedByTemplate(document,
KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.EDIT_DOCUMENT,
user.getPrincipalId()) && this.isDocumentInitiator(document, user);
}
protected final boolean canSendAnyTypeAdHocRequests(Document document, Person user) {
if (canSendAdHocRequests(document, KEWConstants.ACTION_REQUEST_FYI_REQ, user)) {
RoutePath routePath = KewApiServiceLocator.getDocumentTypeService().getRoutePathForDocumentTypeName(document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
ProcessDefinition processDefinition = routePath.getPrimaryProcess();
if (processDefinition != null) {
if (processDefinition.getInitialRouteNode() == null) {
return false;
}
} else {
return false;
}
return true;
} else if(canSendAdHocRequests(document, KEWConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, user)){
return true;
}
return canSendAdHocRequests(document, KEWConstants.ACTION_REQUEST_APPROVE_REQ, user);
}
protected boolean canTakeRequestedAction(Document document,
String actionRequestCode, Person user) {
Map<String, String> additionalPermissionDetails = new HashMap<String, String>();
additionalPermissionDetails.put(KimConstants.AttributeConstants.ACTION_REQUEST_CD,
actionRequestCode);
return isAuthorizedByTemplate(document, KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.TAKE_REQUESTED_ACTION,
user.getPrincipalId(), additionalPermissionDetails, null); | |
| File | Line |
|---|---|
| org/kuali/rice/krad/criteria/CriteriaLookupDaoJpa.java | 216 |
| org/kuali/rice/krad/criteria/CriteriaLookupDaoOjb.java | 214 |
parent.addOrCriteria(inner);
} else {
throw new UnsupportedPredicateException(p);
}
}
}
private static <U extends CriteriaValue<?>> 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 <T, U extends CriteriaValue<T>> Set<T> getValsUnsafe(Set<? extends U> toConv) {
return (Set<T>) getVals(toConv);
}
private static Set<?> getVals(Set<? extends CriteriaValue<?>> toConv) {
final Set<Object> values = new HashSet<Object>();
for (CriteriaValue<?> value : toConv) {
values.add(getVal(value));
}
return values;
}
//eliding performance for function composition....
private static Set<String> toUpper(Set<String> strs) {
final Set<String> values = new HashSet<String>();
for (String value : strs) {
values.add(value.toUpperCase());
}
return values;
}
private String getUpperFunction() { | |
| File | Line |
|---|---|
| org/kuali/rice/krad/document/authorization/DocumentPresentationControllerBase.java | 170 |
| org/kuali/rice/krad/uif/authorization/DocumentPresentationControllerBase.java | 242 |
}
// otherwise, limit the display of the blanket approve button to only
// the initiator of the document
// (prior to routing)
WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
if (canRoute(document)
&& StringUtils.equals(workflowDocument.getInitiatorPrincipalId(), GlobalVariables.getUserSession()
.getPrincipalId())) {
return true;
}
// or to a user with an approval action request
if (workflowDocument.isApprovalRequested()) {
return true;
}
return false;
}
protected boolean canApprove(Document document) {
return true;
}
protected boolean canDisapprove(Document document) {
// most of the time, a person who can approve can disapprove
return canApprove(document);
}
protected boolean canSendAdhocRequests(Document document) {
WorkflowDocument kualiWorkflowDocument = document.getDocumentHeader().getWorkflowDocument();
return !(kualiWorkflowDocument.isInitiated() || kualiWorkflowDocument.isSaved());
}
protected boolean canSendNoteFyi(Document document) {
return true;
}
protected boolean canEditDocumentOverview(Document document) {
WorkflowDocument kualiWorkflowDocument = document.getDocumentHeader().getWorkflowDocument();
return (kualiWorkflowDocument.isInitiated() || kualiWorkflowDocument.isSaved());
}
protected boolean canFyi(Document document) {
return true;
}
protected boolean canAcknowledge(Document document) {
return true;
} | |
| File | Line |
|---|---|
| org/kuali/rice/krad/bo/authorization/BusinessObjectAuthorizerBase.java | 155 |
| org/kuali/rice/krad/uif/authorization/AuthorizerBase.java | 167 |
permissionDetails = new HashMap<String, String>(getPermissionDetailValues(dataObject));
}
return getPermissionService().isAuthorized(principalId, namespaceCode, permissionName,
permissionDetails, roleQualifiers);
}
public final boolean isAuthorizedByTemplate(Object dataObject, String namespaceCode, String permissionTemplateName,
String principalId, Map<String, String> collectionOrFieldLevelPermissionDetails,
Map<String, String> collectionOrFieldLevelRoleQualification) {
Map<String, String> roleQualifiers = new HashMap<String, String>(getRoleQualification(dataObject, principalId));
Map<String, String> permissionDetails = new HashMap<String, String>(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<String, String> getRoleQualification(Object primaryDataObjectOrDocument) { | |
| File | Line |
|---|---|
| org/kuali/rice/krad/criteria/CriteriaLookupDaoJpa.java | 106 |
| org/kuali/rice/krad/criteria/CriteriaLookupDaoOjb.java | 105 |
if (criteria.getMaxResults() != null && rows.size() > 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 <T> List<T> transformResults(List<T> results, LookupCustomizer.Transform<T, T> transform) {
final List<T> list = new ArrayList<T>();
for (T r : results) {
list.add(transform.apply(r));
}
return list;
}
/** gets results where only the count is requested. */
private <T> GenericQueryResults<T> forCountOnly(final Class<T> queryClass, final QueryByCriteria criteria, final Criteria ojbCriteria) { | |
| File | Line |
|---|---|
| org/kuali/rice/krad/web/controller/UifControllerBase.java | 545 |
| org/kuali/rice/krad/web/controller/UifControllerBase.java | 591 |
AttributeQueryResult performFieldQuery(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
HttpServletRequest request, HttpServletResponse response) {
// retrieve query fields from request
Map<String, String> queryParameters = new HashMap<String, String>();
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);
} | |
| File | Line |
|---|---|
| org/kuali/rice/krad/criteria/CriteriaLookupDaoJpa.java | 68 |
| org/kuali/rice/krad/criteria/CriteriaLookupDaoOjb.java | 66 |
final Criteria parent = new Criteria();
if (criteria.getPredicate() != null) {
addPredicate(criteria.getPredicate(), parent, customizer.getPredicateTransform());
}
switch (criteria.getCountFlag()) {
case ONLY:
return forCountOnly(queryClass, criteria, parent);
case NONE:
return forRowResults(queryClass, criteria, parent, criteria.getCountFlag(), customizer.getResultTransform());
case INCLUDE:
return forRowResults(queryClass, criteria, parent, criteria.getCountFlag(), customizer.getResultTransform());
default: throw new UnsupportedCountFlagException(criteria.getCountFlag());
}
}
/** gets results where the actual rows are requested. */
private <T> GenericQueryResults<T> forRowResults(final Class<T> queryClass, final QueryByCriteria criteria, final Criteria ojbCriteria, CountFlag flag, LookupCustomizer.Transform<T, T> transform) { | |
| File | Line |
|---|---|
| org/kuali/rice/krad/util/ObjectUtils.java | 515 |
| org/kuali/rice/krad/util/ObjectUtils.java | 557 |
if (depth == 0 || isNull(bo) || !PropertyUtils.isReadable(bo, propertyName)) {
return;
}
// need to materialize the updateable collections before resetting the property, because it may be used in the retrieval
materializeUpdateableCollections(bo);
// Set the property in the BO
setObjectProperty(bo, propertyName, type, propertyValue);
// Now drill down and check nested BOs and BO lists
PropertyDescriptor[] propertyDescriptors = PropertyUtils.getPropertyDescriptors(bo.getClass());
for (int i = 0; i < propertyDescriptors.length; i++) {
PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
// Business Objects
if (propertyDescriptor.getPropertyType() != null && (BusinessObject.class).isAssignableFrom(propertyDescriptor.getPropertyType()) && PropertyUtils.isReadable(bo, propertyDescriptor.getName())) {
Object nestedBo = getPropertyValue(bo, propertyDescriptor.getName());
if (nestedBo instanceof BusinessObject) {
setObjectPropertyDeep((BusinessObject) nestedBo, propertyName, type, propertyValue, depth - 1); | |
| File | Line |
|---|---|
| org/kuali/rice/krad/uif/view/History.java | 200 |
| org/kuali/rice/krad/uif/view/History.java | 233 |
for (int j = 0; j < historyEntries.size(); j++) {
historyParam = historyParam + ENTRY_TOKEN + historyEntries.get(j).toParam();
}
historyParam = historyParam.replaceFirst("\\" + ENTRY_TOKEN, "");
try {
historyParam = URLEncoder.encode(historyParam, "UTF-8");
} catch (Exception e) {
LOG.error("Error encoding history param", e);
}
String url = "";
if (breadcrumb.getUrl().contains("?")) {
url = breadcrumb.getUrl() + "&" + UifConstants.UrlParams.HISTORY + "=" + historyParam;
} else {
url = breadcrumb.getUrl() + "?" + UifConstants.UrlParams.HISTORY + "=" + historyParam;
}
breadcrumb.setUrl(url); | |
| File | Line |
|---|---|
| org/kuali/rice/krad/criteria/CriteriaLookupDaoJpa.java | 49 |
| org/kuali/rice/krad/criteria/CriteriaLookupDaoOjb.java | 47 |
@Override
public <T> GenericQueryResults<T> lookup(final Class<T> queryClass, final QueryByCriteria criteria) {
return lookup(queryClass, criteria, LookupCustomizer.Builder.<T>create().build());
}
@Override
public <T> GenericQueryResults<T> lookup(final Class<T> queryClass, final QueryByCriteria criteria, LookupCustomizer<T> 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(); | |
| File | Line |
|---|---|
| org/kuali/rice/krad/criteria/CriteriaLookupDaoJpa.java | 143 |
| org/kuali/rice/krad/criteria/CriteriaLookupDaoOjb.java | 141 |
parent.addIsNull(pp);
} else if (p instanceof SingleValuedPredicate) {
addSingleValuePredicate((SingleValuedPredicate) p, parent);
} else if (p instanceof MultiValuedPredicate) {
addMultiValuePredicate((MultiValuedPredicate) p, parent);
} else {
throw new UnsupportedPredicateException(p);
}
} else if (p instanceof CompositePredicate) {
addCompositePredicate((CompositePredicate) p, parent, transform);
} else {
throw new UnsupportedPredicateException(p);
}
}
/** adds a single valued predicate to a Criteria. */
private void addSingleValuePredicate(SingleValuedPredicate p, Criteria parent) {
final Object value = getVal(p.getValue());
final String pp = p.getPropertyPath();
if (p instanceof EqualPredicate) {
parent.addEqualTo(pp, value); | |
| File | Line |
|---|---|
| org/kuali/rice/krad/util/documentserializer/DocumentSerializationState.java | 50 |
| org/kuali/rice/krad/util/documentserializer/SerializationState.java | 51 |
public SerializationState(){
pathElements = new ArrayList<SerializationPropertyElement>();
}
/**
* 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();
}
} | |
| File | Line |
|---|---|
| org/kuali/rice/krad/document/authorization/DocumentAuthorizerBase.java | 171 |
| org/kuali/rice/krad/uif/authorization/DocumentAuthorizerBase.java | 154 |
user.getPrincipalId(), additionalPermissionDetails, null );
}
public final boolean canOpen(Document document, Person user) {
return isAuthorizedByTemplate(document, KRADConstants.KRAD_NAMESPACE,
KimConstants.PermissionTemplateNames.OPEN_DOCUMENT, user
.getPrincipalId());
}
public final boolean canAddNoteAttachment(Document document,
String attachmentTypeCode, Person user) {
Map<String, String> additionalPermissionDetails = new HashMap<String, String>();
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); | |
| File | Line |
|---|---|
| org/kuali/rice/krad/bo/authorization/BusinessObjectAuthorizerBase.java | 237 |
| org/kuali/rice/krad/uif/authorization/AuthorizerBase.java | 224 |
addPermissionDetails(primaryDataObjectOrDocument, permissionDetails);
return permissionDetails;
}
protected static final PermissionService getPermissionService() {
if (permissionService == null) {
permissionService = KimApiServiceLocator.getPermissionService();
}
return permissionService;
}
protected static final PersonService getPersonService() {
if (personService == null) {
personService = KimApiServiceLocator.getPersonService();
}
return personService;
}
protected static final KualiModuleService getKualiModuleService() {
if (kualiModuleService == null) {
kualiModuleService = KRADServiceLocatorWeb.getKualiModuleService();
}
return kualiModuleService;
}
protected static final DataDictionaryService getDataDictionaryService() {
if (dataDictionaryService == null) {
dataDictionaryService = KRADServiceLocatorWeb.getDataDictionaryService();
}
return dataDictionaryService;
}
} | |