Example usage for org.apache.wicket.util.string StringValue valueOf

List of usage examples for org.apache.wicket.util.string StringValue valueOf

Introduction

In this page you can find the example usage for org.apache.wicket.util.string StringValue valueOf.

Prototype

public static StringValue valueOf(final AppendingStringBuffer buffer) 

Source Link

Document

Converts the given input to an instance of StringValue.

Usage

From source file:org.devgateway.eudevfin.dim.pages.transaction.crs.IdentificationDataTab.java

License:Open Source License

public IdentificationDataTab(String id, PageParameters parameters) {
    super(id);/*from ww w  .  j  av  a2 s  .com*/
    this.parameters = parameters;

    // get the transactionId parameter - we will use it in crsID validation
    if (parameters.get(TransactionPage.PARAM_TRANSACTION_ID) != null && !parameters
            .get(TransactionPage.PARAM_TRANSACTION_ID).equals(StringValue.valueOf((String) null))) {
        transactionId = parameters.get(TransactionPage.PARAM_TRANSACTION_ID).toLong();
    } else {
        transactionId = null;
    }

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.ChannelDashboards.java

License:Open Source License

public ChannelDashboards(final PageParameters parameters) {
    // get the reporting year
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }/*from w  w w  .  j  a v a2  s. c  om*/
    } else {
        countryCurrency = ReportsDashboardsUtils.getCurrency();
    }
    if (!parameters.get(ReportsConstants.AGENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        agencyParam = parameters.get(ReportsConstants.AGENCY_PARAM).toString();
    }

    String subTitle = new StringResourceModel("page.subtitle", this, null, null).getObject();
    Label country = new Label("channel", (agencyParam != null ? subTitle + " - " + agencyParam : ""));
    add(country);

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.CountryDashboards.java

License:Open Source License

public CountryDashboards(final PageParameters parameters) {
    // get the reporting year
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }// www .j ava  2 s  .c  o m
    } else {
        countryCurrency = ReportsDashboardsUtils.getCurrency();
    }
    if (!parameters.get(ReportsConstants.RECIPIENT_PARAM).equals(StringValue.valueOf((String) null))) {
        recipientParam = parameters.get(ReportsConstants.RECIPIENT_PARAM).toString();
    }

    String subTitle = new StringResourceModel("page.subtitle", this, null, null).getObject();
    Label country = new Label("country", (recipientParam != null ? subTitle + " - " + recipientParam : ""));
    add(country);

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.InstitutionDashboards.java

License:Open Source License

public InstitutionDashboards(final PageParameters parameters) {
    // get the reporting year
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }// w  w  w. j  a va 2 s  .  c  o m
    } else {
        countryCurrency = ReportsDashboardsUtils.getCurrency();
    }
    if (!parameters.get(ReportsConstants.INSTITUTION_PARAM).equals(StringValue.valueOf((String) null))) {
        institutionParam = parameters.get(ReportsConstants.INSTITUTION_PARAM).toString();
    }

    String subTitle = new StringResourceModel("page.subtitle", this, null, null).getObject();
    Label country = new Label("institution",
            (institutionParam != null ? subTitle + " - " + institutionParam : ""));
    add(country);

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.ReportsCountryInstitutionDashboards.java

License:Open Source License

