Esempio n. 1
0
  @Override
  public AnchorHtmlData getInquiryUrlForPrimaryKeys(
      Class clazz, Object businessObject, List<String> primaryKeys, String displayText) {
    if (businessObject == null) {
      return new AnchorHtmlData(KRADConstants.EMPTY_STRING, KRADConstants.EMPTY_STRING);
    }

    OleLoadSumRecords oleLoadSumRecords = (OleLoadSumRecords) businessObject;
    Properties parameters = new Properties();
    Map<String, String> fieldList = new HashMap<String, String>();
    parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, "docHandler");
    parameters.put(OLEConstants.DOCUMENT_TYPE_NAME, "OLE_ACQBTHUPLOAD");
    parameters.put(OLEConstants.PARAMETER_COMMAND, "displayDocSearchView");
    parameters.put("docId", oleLoadSumRecords.getDocumentNumber().toString());
    fieldList.put("docId", oleLoadSumRecords.getDocumentNumber().toString());
    if (StringUtils.isEmpty(displayText)) {
      return getHyperLink(
          clazz,
          fieldList,
          UrlFactory.parameterizeUrl(OLEConstants.BATCH_UPLOAD_ACTION_PATH, parameters));
    } else {
      return getHyperLink(
          clazz,
          fieldList,
          UrlFactory.parameterizeUrl(OLEConstants.BATCH_UPLOAD_ACTION_PATH, parameters),
          displayText);
    }
  }
Esempio n. 2
0
 public String constructIframeUrl(String baseUrl, String id) {
   Properties parameters = new Properties();
   parameters.put(HREF, constructUrl(baseUrl, id));
   parameters.put(RETURN_LOCATION, getRedirectViewUrl());
   parameters.put(METHOD_TO_CALL, START);
   return UrlFactory.parameterizeUrl(getIframeViewUrl(), parameters);
 }
  /**
   * @see
   *     org.kuali.rice.kns.lookup.LookupableHelperService#getCustomActionUrls(org.kuali.rice.krad.bo.BusinessObject,
   *     java.util.List, java.util.List pkNames)
   */
  @Override
  public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
    BudgetConstructionPositionSelect positionSelect =
        (BudgetConstructionPositionSelect) businessObject;

    Properties parameters = new Properties();
    parameters.put(
        KFSConstants.DISPATCH_REQUEST_PARAMETER, BCConstants.POSITION_SALARY_SETTING_METHOD);

    parameters.put(
        KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR,
        positionSelect.getUniversityFiscalYear().toString());
    parameters.put(BCPropertyConstants.POSITION_NUMBER, positionSelect.getPositionNumber());
    parameters.put(BCPropertyConstants.SINGLE_ACCOUNT_MODE, "false");
    parameters.put(BCPropertyConstants.ADD_LINE, "false");

    String href =
        UrlFactory.parameterizeUrl(BCConstants.POSITION_SALARY_SETTING_ACTION, parameters);
    List<HtmlData> anchorHtmlDataList = new ArrayList<HtmlData>();
    AnchorHtmlData anchorHtmlData =
        new AnchorHtmlData(href, BCConstants.POSITION_SALARY_SETTING_METHOD, "Posn Salset");
    anchorHtmlData.setTarget(BCConstants.SECOND_WINDOW_TARGET_NAME);
    anchorHtmlDataList.add(anchorHtmlData);

    return anchorHtmlDataList;
  }
Esempio n. 4
0
 private String constructUrl(String baseUrl, String id) {
   Properties parameters = new Properties();
   parameters.put(DOC_ID, id);
   parameters.put(COMMAND, DISPLAY_DOC_SEARCH_VIEW);
   parameters.put(VIEW_DOCUMENT, TRUE);
   return UrlFactory.parameterizeUrl(baseUrl, parameters);
 }
