コード例 #1
0
  /**
   * @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;
  }
コード例 #2
0
  @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;
  }
コード例 #3
0
  /**
   * @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;
  }
コード例 #4
0
  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;
  }