public ReportsCountryInstitutionDashboards(final PageParameters parameters) {
    // get a default year if it's not specified
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }/*  w  ww.j  a va2 s . c om*/
    }
    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.GEOGRAPHY_PARAM).equals(StringValue.valueOf((String) null))) {
        geographyParam = parameters.get(ReportsConstants.GEOGRAPHY_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.RECIPIENT_PARAM).equals(StringValue.valueOf((String) null))) {
        recipientParam = parameters.get(ReportsConstants.RECIPIENT_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.INSTITUTION_PARAM).equals(StringValue.valueOf((String) null))) {
        institutionParam = parameters.get(ReportsConstants.INSTITUTION_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.YEAR_PARAM).equals(StringValue.valueOf((String) null))) {
        yearParam = parameters.get(ReportsConstants.YEAR_PARAM).toString();
        tableYear = Integer.parseInt(yearParam);
    }
    if (!parameters.get(ReportsConstants.COFINANCING_PARAM).equals(StringValue.valueOf((String) null))) {
        coFinancingParam = parameters.get(ReportsConstants.COFINANCING_PARAM).toString();
    }

    /*
     * create the MDX queries based on the filters
     */
    if (recipientParam != null) {
        institutionTableRecipient = institutionTableRecipient.replaceAll("__RECIPIENT__", recipientParam);

        if (institutionParam != null) {
            institutionTableInstitutionRecipient = institutionTableInstitutionRecipient
                    .replaceAll("__INSTITUTION__", institutionParam);
            institutionTableInstitutionRecipient = institutionTableInstitutionRecipient
                    .replaceAll("__RECIPIENT__", "[" + recipientParam + "]");

            institutionTableRowSet = institutionTableInstitutionRecipient;
        } else {
            institutionTableRowSet = institutionTableRecipient;
        }
    } else {
        if (geographyParam != null) {
            institutionTableGeography = institutionTableGeography.replaceAll("__GEOGRAPHY__", geographyParam);

            if (institutionParam != null) {
                institutionTableInstitutionGeography = institutionTableInstitutionGeography
                        .replaceAll("__INSTITUTION__", institutionParam);
                institutionTableInstitutionGeography = institutionTableInstitutionGeography
                        .replaceAll("__GEOGRAPHY__", geographyParam);

                institutionTableRowSet = institutionTableInstitutionGeography;
            } else {
                institutionTableRowSet = institutionTableGeography;
            }
        } else {
            if (institutionParam != null) {
                institutionTableInstitutionRecipient = institutionTableInstitutionRecipient
                        .replaceAll("__INSTITUTION__", institutionParam);
                institutionTableInstitutionRecipient = institutionTableInstitutionRecipient
                        .replaceAll("__RECIPIENT__", "Members");

                institutionTableRowSet = institutionTableInstitutionRecipient;

                institutionChartInstitution = institutionChartInstitution.replaceAll("__INSTITUTION__",
                        institutionParam);
                institutionChartRowSet = institutionChartInstitution;

            }
        }
    }

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.ReportsCountrySectorDashboards.java

License:Open Source License