Esempio n. 5
0
  /**
   * This method builds the forward url.
   *
   * @param batchId the batch id
   * @param success action status: true if success, false otherwise
   * @param message the message for the user
   * @return the build url
   */
  private String buildUrl(String batchId, boolean success, String message, String errorList) {
    String basePath =
        SpringContext.getBean(ConfigurationService.class)
            .getPropertyValueAsString(KFSConstants.APPLICATION_URL_KEY);

    Properties parameters = new Properties();
    parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.SEARCH_METHOD);
    parameters.put(
        KFSConstants.BACK_LOCATION, basePath + "/" + KFSConstants.MAPPING_PORTAL + ".do");
    parameters.put(KRADConstants.DOC_FORM_KEY, "88888888");
    parameters.put(KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, Batch.class.getName());
    parameters.put(KFSConstants.HIDE_LOOKUP_RETURN_LINK, "true");
    parameters.put(KFSConstants.SUPPRESS_ACTIONS, "false");
    parameters.put(PdpPropertyConstants.BatchConstants.BATCH_ID, batchId);
    parameters.put(PdpParameterConstants.ACTION_SUCCESSFUL_PARAM, String.valueOf(success));
    if (message != null && !message.equalsIgnoreCase(KFSConstants.EMPTY_STRING)) {
      parameters.put(PdpParameterConstants.MESSAGE_PARAM, message);
    }

    if (StringUtils.isNotEmpty(errorList)) {
      parameters.put(PdpParameterConstants.ERROR_KEY_LIST_PARAM, errorList);
    }

    String lookupUrl =
        UrlFactory.parameterizeUrl(basePath + "/" + KFSConstants.LOOKUP_ACTION, parameters);

    return lookupUrl;
  }
  @Override
  protected String getActionUrlHref(
      LookupForm lookupForm, Object dataObject, String methodToCall, List<String> pkNames) {
    LOG.debug("Inside getActionUrlHref()");
    LookupView lookupView = (LookupView) lookupForm.getView();

    Properties props = new Properties();
    props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
    Map<String, String> primaryKeyValues =
        KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
    for (String primaryKey : primaryKeyValues.keySet()) {
      String primaryKeyValue = primaryKeyValues.get(primaryKey);

      props.put(primaryKey, primaryKeyValue);
    }

    if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
      props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
    }

    props.put(UifParameters.DATA_OBJECT_CLASS_NAME, OleFixedDueDate.class.getName());
    props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());

    String maintenanceMapping = OLEConstants.FIXED_DUE_DATE_CONTROLLER;

    return UrlFactory.parameterizeUrl(maintenanceMapping, props);
  }
  @Override
  public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
    List<HtmlData> customActionUrls = super.getCustomActionUrls(businessObject, pkNames);

    ObjectCode objectCode = (ObjectCode) businessObject;
    String financialObjectCode = objectCode.getFinancialObjectCode();
    String chartOfAccountsCode = objectCode.getChartOfAccountsCode();
    Integer universityFiscalYear = objectCode.getUniversityFiscalYear();

    Properties params = new Properties();
    params.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, getBusinessObjectClass().getName());
    params.put(
        KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
    params.put("financialObjectCode", financialObjectCode);
    params.put("chartOfAccountsCode", chartOfAccountsCode);
    params.put("universityFiscalYear", universityFiscalYear);
    AnchorHtmlData viewUrl =
        new AnchorHtmlData(
            UrlFactory.parameterizeUrl(KRADConstants.INQUIRY_ACTION, params), "view");
    viewUrl.setDisplayText("view");
    viewUrl.setTarget(AnchorHtmlData.TARGET_BLANK);
    customActionUrls.add(viewUrl);

    return customActionUrls;
  }
  /**
   * @see
   *     org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getCustomActionUrls(org.kuali.rice.kns.bo.BusinessObject,
   *     java.util.List)
   */
  @Override
  public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
    List<HtmlData> htmlDataList = super.getCustomActionUrls(businessObject, pkNames);

    TemRoleService temRoleService = SpringContext.getBean(TemRoleService.class);
    boolean profileAdmin =
        temRoleService.isProfileAdmin(
            GlobalVariables.getUserSession().getPerson(),
            ((TemProfileFromKimPerson) businessObject).getPrimaryDepartmentCode());

    if (!profileAdmin) {
      return htmlDataList;
    }

    String principalId = ((TemProfileFromKimPerson) businessObject).getPrincipalId();

    if (!StringUtils.isBlank(principalId)) {
      Properties parameters = new Properties();
      parameters.put(KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, TemProfile.class.getName());
      parameters.put(KFSConstants.OVERRIDE_KEYS, "principalId");
      parameters.put(KFSConstants.REFRESH_CALLER, "principalId" + "::" + principalId);
      parameters.put("principalId", principalId);

      Map<String, String> criteria = new HashMap<String, String>(2);
      criteria.put("principalId", principalId);

      // If a TEM Profile doesn't exist, display a create link
      if (temProfileService.findTemProfile(criteria) == null) {
        parameters.put(
            KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.MAINTENANCE_NEW_METHOD_TO_CALL);

        String href = UrlFactory.parameterizeUrl(KFSConstants.MAINTENANCE_ACTION, parameters);
        AnchorHtmlData anchorHtmlData = new AnchorHtmlData(href, "start", "create new profile");
        htmlDataList.add(anchorHtmlData);
      } else {
        // An active TEM Profile exists, display an edit link
        parameters.put(
            KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.MAINTENANCE_EDIT_METHOD_TO_CALL);

        String href = UrlFactory.parameterizeUrl(KFSConstants.MAINTENANCE_ACTION, parameters);
        AnchorHtmlData anchorHtmlData = new AnchorHtmlData(href, "start", "edit profile");
        htmlDataList.add(anchorHtmlData);
      }
    }

    return htmlDataList;
  }
  /**
   * @see
   *     org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase#route(org.apache.struts.action.ActionMapping,
   *     org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest,
   *     javax.servlet.http.HttpServletResponse)
   */
  @Override
  public ActionForward route(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    AccountsPayableFormBase apForm = (AccountsPayableFormBase) form;

    // set the last update user id
    AccountsPayableDocumentBase document = (AccountsPayableDocumentBase) apForm.getDocument();
    document.setLastActionPerformedByPersonId(
        GlobalVariables.getUserSession().getPerson().getPrincipalId());

    // if form is not yet calculated, return and prompt user to calculate
    if (requiresCaculate(apForm)) {
      GlobalVariables.getMessageMap()
          .putError(
              KFSConstants.DOCUMENT_ERRORS, PurapKeyConstants.ERROR_APPROVE_REQUIRES_CALCULATE);
      return mapping.findForward(KFSConstants.MAPPING_BASIC);
    }

    // recalculate
    customCalculate((AccountsPayableDocument) apForm.getDocument());

    // route
    ActionForward forward = super.route(mapping, form, request, response);

    // if successful, then redirect back to init
    boolean successMessageFound = false;
    MessageList messageList = KNSGlobalVariables.getMessageList();
    for (int i = 0; i < messageList.size(); i++) {
      if (StringUtils.equals(
          messageList.get(i).getErrorKey(), RiceKeyConstants.MESSAGE_ROUTE_SUCCESSFUL)) {
        successMessageFound = true;
        break;
      }
    }

    if (successMessageFound) {
      String basePath =
          SpringContext.getBean(ConfigurationService.class)
              .getPropertyValueAsString(KFSConstants.APPLICATION_URL_KEY);

      Properties parameters = new Properties();
      parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.DOC_HANDLER_METHOD);
      parameters.put(KFSConstants.PARAMETER_COMMAND, "initiate");
      parameters.put(KFSConstants.DOCUMENT_TYPE_NAME, apForm.getDocTypeName());

      String lookupUrl =
          UrlFactory.parameterizeUrl(
              basePath + "/" + "purap" + this.getActionName() + ".do", parameters);
      forward = new ActionForward(lookupUrl, true);
    }

    return forward;
  }
