/**
   * @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;
  }
  @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;
  }
 /*
  * create the view link url for protocolsubmission
  */
 protected AnchorHtmlData getViewLink(ProtocolSubmissionBase protocolSubmission) {
   AnchorHtmlData viewHtmlData =
       super.getViewLink(protocolSubmission.getProtocol().getProtocolDocument());
   String submissionIdParam = "&submissionId=" + protocolSubmission.getSubmissionId();
   String href = viewHtmlData.getHref();
   href = href.replace(DOC_TYPE_NAME_PARAM, submissionIdParam + DOC_TYPE_NAME_PARAM);
   viewHtmlData.setHref(href);
   return viewHtmlData;
 }
  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;
  }
 protected void addCopyLink(
     BusinessObject businessObject,
     List<String> pkNames,
     List<HtmlData> htmlDataList,
     String hrefPattern,
     String methodToCall) {
   AnchorHtmlData htmlData = getUrlData(businessObject, methodToCall, pkNames);
   AwardDocument document = ((Award) businessObject).getAwardDocument();
   htmlData.setHref(
       String.format(hrefPattern, document.getDocumentNumber(), getDocumentTypeName()));
   htmlDataList.add(htmlData);
 }
  /**
   * @see
   *     org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getCustomActionUrls(org.kuali.rice.krad.bo.BusinessObject,
   *     java.util.List)
   */
  @Override
  public List<HtmlData> getCustomActionUrls(BusinessObject bo, List pkNames) {
    Map<String, String> permissionDetails = new HashMap<String, String>();
    permissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, "KFS-CAB");
    permissionDetails.put(
        KimConstants.AttributeConstants.ACTION_CLASS, "CapitalAssetInformationAction");

    if (!SpringContext.getBean(IdentityManagementService.class)
        .isAuthorizedByTemplateName(
            GlobalVariables.getUserSession().getPrincipalId(),
            KRADConstants.KNS_NAMESPACE,
            KimConstants.PermissionTemplateNames.USE_SCREEN,
            permissionDetails,
            null)) {
      return super.getEmptyActionUrls();
    }

    GeneralLedgerEntry entry = (GeneralLedgerEntry) bo;
    List<HtmlData> anchorHtmlDataList = new ArrayList<HtmlData>();
    if (entry.isActive()) {
      AnchorHtmlData processLink =
          new AnchorHtmlData(
              "../cabCapitalAssetInformation.do?methodToCall=process&"
                  + CabPropertyConstants.GeneralLedgerEntry.GENERAL_LEDGER_ACCOUNT_IDENTIFIER
                  + "="
                  + entry.getGeneralLedgerAccountIdentifier(),
              "process",
              "process");
      processLink.setTarget(entry.getGeneralLedgerAccountIdentifier().toString());
      anchorHtmlDataList.add(processLink);
    } else {
      List<GeneralLedgerEntryAsset> generalLedgerEntryAssets = entry.getGeneralLedgerEntryAssets();
      if (!generalLedgerEntryAssets.isEmpty()) {
        for (GeneralLedgerEntryAsset generalLedgerEntryAsset : generalLedgerEntryAssets) {
          AnchorHtmlData viewDocLink =
              new AnchorHtmlData(
                  "../cabCapitalAssetInformation.do?methodToCall=viewDoc&"
                      + "documentNumber"
                      + "="
                      + generalLedgerEntryAsset.getCapitalAssetManagementDocumentNumber(),
                  "viewDoc",
                  generalLedgerEntryAsset.getCapitalAssetManagementDocumentNumber());
          viewDocLink.setTarget(
              generalLedgerEntryAssets.get(0).getCapitalAssetManagementDocumentNumber());
          anchorHtmlDataList.add(viewDocLink);
        }
      } else {
        anchorHtmlDataList.add(new AnchorHtmlData("", "n/a", "n/a"));
      }
    }
    return anchorHtmlDataList;
  }
  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;
  }
  /**
   * ASR-1212: append the rice prefix for inquiry url
   *
   * @see
   *     org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getInquiryUrl(org.kuali.rice.kns.bo.BusinessObject,
   *     java.lang.String)
   */
  @Override
  public HtmlData getInquiryUrl(BusinessObject bo, String propertyName) {
    HtmlData inquiryUrl = super.getInquiryUrl(bo, propertyName);

    if (StringUtils.isNotBlank(((AnchorHtmlData) inquiryUrl).getHref())) {
      ((AnchorHtmlData) inquiryUrl)
          .setHref(KFSConstants.RICE_PATH_PREFIX + ((AnchorHtmlData) inquiryUrl).getHref());
    }

    // setting up url should exclude total debit/credit entry
    if ((KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE.equals(propertyName))
        && (TOTAL.equals(((TrialBalanceReport) bo).getChartOfAccountsCode()))) {
      ((AnchorHtmlData) inquiryUrl).setHref("");
    }
    return inquiryUrl;
  }
  protected AnchorHtmlData getCopyLink(Award award, Boolean readOnly) {
    AnchorHtmlData htmlData = new AnchorHtmlData();
    htmlData.setDisplayText("copy");
    Properties parameters = new Properties();
    parameters.put(KNSConstants.DISPATCH_REQUEST_PARAMETER, "awardActions");
    parameters.put(KNSConstants.PARAMETER_COMMAND, KEWConstants.DOCSEARCH_COMMAND);
    parameters.put(KNSConstants.DOCUMENT_TYPE_NAME, getDocumentTypeName());
    parameters.put("viewDocument", readOnly.toString());
    parameters.put("docId", award.getAwardDocument().getDocumentNumber());
    parameters.put("docOpenedFromAwardSearch", "true");
    parameters.put("placeHolderAwardId", award.getAwardId().toString());
    String href = UrlFactory.parameterizeUrl("../" + getHtmlAction(), parameters);

    htmlData.setHref(href);
    return htmlData;
  }
 @Override
 public HtmlData getInquiryUrl(BusinessObject bo, String propertyName) {
   AnchorHtmlData inquiryHref = (AnchorHtmlData) super.getInquiryUrl(bo, propertyName);
   if (StringUtils.isNotBlank(inquiryHref.getHref())) {
     inquiryHref.setHref(
         new StringBuffer(inquiryHref.getHref())
             .append("&")
             .append(OLEPropertyConstants.COMPONENT_CLASS)
             .append("=")
             .append(((DataMappingFieldDefinition) bo).getComponentClass())
             .append("&")
             .append(OLEPropertyConstants.PROPERTY_NAME)
             .append("=")
             .append(((DataMappingFieldDefinition) bo).getPropertyName())
             .toString());
   }
   return inquiryHref;
 }