public ReportsCountrySectorDashboards(final PageParameters parameters) {
    // get a default year if it's not specified
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }//from   w  ww.  j  a v a  2s.  com
    }
    if (!parameters.get(ReportsConstants.GEOGRAPHY_PARAM).equals(StringValue.valueOf((String) null))) {
        geographyParam = parameters.get(ReportsConstants.GEOGRAPHY_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.RECIPIENT_PARAM).equals(StringValue.valueOf((String) null))) {
        recipientParam = parameters.get(ReportsConstants.RECIPIENT_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.SECTOR_PARAM).equals(StringValue.valueOf((String) null))) {
        sectorParam = parameters.get(ReportsConstants.SECTOR_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.ISROOTSECTOR_PARAM).equals(StringValue.valueOf((String) null))) {
        isRootSectorParam = parameters.get(ReportsConstants.ISROOTSECTOR_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.YEAR_PARAM).equals(StringValue.valueOf((String) null))) {
        yearParam = parameters.get(ReportsConstants.YEAR_PARAM).toString();
        tableYear = Integer.parseInt(yearParam);
    }
    if (!parameters.get(ReportsConstants.COFINANCING_PARAM).equals(StringValue.valueOf((String) null))) {
        coFinancingParam = parameters.get(ReportsConstants.COFINANCING_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.CPAONLY_PARAM).equals(StringValue.valueOf((String) null))) {
        CPAOnlyParam = parameters.get(ReportsConstants.CPAONLY_PARAM).toString();
    }

    /*
     * create the MDX queries based on the filters
     */
    if (geographyParam != null && recipientParam != null) {
        // calculate 'country table' row set
        countryTableGeographyRecipient = countryTableGeographyRecipient.replaceAll("__GEOGRAPHY__",
                geographyParam);
        countryTableGeographyRecipient = countryTableGeographyRecipient.replaceAll("__RECIPIENT__",
                recipientParam);
        countryTableRowSet = countryTableGeographyRecipient;

        // calculate 'country table' Total value
        // use the region to calculate the total amount
        countryTableTotalGeography = countryTableTotalGeography.replaceAll("__GEOGRAPHY__",
                "[" + geographyParam + "]");
        countryTableTotal = countryTableTotalGeography;

        // calculate 'country chart' row set
        countryChartRecipient = countryChartRecipient.replaceAll("__RECIPIENT__", recipientParam);
        countryChartRowSet = countryChartRecipient;
    } else {
        if (geographyParam != null) {
            // calculate 'country table' row set
            countryTableGeography = countryTableGeography.replaceAll("__GEOGRAPHY__", geographyParam);
            countryTableRowSet = countryTableGeography;

            // calculate 'country table' Total value
            countryTableTotalGeography = countryTableTotalGeography.replaceAll("__GEOGRAPHY__",
                    "[" + geographyParam + "]");
            countryTableTotal = countryTableTotalGeography;

            // calculate 'country chart' row set
            countryChartGeography = countryChartGeography.replaceAll("__GEOGRAPHY__", geographyParam);
            countryChartRowSet = countryChartGeography;
        } else {
            if (recipientParam != null) {
                // calculate 'country table' row set
                countryTableRecipient = countryTableRecipient.replaceAll("__RECIPIENT__", recipientParam);
                countryTableRowSet = countryTableRecipient;

                // calculate 'country table' Total value
                countryTableTotalGeography = countryTableTotalGeography.replaceAll("__GEOGRAPHY__",
                        "[Name].[" + recipientParam + "]");
                countryTableTotal = countryTableTotalGeography;

                // calculate 'country chart' row set
                countryChartRecipient = countryChartRecipient.replaceAll("__RECIPIENT__", recipientParam);
                countryChartRowSet = countryChartRecipient;
            }
        }
    }

    if (sectorParam != null) {
        // calculate 'sector table' row set
        if (isRootSectorParam != null && isRootSectorParam.equals("true")) {
            sectorTableParentSector = sectorTableParentSector.replaceAll("__PARENT_SECTOR__", sectorParam);
            sectorTableRowSet = sectorTableParentSector;

            sectorTableTotalParentSector = sectorTableTotalParentSector.replaceAll("__PARENT_SECTOR__",
                    sectorParam);
            sectorTableTotal = sectorTableTotalParentSector;

            sectorChartParentSector = sectorChartParentSector.replaceAll("__PARENT_SECTOR__", sectorParam);
            sectorChartRowSet = sectorChartParentSector;
        } else {
            sectorTableSector = sectorTableSector.replaceAll("__SECTOR__", sectorParam);
            sectorTableRowSet = sectorTableSector;

            // calculate 'sector table' Total value
            sectorTableTotalSector = sectorTableTotalSector.replaceAll("__SECTOR__", sectorParam);
            sectorTableTotal = sectorTableTotalSector;

            // calculate 'sector chart' row set
            sectorChartSector = sectorChartSector.replaceAll("__SECTOR__", sectorParam);
            sectorChartRowSet = sectorChartSector;
        }
    }

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.ReportsImplementationStatusDashboards.java

License:Open Source License

public ReportsImplementationStatusDashboards(final PageParameters parameters) {
    // get a default year if it's not specified
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }/*ww  w  .  jav a 2  s .  c o  m*/
    }

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.EXPENDITURE_PARAM).equals(StringValue.valueOf((String) null))) {
        expenditureParam = parameters.get(ReportsConstants.EXPENDITURE_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.STARTINGYEAR_PARAM).equals(StringValue.valueOf((String) null))) {
        startingYearParam = parameters.get(ReportsConstants.STARTINGYEAR_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.COMPLETIONYEAR_PARAM).equals(StringValue.valueOf((String) null))) {
        completionYearParam = parameters.get(ReportsConstants.COMPLETIONYEAR_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.VALUE_PARAM).equals(StringValue.valueOf((String) null))) {
        valueParam = parameters.get(ReportsConstants.VALUE_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.BUDGETCODES_PARAM).equals(StringValue.valueOf((String) null))) {
        budgetCodesParam = parameters.get(ReportsConstants.BUDGETCODES_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.COFINANCING_PARAM).equals(StringValue.valueOf((String) null))) {
        coFinancingParam = parameters.get(ReportsConstants.COFINANCING_PARAM).toString();
    }

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.ReportsInstitutionTypeOfAidDashboards.java

License:Open Source License