Esempio n. 10
0
 protected String makeMaintenaceUrl(String docId, String committeeId) {
   String baseURL = getDocHandlerService().getDocHandlerUrl(docId);
   final Properties parameters = new Properties();
   parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
   parameters.put(KRADConstants.PARAMETER_COMMAND, KewApiConstants.INITIATE_COMMAND);
   parameters.put(KRADConstants.DOCUMENT_TYPE_NAME, COMMITTEE_DOCUMENT);
   parameters.put(COMMITTEE_ID, committeeId);
   return UrlFactory.parameterizeUrl(baseURL, parameters);
 }
  protected AnchorHtmlData getPrintLink(String proposalNumber) {
    AnchorHtmlData htmlData = new AnchorHtmlData();
    htmlData.setDisplayText(PRINT_LINK);
    Properties parameters = new Properties();
    parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, PRINT_PROPOSAL_LOG);
    parameters.put(PROPOSAL_NUMBER, proposalNumber);
    String href = UrlFactory.parameterizeUrl(PRINT_PROPOSAL_LOG_ACTION, parameters);

    htmlData.setHref(href);
    return htmlData;
  }
 /**
  * This method returns the Agency inquiry url
  *
  * @param bo business object
  * @param columnTitle
  * @return Returns the url for the Agency Inquiry
  */
 private String getAgencyInquiryUrl(BusinessObject bo, String columnTitle) {
   Properties params = new Properties();
   ContractsAndGrantsAgingReport detail = (ContractsAndGrantsAgingReport) bo;
   params.put(
       KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE,
       ContractsAndGrantsBillingAgency.class.getName());
   params.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, "continueWithInquiry");
   params.put(KFSConstants.DOC_FORM_KEY, "88888888");
   params.put(KFSConstants.HIDE_LOOKUP_RETURN_LINK, "true");
   params.put(KFSPropertyConstants.AGENCY_NUMBER, detail.getAgencyNumber());
   return UrlFactory.parameterizeUrl(KFSConstants.INQUIRY_ACTION, params);
 }
 /**
  * This method returns the url for the paid invoice of the customer
  *
  * @param bo
  * @param columnTitle
  * @return Returns the url for the Payment Application search.
  */
 private String getCreditMemoDocSearchUrl(BusinessObject bo, String columnTitle) {
   Properties params = new Properties();
   ContractsAndGrantsAgingReport detail = (ContractsAndGrantsAgingReport) bo;
   //      Note
   params.put(
       KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, DocumentSearchCriteriaBo.class.getName());
   params.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.START_METHOD);
   params.put(KFSConstants.DOC_FORM_KEY, "88888888");
   params.put(KFSConstants.HIDE_LOOKUP_RETURN_LINK, "true");
   params.put(KFSConstants.DOCUMENT_TYPE_FULL_NAME, "CRM");
   params.put(ArPropertyConstants.CustomerFields.CUSTOMER_NUMBER, detail.getCustomerNumber());
   return UrlFactory.parameterizeUrl(KFSConstants.LOOKUP_ACTION, params);
 }
  protected AnchorHtmlData getSelectLinkForProposalCreation(ProposalLog proposalLog) {
    AnchorHtmlData htmlData = new AnchorHtmlData();
    htmlData.setDisplayText(DISPLAY_TEXT);
    Properties parameters = new Properties();
    parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, DOC_HANDLER);
    parameters.put(KRADConstants.PARAMETER_COMMAND, INITIATE);
    parameters.put(KRADConstants.DOCUMENT_TYPE_NAME, INST_PROP_DOC_NAME);
    parameters.put(PROPOSAL_NUMBER, proposalLog.getProposalNumber());
    String href = UrlFactory.parameterizeUrl(INSTITUTIONAL_PROPOSAL_HOME_ACTION, parameters);

    htmlData.setHref(href);
    return htmlData;
  }
  protected HtmlData getViewAssetUrl(Asset asset) {
    Properties parameters = new Properties();
    parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.START_METHOD);
    parameters.put(
        CamsPropertyConstants.Asset.CAPITAL_ASSET_NUMBER, asset.getCapitalAssetNumber().toString());
    parameters.put(
        KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, CapitalAssetManagementAsset.class.getName());

    String href = UrlFactory.parameterizeUrl(CamsConstants.INQUIRY_URL, parameters);

    AnchorHtmlData anchorHtmlData =
        new AnchorHtmlData(href, KFSConstants.START_METHOD, CamsConstants.AssetActions.VIEW);
    anchorHtmlData.setTarget("blank");
    return anchorHtmlData;
  }
 /**
  * @see
  *     org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getInquiryUrl(org.kuali.rice.krad.bo.BusinessObject,
  *     java.lang.String)
  */
 @Override
 public HtmlData getInquiryUrl(BusinessObject bo, String propertyName) {
   AnchorHtmlData inquiryUrl = (AnchorHtmlData) super.getInquiryUrl(bo, propertyName);
   Batch batch = (Batch) bo;
   if (propertyName.equalsIgnoreCase(PdpPropertyConstants.BatchConstants.BATCH_ID)) {
     Properties params = new Properties();
     params.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.SEARCH_METHOD);
     params.put(KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, PaymentDetail.class.getName());
     params.put(KRADConstants.DOC_FORM_KEY, "88888888");
     params.put(KFSConstants.HIDE_LOOKUP_RETURN_LINK, "true");
     params.put(
         KFSConstants.BACK_LOCATION,
         configurationService.getPropertyValueAsString(KRADConstants.APPLICATION_URL_KEY)
             + "/"
             + KFSConstants.MAPPING_PORTAL
             + ".do");
     params.put(
         PdpPropertyConstants.PaymentDetail.PAYMENT_GROUP_BATCH_ID,
         UrlFactory.encode(String.valueOf(batch.getId())));
     String url = UrlFactory.parameterizeUrl(KRADConstants.LOOKUP_ACTION, params);
     inquiryUrl.setHref(url);
   }
   return inquiryUrl;
 }
 /**
  * This method returns the customer lookup url
  *
  * @param bo business object
  * @param columnTitle
  * @return Returns the url for the customer lookup
  */
 private String getCustomerLookupUrl(BusinessObject bo, String columnTitle) {
   Properties params = new Properties();
   ContractsAndGrantsAgingReport detail = (ContractsAndGrantsAgingReport) bo;
   params.put(KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, Customer.class.getName());
   params.put(KFSConstants.RETURN_LOCATION_PARAMETER, "portal.do");
   params.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.START_METHOD);
   params.put(KFSConstants.DOC_FORM_KEY, "88888888");
   params.put(KFSConstants.HIDE_LOOKUP_RETURN_LINK, "true");
   params.put(
       ArPropertyConstants.CustomerInvoiceWriteoffLookupResultFields.CUSTOMER_NUMBER,
       detail.getCustomerNumber());
   params.put(
       ArPropertyConstants.CustomerInvoiceWriteoffLookupResultFields.CUSTOMER_NAME,
       detail.getCustomerName());
   return UrlFactory.parameterizeUrl(KFSConstants.LOOKUP_ACTION, params);
 }
  protected HtmlData getMergeUrl(Asset asset) {
    FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer =
        (FinancialSystemMaintenanceDocumentAuthorizerBase)
            SpringContext.getBean(DocumentDictionaryService.class)
                .getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_RETIREMENT_GLOBAL);
    boolean isAuthorized =
        documentAuthorizer.isAuthorized(
            asset,
            CamsConstants.CAM_MODULE_CODE,
            CamsConstants.PermissionNames.MERGE,
            GlobalVariables.getUserSession().getPerson().getPrincipalId());

    if (isAuthorized) {
      Properties parameters = new Properties();
      parameters.put(
          KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.MAINTENANCE_NEWWITHEXISTING_ACTION);
      parameters.put(
          KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, AssetRetirementGlobal.class.getName());
      parameters.put(
          CamsPropertyConstants.AssetRetirementGlobal.MERGED_TARGET_CAPITAL_ASSET_NUMBER,
          asset.getCapitalAssetNumber().toString());
      parameters.put(
          KFSConstants.OVERRIDE_KEYS,
          CamsPropertyConstants.AssetRetirementGlobal.RETIREMENT_REASON_CODE
              + KFSConstants.FIELD_CONVERSIONS_SEPERATOR
              + CamsPropertyConstants.AssetRetirementGlobal.MERGED_TARGET_CAPITAL_ASSET_NUMBER);
      parameters.put(
          CamsPropertyConstants.AssetRetirementGlobal.RETIREMENT_REASON_CODE,
          CamsConstants.AssetRetirementReasonCode.MERGED);
      parameters.put(
          KFSConstants.REFRESH_CALLER,
          CamsPropertyConstants.AssetRetirementGlobal.RETIREMENT_REASON_CODE
              + "::"
              + CamsConstants.AssetRetirementReasonCode.MERGED);

      String href = UrlFactory.parameterizeUrl(KFSConstants.MAINTENANCE_ACTION, parameters);

      return new AnchorHtmlData(
          href, CamsConstants.AssetActions.MERGE, CamsConstants.AssetActions.MERGE);
    } else {
      return new AnchorHtmlData("", "", "");
    }
  }
  protected HtmlData getTransferUrl(Asset asset) {
    boolean isAuthorized = true;
    boolean assetMovable = false;
    try {
      assetMovable = getAssetService().isAssetMovableCheckByPayment(asset);
    } catch (ValidationException ve) {
      isAuthorized = false;
    }
    if (!assetMovable) {
      FinancialSystemTransactionalDocumentAuthorizerBase documentAuthorizer =
          (FinancialSystemTransactionalDocumentAuthorizerBase)
              SpringContext.getBean(DocumentDictionaryService.class)
                  .getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_TRANSFER);
      isAuthorized =
          documentAuthorizer.isAuthorized(
              asset,
              CamsConstants.CAM_MODULE_CODE,
              CamsConstants.PermissionNames.SEPARATE,
              GlobalVariables.getUserSession().getPerson().getPrincipalId());
    }

    if (isAuthorized) {
      Properties parameters = new Properties();
      parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
      parameters.put(
          CamsPropertyConstants.AssetTransferDocument.CAPITAL_ASSET_NUMBER,
          asset.getCapitalAssetNumber().toString());
      parameters.put(KFSConstants.PARAMETER_COMMAND, "initiate");
      parameters.put(
          KFSConstants.DOCUMENT_TYPE_NAME, CamsConstants.DocumentTypeName.ASSET_TRANSFER);

      String href =
          UrlFactory.parameterizeUrl(
              CamsConstants.StrutsActions.ONE_UP + CamsConstants.StrutsActions.TRANSFER,
              parameters);

      return new AnchorHtmlData(
          href, KRADConstants.DOC_HANDLER_METHOD, CamsConstants.AssetActions.TRANSFER);
    } else {
      return new AnchorHtmlData("", "", "");
    }
  }
  protected HtmlData getSeparateUrl(Asset asset) {
    FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer =
        (FinancialSystemMaintenanceDocumentAuthorizerBase)
            SpringContext.getBean(DocumentDictionaryService.class)
                .getDocumentAuthorizer(CamsConstants.DocumentTypeName.ASSET_ADD_GLOBAL);
    boolean isAuthorized =
        documentAuthorizer.isAuthorized(
            asset,
            CamsConstants.CAM_MODULE_CODE,
            CamsConstants.PermissionNames.SEPARATE,
            GlobalVariables.getUserSession().getPerson().getPrincipalId());

    if (isAuthorized) {
      String href =
          UrlFactory.parameterizeUrl(KFSConstants.MAINTENANCE_ACTION, getSeparateParameters(asset));

      return new AnchorHtmlData(
          href, KFSConstants.MAINTENANCE_NEW_METHOD_TO_CALL, CamsConstants.AssetActions.SEPARATE);
    } else {
      return new AnchorHtmlData("", "", "");
    }
  }
  /**
   * This overridden method ...
   *
   * @see org.kuali.rice.krad.lookup.KualiLookupableImpl#getCreateNewUrl()
   */
  @Override
  public String getCreateNewUrl() {
    String url = "";

    if (getLookupableHelperService()
        .allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_PERMISSION_DOCUMENT_TYPE_NAME)) {
      Properties parameters = new Properties();
      parameters.put(
          KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
      parameters.put(
          KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, GenericPermissionBo.class.getName());
      if (StringUtils.isNotBlank(getReturnLocation())) {
        parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
      }
      url = UrlFactory.parameterizeUrl(KRADConstants.MAINTENANCE_ACTION, parameters);
      url =
          "<a title=\"Create a new record\" href=\""
              + url
              + "\"><img src=\"images/tinybutton-createnew.gif\" alt=\"create new\" width=\"70\" height=\"15\"/></a>";
    }

    return url;
  }
  /**
   * This method handles preparing all of the accounting line data so that it can be pushed up to
   * the balance inquiries for populating the search criteria of each.
   *
   * @param mapping
   * @param form
   * @param request
   * @param line
   * @return ActionForward
   */
  protected ActionForward performBalanceInquiryForAccountingLine(
      ActionMapping mapping, ActionForm form, HttpServletRequest request, AccountingLine line) {
    // build out base path for return location
    String basePath =
        request.getScheme()
            + "://"
            + request.getServerName()
            + ":"
            + request.getServerPort()
            + request.getContextPath();

    // build out the actual form key that will be used to retrieve the form on refresh
    String callerDocFormKey = GlobalVariables.getUserSession().addObjectWithGeneratedKey(form);

    // now add required parameters
    Properties parameters = new Properties();
    parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.START_METHOD);
    // need this next param b/c the lookup's return back will overwrite
    // the original doc form key
    parameters.put(KFSConstants.BALANCE_INQUIRY_REPORT_MENU_CALLER_DOC_FORM_KEY, callerDocFormKey);
    parameters.put(KFSConstants.DOC_FORM_KEY, callerDocFormKey);
    parameters.put(KFSConstants.BACK_LOCATION, basePath + mapping.getPath() + ".do");

    if (line.getPostingYear() != null) {
      parameters.put(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, line.getPostingYear().toString());
    }
    if (StringUtils.isNotBlank(line.getReferenceOriginCode())) {
      parameters.put("referenceOriginCode", line.getReferenceOriginCode());
    }
    if (StringUtils.isNotBlank(line.getReferenceNumber())) {
      parameters.put("referenceNumber", line.getReferenceNumber());
    }
    if (StringUtils.isNotBlank(line.getReferenceTypeCode())) {
      parameters.put("referenceTypeCode", line.getReferenceTypeCode());
    }
    if (StringUtils.isNotBlank(line.getDebitCreditCode())) {
      parameters.put("debitCreditCode", line.getDebitCreditCode());
    }
    if (StringUtils.isNotBlank(line.getChartOfAccountsCode())) {
      parameters.put("chartOfAccountsCode", line.getChartOfAccountsCode());
    }
    if (StringUtils.isNotBlank(line.getAccountNumber())) {
      parameters.put("accountNumber", line.getAccountNumber());
    }
    if (StringUtils.isNotBlank(line.getFinancialObjectCode())) {
      parameters.put("financialObjectCode", line.getFinancialObjectCode());
    }
    if (StringUtils.isNotBlank(line.getSubAccountNumber())) {
      parameters.put("subAccountNumber", line.getSubAccountNumber());
    }
    if (StringUtils.isNotBlank(line.getFinancialSubObjectCode())) {
      parameters.put("financialSubObjectCode", line.getFinancialSubObjectCode());
    }
    if (StringUtils.isNotBlank(line.getProjectCode())) {
      parameters.put("projectCode", line.getProjectCode());
    }
    if (StringUtils.isNotBlank(getObjectTypeCodeFromLine(line))) {
      if (!StringUtils.isBlank(line.getObjectTypeCode())) {
        parameters.put("objectTypeCode", line.getObjectTypeCode());
      } else {
        line.refreshReferenceObject("objectCode");
        parameters.put("objectTypeCode", line.getObjectCode().getFinancialObjectTypeCode());
      }
    }

    String lookupUrl =
        UrlFactory.parameterizeUrl(
            basePath + "/" + KFSConstants.BALANCE_INQUIRY_REPORT_MENU_ACTION, parameters);

    // register that we're going to come back w/ to this form w/ a refresh methodToCall
    ((KualiAccountingDocumentFormBase) form)
        .registerEditableProperty(KRADConstants.DISPATCH_REQUEST_PARAMETER);

    return new ActionForward(lookupUrl, true);
  }