Example #12
0
  /**
   * Overrides the helper method to build an inquiry url for a result field. For the Vendor URL
   * field, returns the url address as the inquiry URL, so that Vendor URL functions as a hyperlink.
   *
   * @param bo the business object instance to build the urls for
   * @param propertyName the property which links to an inquirable
   * @return String url to inquiry
   */
  @Override
  public HtmlData getInquiryUrl(
      BusinessObject businessObject, String attributeName, boolean forceInquiry) {

    boolean hasPermission = false;
    String documentTypeName = OLEConstants.OleLoadSummary.LOAD_SUMMARY;
    String nameSpaceCode = OLEConstants.OleLoadSummary.LOAD_SUMMARY_NAMESPACE;
    if (LOG.isDebugEnabled()) {
      LOG.debug("Inside getInquiryUrl documentTypeName   >>>>>>>>>>>>>>>>>" + documentTypeName);
      LOG.debug("Inside getInquiryUrl nameSpaceCode  >>>>>>>>>>>>>>>>>" + nameSpaceCode);
    }
    hasPermission =
        SpringContext.getBean(IdentityManagementService.class)
            .hasPermission(
                GlobalVariables.getUserSession().getPerson().getPrincipalId(),
                nameSpaceCode,
                OLEConstants.OleLoadSummary.CAN_SEARCH_LOAD_SUMMARY);

    if (!hasPermission) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Inside getInquiryUrl hasPermission   if>>>>>>>>>>>>>>>>>" + hasPermission);
      }
      throw new DocumentAuthorizationException(
          GlobalVariables.getUserSession().getPerson().getPrincipalName(),
          " to edit reuisition document ",
          "dfsf");
    } else {
      if (businessObject instanceof OleLoadSumRecords
          && attributeName.equalsIgnoreCase("documentNumber")) {
        List<String> primaryKeys = new ArrayList<String>();
        primaryKeys.add("documentNumber");
        String href =
            (getInquiryUrlForPrimaryKeys(
                    OleLoadSumRecords.class, businessObject, primaryKeys, null))
                .getHref();
        AnchorHtmlData htmlData = new AnchorHtmlData();
        htmlData.setHref(href);
        return htmlData;
      }

      return super.getInquiryUrl(businessObject, attributeName, forceInquiry);
    }
  }
 /**
  * Using default results, add columnAnchor link for reference financial document number to open
  * document
  *
  * @param lookupForm
  * @param kualiLookupable
  * @param resultTable
  * @param bounded
  * @return KRAD Conversion: Lookupable performing customization of columns of the display list.
  */
 @Override
 public Collection performLookup(LookupForm lookupForm, Collection resultTable, boolean bounded) {
   Collection displayList = super.performLookup(lookupForm, resultTable, bounded);
   for (ResultRow row : (Collection<ResultRow>) resultTable) {
     for (Column col : row.getColumns()) {
       if (StringUtils.equals("referenceFinancialDocumentNumber", col.getPropertyName())
           && StringUtils.isNotBlank(col.getPropertyValue())) {
         String propertyURL =
             SpringContext.getBean(ConfigurationService.class)
                     .getPropertyValueAsString(KFSConstants.WORKFLOW_URL_KEY)
                 + "/DocHandler.do?docId="
                 + col.getPropertyValue()
                 + "&command=displayDocSearchView";
         AnchorHtmlData htmlData = new AnchorHtmlData(propertyURL, "", col.getPropertyValue());
         htmlData.setTitle(col.getPropertyValue());
         col.setColumnAnchor(htmlData);
       }
     }
   }
   return displayList;
 }
 /**
  * @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;
 }
  /**
   * get the inquiry URL for the specified attribute
   *
   * @param detailLine the detail line containing the given attribute
   * @param attributeName the specified attribute name
   * @return the inquiry URL for the specified attribute
   */
  protected HtmlData getCustomizedInquiryUrl(
      EffortCertificationDetail detailLine, String attributeName) {
    if (StringUtils.equals(attributeName, KFSPropertyConstants.POSITION_NUMBER)) {
      AnchorHtmlData inquiryHref =
          (AnchorHtmlData)
              getEffortPositionDataDetailsInquirableImpl().getInquiryUrl(detailLine, attributeName);
      inquiryHref.setHref(this.getCompleteURL(inquiryHref.getHref()));
      return inquiryHref;
    }

    AnchorHtmlData inquiryHref =
        (AnchorHtmlData) getInquirable().getInquiryUrl(detailLine, attributeName, false);
    inquiryHref.setHref(this.getCompleteURL(inquiryHref.getHref()));

    return inquiryHref;
  }
  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;
  }