public ReportsInstitutionTypeOfAidDashboards(final PageParameters parameters) {
    // get a default year if it's not specified
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }//from   w w  w. ja v  a2  s.  c o m
    }

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.AGENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        agencyParam = parameters.get(ReportsConstants.AGENCY_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.TYPEOFFLOW_PARAM).equals(StringValue.valueOf((String) null))) {
        typeOfFlowParam = parameters.get(ReportsConstants.TYPEOFFLOW_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.INSTITUTION_PARAM).equals(StringValue.valueOf((String) null))) {
        institutionParam = parameters.get(ReportsConstants.INSTITUTION_PARAM).toString();
    }
    if (!parameters.get(ReportsConstants.YEAR_PARAM).equals(StringValue.valueOf((String) null))) {
        yearParam = parameters.get(ReportsConstants.YEAR_PARAM).toString();
        tableYear = Integer.parseInt(yearParam);
    }
    if (!parameters.get(ReportsConstants.HUMANITARIANAID_PARAM).equals(StringValue.valueOf((String) null))) {
        humanitarianAidParam = parameters.get(ReportsConstants.HUMANITARIANAID_PARAM).toString();
    }

    bilateralCategory = catDao.findByCode("BI_MULTILATERAL##1").get(0);
    multilateralCategory = catDao.findByCode("BI_MULTILATERAL##2").get(0);

    /*
     * create the MDX queries based on the filters
     */
    if (institutionParam != null) {
        typeOfAidTableRowSetInstitutionBilateral = typeOfAidTableRowSetInstitutionBilateral
                .replaceAll("__INSTITUTION__", institutionParam);
        typeOfAidTableRowSetBilateral = typeOfAidTableRowSetInstitutionBilateral;

        typeOfAidTableRowSetInstitutionMultilateral = typeOfAidTableRowSetInstitutionMultilateral
                .replaceAll("__INSTITUTION__", institutionParam);

        if (agencyParam != null) {
            typeOfAidTableRowSetInstitutionMultilateral = typeOfAidTableRowSetInstitutionMultilateral
                    .replaceAll("__CHANNEL__", "[" + agencyParam + "]");
        } else {
            typeOfAidTableRowSetInstitutionMultilateral = typeOfAidTableRowSetInstitutionMultilateral
                    .replaceAll("__CHANNEL__", "Members");
        }

        typeOfAidTableRowSetMultilateral = typeOfAidTableRowSetInstitutionMultilateral;
    }

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.SectorDashboards.java

License:Open Source License

public SectorDashboards(final PageParameters parameters) {
    // get the reporting year
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }/*from  w w  w  . ja  v a 2  s.  c o m*/
    } else {
        countryCurrency = ReportsDashboardsUtils.getCurrency();
    }
    if (!parameters.get(ReportsConstants.SECTOR_PARAM).equals(StringValue.valueOf((String) null))) {
        sectorParam = parameters.get(ReportsConstants.SECTOR_PARAM).toString();
    }

    String subTitle = new StringResourceModel("page.subtitle", this, null, null).getObject();
    Label country = new Label("sector", (sectorParam != null ? subTitle + " - " + sectorParam : ""));
    add(country);

    addComponents();
}

From source file:org.devgateway.eudevfin.reports.ui.pages.TypeOfAidDashboards.java

License:Open Source License

public TypeOfAidDashboards(final PageParameters parameters) {
    // get the reporting year
    tableYear = Calendar.getInstance().get(Calendar.YEAR) - 1;

    // process the parameters received from the filters
    if (!parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).equals(StringValue.valueOf((String) null))) {
        currencyParam = parameters.get(ReportsConstants.ISNATIONALCURRENCY_PARAM).toString();
        if (currencyParam.equals("true")) {
            countryCurrency = ReportsDashboardsUtils.getCurrency();
        }//from   w  w  w  .jav  a2s  .  co m
    } else {
        countryCurrency = ReportsDashboardsUtils.getCurrency();
    }
    if (!parameters.get(ReportsConstants.TYPEOFAID_PARAM).equals(StringValue.valueOf((String) null))) {
        typeOfAidParam = parameters.get(ReportsConstants.TYPEOFAID_PARAM).toString();
    }

    String subTitle = new StringResourceModel("page.subtitle", this, null, null).getObject();
    Label country = new Label("typeOfAid", (typeOfAidParam != null ? subTitle + " - " + typeOfAidParam : ""));
    add(country);

    addComponents();
}