Esempio n. 23
0
 protected String getIframeViewUrl() {
   Properties parameters = new Properties();
   parameters.put(VIEW_ID, KC_HEADER_IFRAME_VIEW);
   return UrlFactory.parameterizeUrl(getLandingPageUrl(), parameters);
 }
Esempio n. 24
0
 protected String getRedirectViewUrl() {
   Properties parameters = new Properties();
   parameters.put(VIEW_ID, KC_LANDING_PAGE_REDIRECT_VIEW);
   return UrlFactory.parameterizeUrl(getLandingPageUrl(), parameters);
 }
  /**
   * @see
   *     org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getCustomActionUrls(org.kuali.rice.krad.bo.BusinessObject,
   *     java.util.List)
   */
  @Override
  public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {

    if (businessObject instanceof Batch) {
      Person person = GlobalVariables.getUserSession().getPerson();
      Batch batch = (Batch) businessObject;
      Integer batchId = batch.getId().intValue();
      List<HtmlData> anchorHtmlDataList = new ArrayList<HtmlData>();
      String linkText = KFSConstants.EMPTY_STRING;
      String url = KFSConstants.EMPTY_STRING;
      String basePath =
          configurationService.getPropertyValueAsString(KFSConstants.APPLICATION_URL_KEY)
              + "/"
              + PdpConstants.Actions.BATCH_SEARCH_DETAIL_ACTION;

      if (pdpAuthorizationService.hasCancelPaymentPermission(person.getPrincipalId())
          && batchMaintenanceService.doBatchPaymentsHaveOpenOrHeldStatus(batchId)) {

        Properties params = new Properties();
        params.put(
            KFSConstants.DISPATCH_REQUEST_PARAMETER,
            PdpConstants.ActionMethods.CONFIRM_CANCEL_ACTION);
        params.put(
            PdpParameterConstants.BatchConstants.BATCH_ID_PARAM,
            UrlFactory.encode(String.valueOf(batchId)));
        url = UrlFactory.parameterizeUrl(basePath, params);

        linkText =
            configurationService.getPropertyValueAsString(
                PdpKeyConstants.BatchConstants.LinkText.CANCEL_BATCH);

        AnchorHtmlData anchorHtmlData =
            new AnchorHtmlData(url, PdpConstants.ActionMethods.CONFIRM_CANCEL_ACTION, linkText);
        anchorHtmlDataList.add(anchorHtmlData);
      }

      if (pdpAuthorizationService.hasHoldPaymentPermission(person.getPrincipalId())) {

        if (batchMaintenanceService.doBatchPaymentsHaveHeldStatus(batchId)) {

          Properties params = new Properties();
          params.put(
              KFSConstants.DISPATCH_REQUEST_PARAMETER,
              PdpConstants.ActionMethods.CONFIRM_REMOVE_HOLD_ACTION);
          params.put(
              PdpParameterConstants.BatchConstants.BATCH_ID_PARAM,
              UrlFactory.encode(String.valueOf(batchId)));
          url = UrlFactory.parameterizeUrl(basePath, params);

          linkText =
              configurationService.getPropertyValueAsString(
                  PdpKeyConstants.BatchConstants.LinkText.REMOVE_BATCH_HOLD);

          AnchorHtmlData anchorHtmlData =
              new AnchorHtmlData(
                  url, PdpConstants.ActionMethods.CONFIRM_REMOVE_HOLD_ACTION, linkText);
          anchorHtmlDataList.add(anchorHtmlData);
        } else if (batchMaintenanceService.doBatchPaymentsHaveOpenStatus(batchId)) {

          Properties params = new Properties();
          params.put(
              KFSConstants.DISPATCH_REQUEST_PARAMETER,
              PdpConstants.ActionMethods.CONFIRM_HOLD_ACTION);
          params.put(
              PdpParameterConstants.BatchConstants.BATCH_ID_PARAM,
              UrlFactory.encode(String.valueOf(batchId)));
          url = UrlFactory.parameterizeUrl(basePath, params);

          linkText =
              configurationService.getPropertyValueAsString(
                  PdpKeyConstants.BatchConstants.LinkText.HOLD_BATCH);
          AnchorHtmlData anchorHtmlData =
              new AnchorHtmlData(url, PdpConstants.ActionMethods.CONFIRM_HOLD_ACTION, linkText);
          anchorHtmlDataList.add(anchorHtmlData);
        }
      }

      if (anchorHtmlDataList.isEmpty()) {
        AnchorHtmlData anchorHtmlData = new AnchorHtmlData(url, "&nbsp;", "&nbsp;");
        anchorHtmlDataList.add(anchorHtmlData);
      }

      return anchorHtmlDataList;
    }
    return super.getEmptyActionUrls();
  }
  protected HtmlData getLoanUrl(Asset asset) {
    AnchorHtmlData anchorHtmlData = null;
    List<HtmlData> childURLDataList = new ArrayList<HtmlData>();

    Properties parameters = new Properties();
    parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
    parameters.put(
        CamsPropertyConstants.AssetTransferDocument.CAPITAL_ASSET_NUMBER,
        asset.getCapitalAssetNumber().toString());
    parameters.put(KFSConstants.PARAMETER_COMMAND, "initiate");
    parameters.put(
        KFSConstants.DOCUMENT_TYPE_NAME,
        CamsConstants.DocumentTypeName.ASSET_EQUIPMENT_LOAN_OR_RETURN);

    if (getAssetService().isAssetLoaned(asset)) {
      anchorHtmlData = new AnchorHtmlData("", "", "");

      AnchorHtmlData childURLData = new AnchorHtmlData("", "", CamsConstants.AssetActions.LOAN);
      childURLDataList.add(childURLData);

      parameters.put(CamsConstants.AssetActions.LOAN_TYPE, CamsConstants.AssetActions.LOAN_RENEW);
      String childHref =
          UrlFactory.parameterizeUrl(
              CamsConstants.StrutsActions.ONE_UP
                  + CamsConstants.StrutsActions.EQUIPMENT_LOAN_OR_RETURN,
              parameters);
      childURLData =
          new AnchorHtmlData(
              childHref, KRADConstants.DOC_HANDLER_METHOD, CamsConstants.AssetActions.LOAN_RENEW);
      childURLDataList.add(childURLData);

      parameters.remove(CamsConstants.AssetActions.LOAN_TYPE);
      parameters.put(CamsConstants.AssetActions.LOAN_TYPE, CamsConstants.AssetActions.LOAN_RETURN);
      childHref =
          UrlFactory.parameterizeUrl(
              CamsConstants.StrutsActions.ONE_UP
                  + CamsConstants.StrutsActions.EQUIPMENT_LOAN_OR_RETURN,
              parameters);
      childURLData =
          new AnchorHtmlData(
              childHref, KRADConstants.DOC_HANDLER_METHOD, CamsConstants.AssetActions.LOAN_RETURN);
      childURLDataList.add(childURLData);

      anchorHtmlData.setChildUrlDataList(childURLDataList);
    } else {
      anchorHtmlData = new AnchorHtmlData("", "", "");
      //
      AnchorHtmlData childURLData = new AnchorHtmlData("", "", "");
      if (asset.getCampusTagNumber() == null) {
        childURLData = new AnchorHtmlData("", "", CamsConstants.AssetActions.LOAN);
        childURLDataList.add(childURLData);
      } else {
        parameters.put(CamsConstants.AssetActions.LOAN_TYPE, CamsConstants.AssetActions.LOAN);
        String childHref =
            UrlFactory.parameterizeUrl(
                CamsConstants.StrutsActions.ONE_UP
                    + CamsConstants.StrutsActions.EQUIPMENT_LOAN_OR_RETURN,
                parameters);
        childURLData =
            new AnchorHtmlData(
                childHref, KRADConstants.DOC_HANDLER_METHOD, CamsConstants.AssetActions.LOAN);
        childURLDataList.add(childURLData);
      }

      childURLData = new AnchorHtmlData("", "", CamsConstants.AssetActions.LOAN_RENEW);
      childURLDataList.add(childURLData);

      childURLData = new AnchorHtmlData("", "", CamsConstants.AssetActions.LOAN_RETURN);
      childURLDataList.add(childURLData);

      anchorHtmlData.setChildUrlDataList(childURLDataList);
    }

    return anchorHtmlData;
  }
  private String getCustomerOpenInvoicesReportUrl(
      BusinessObject bo, String columnTitle, Map<String, String> fieldsMap) {

    Properties parameters = new Properties();

    ContractsAndGrantsAgingReport detail = (ContractsAndGrantsAgingReport) bo;

    parameters.put(
        KFSConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE,
        ContractsGrantsAgingOpenInvoicesReport.class.getName());
    parameters.put(
        "lookupableImplementaionServiceName", "arContractsGrantsAgingOpenInvoicesReportLookupable");
    parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.SEARCH_METHOD);
    parameters.put(
        "reportName", ArConstants.ContractsGrantsAgingReportFields.OPEN_INVOCE_REPORT_NAME);
    parameters.put(KFSConstants.DOC_FORM_KEY, "88888888");

    if (ObjectUtils.isNotNull(fieldsMap) && !fieldsMap.isEmpty()) {
      for (String key : fieldsMap.keySet()) {
        String val = fieldsMap.get(key);
        // put if val is not blank or null
        if (ObjectUtils.isNotNull(val) && StringUtils.isNotEmpty(val)) {
          parameters.put(key.toString(), fieldsMap.get(key).toString());
        }
      }
    }

    parameters.put(KFSPropertyConstants.CUSTOMER_NUMBER, detail.getCustomerNumber());
    parameters.put(KFSPropertyConstants.CUSTOMER_NAME, detail.getCustomerName());

    // Report Option
    if (ObjectUtils.isNotNull(reportOption)) {

      parameters.put(
          ArPropertyConstants.ContractsGrantsAgingReportFields.REPORT_OPTION, reportOption);
    }
    // Report Run Date
    DateFormatter dateFormatter = new DateFormatter();
    parameters.put(
        ArPropertyConstants.ContractsGrantsAgingReportFields.REPORT_RUN_DATE,
        dateFormatter.format(reportRunDate).toString());

    // put bucket dates
    if (StringUtils.equals(columnTitle, customerNumberLabel)) {
      parameters.put("columnTitle", KFSConstants.CustomerOpenItemReport.ALL_DAYS);
      parameters.put("startDate", "");
      parameters.put("endDate", dateFormatter.format(reportRunDate).toString());
    } else {
      if (StringUtils.equals(columnTitle, cutoffdate30Label)) {
        parameters.put(
            "startDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -30)).toString());
        parameters.put("endDate", dateFormatter.format(reportRunDate).toString());
      } else if (StringUtils.equals(columnTitle, cutoffdate60Label)) {
        parameters.put(
            "startDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -60)).toString());
        parameters.put(
            "endDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -31)).toString());
      } else if (StringUtils.equals(columnTitle, cutoffdate90Label)) {
        parameters.put(
            "startDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -90)).toString());
        parameters.put("endDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -61)));
      } else if (StringUtils.equals(columnTitle, cutoffdate91toSYSPRlabel)) {
        parameters.put(
            "startDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -120)).toString());
        parameters.put(
            "endDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -91)).toString());
      } else if (StringUtils.equals(columnTitle, cutoffdateSYSPRplus1orMorelabel)) {
        parameters.put("startDate", "");
        parameters.put(
            "endDate", dateFormatter.format(DateUtils.addDays(reportRunDate, -121)).toString());
        columnTitle =
            Integer.toString((Integer.parseInt(nbrDaysForLastBucket)) + 1) + " days and older";
      } else {
        parameters.put("startDate", "");
        parameters.put("endDate", dateFormatter.format(reportRunDate).toString());
      }
      parameters.put("columnTitle", columnTitle);
    }
    return UrlFactory.parameterizeUrl(
        "arContractsGrantsAgingOpenInvoicesReportLookup.do", parameters);
  }