Package org.apache.wicket.util.string

Examples of org.apache.wicket.util.string.StringValue.toInteger()


  public AddressCampaignValueEditPage(final PageParameters parameters)
  {
    super(parameters, "plugins.marketing.addressCampaign");
    StringValue sval = parameters.get(AbstractEditPage.PARAMETER_KEY_ID);
    final Integer id = sval.isEmpty() == true ? null : sval.toInteger();
    if (id == null) {
      // Create new entry.
      sval = parameters.get(PARAMETER_ADDRESS_ID);
      final Integer addressId = sval.isEmpty() ? null : sval.toInteger();
      sval = parameters.get(PARAMETER_ADDRESS_CAMPAIGN_ID);
View Full Code Here


    StringValue sval = parameters.get(AbstractEditPage.PARAMETER_KEY_ID);
    final Integer id = sval.isEmpty() == true ? null : sval.toInteger();
    if (id == null) {
      // Create new entry.
      sval = parameters.get(PARAMETER_ADDRESS_ID);
      final Integer addressId = sval.isEmpty() ? null : sval.toInteger();
      sval = parameters.get(PARAMETER_ADDRESS_CAMPAIGN_ID);
      final Integer addressCampaignId = sval.isEmpty() || "null".equals(sval.toString()) ? null : sval.toInteger();
      if (addressId == null || addressCampaignId == null) {
        throw new UserException("plugins.marketing.addressCampaignValue.error.addressOrCampaignNotGiven");
      }
View Full Code Here

    if (id == null) {
      // Create new entry.
      sval = parameters.get(PARAMETER_ADDRESS_ID);
      final Integer addressId = sval.isEmpty() ? null : sval.toInteger();
      sval = parameters.get(PARAMETER_ADDRESS_CAMPAIGN_ID);
      final Integer addressCampaignId = sval.isEmpty() || "null".equals(sval.toString()) ? null : sval.toInteger();
      if (addressId == null || addressCampaignId == null) {
        throw new UserException("plugins.marketing.addressCampaignValue.error.addressOrCampaignNotGiven");
      }
      final AddressDO address = addressDao.getById(addressId);
      final AddressCampaignDO addressCampaign = addressCampaignDao.getById(addressCampaignId);
View Full Code Here

  {
    final StringValue sval = parameters.get(name);
    if (sval == null || sval.isNull() == true) {
      return null;
    } else {
      return sval.toInteger();
    }
  }

  public static int getAsInt(final PageParameters parameters, final String name, final int defaultValue)
  {
View Full Code Here

    } else if (objectType.isAssignableFrom(Integer.class) == true) {
      final StringValue sval = pageParameters.get(key);
      if (sval.isNull() == true) {
        return null;
      }
      return sval.toInteger();
    } else if (objectType.isAssignableFrom(String.class) == true) {
      return pageParameters.get(key).toString();
    } else if (objectType.isAssignableFrom(TimePeriod.class) == true) {
      final String sValue = pageParameters.get(key).toString();
      if (sValue == null) {
View Full Code Here

     * Reads target contract id from the page parameters.
     */
    protected Integer getContractId() {
        StringValue sContractId = getPageParameters().get(PARAM_CONTRACT_ID);
        if(!sContractId.isEmpty()) {
            return sContractId.toInteger();
        }
        return null;
    }


View Full Code Here

        }
        T resource = resourceModel.getObject();
        if(resource == null) {
            StringValue sResourceId = getPageParameters().get(PARAM_RESOURCE_ID);
            if(!sResourceId.isEmpty()) {
                resource = resourceReader.<T>getResource(sResourceId.toInteger());
                resourceModel.setObject(resource);
            } else {
                try {
                    @SuppressWarnings("unchecked")
                    Class<T> resourceSubclass = (Class<T>) Class.forName(
View Full Code Here

                    @SuppressWarnings("unchecked")
                    Class<T> resourceSubclass = (Class<T>) Class.forName(
                            getPage().getPageParameters().get(PARAM_RESOURCE_TYPE).toString());
                    StringValue sContractId = getPage().getPageParameters().get(PARAM_CONTRACT_ID);
                    T editingResource = resourcesFactory.createResource(resourceSubclass,
                            authorizedUserService.getCurrentUserId(), sContractId.toInteger());
                    resourceModel.setObject(editingResource);
                } catch (ClassNotFoundException e) {
                    throw new RuntimeException("Cannot create new resource instance", e);
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.