/** * {@inheritDoc} */ @Override public Object getDisplayValue(final String object) { final IModel<String> resourceModel = ResourceModelFactory.newResourceModel(ResourceBundleKey .builder().key(propertiesKeyPrefix + "." + object).defaultValue("").build(), component); final String value = resourceModel.getObject(); return value; }
/** * {@inheritDoc} */ @Override public Object getDisplayValue(final String object) { final IModel<String> resourceModel = ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key(object).defaultValue("").build(), component); final String value = resourceModel.getObject(); return value; }
/** * {@inheritDoc} */ @Override public void validate() { final ReCaptchaImpl reCaptcha = new ReCaptchaImpl(); reCaptcha.setPrivateKey(getPrivateKey()); final String challenge = PageParametersExtensions .getParameter(PARAMETER_KEY_RECAPTCHA_CHALLENGE_FIELD); String uresponse = PageParametersExtensions .getParameter(PARAMETER_KEY_RECAPTCHA_RESPONSE_FIELD); if (uresponse == null) { uresponse = ""; } final String remoteAddress = WicketComponentExtensions.getHttpServletRequest() .getRemoteAddr(); final ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddress, challenge, uresponse); if (!reCaptchaResponse.isValid()) { error(ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("kaptcha.invalid.label") .defaultValue("Incorrect answer, type the words from the image again!") .build(), this).getObject()); } } };
.defaultValue("Please confirm the deregistration") .parameters(ListExtensions.toObjectArray(getDomainName())).build(), this);
/** * Factory method for create a new {@link ExternalLink}. * * @param linkId * the link id * @param url * the external url * @param labelId * the label id * @param resourceModelKey * the resource model key * @param parameters * the parameters for the resource key * @param defaultValue * a default value * @param component * the component * @return the external link */ public static ExternalLink newExternalLink(final String linkId, final String url, final String labelId, final String resourceModelKey, final Object[] parameters, final String defaultValue, final Component component) { return newExternalLink(linkId, url, labelId, ResourceBundleKey.builder() .key(resourceModelKey).parameters(parameters).defaultValue(defaultValue).build(), component); }
/** * Factory method for create a new {@link BookmarkablePageLink}. * * @param linkId * the link id * @param pageClass * the page class * @param labelId * the label id * @param resourceModelKey * the resource model key * @param parameters * the parameters * @param defaultValue * the default value * @param component * the component * @return the bookmarkable page link */ public static BookmarkablePageLink<String> newBookmarkablePageLink(final String linkId, final Class<? extends Page> pageClass, final String labelId, final String resourceModelKey, final Object[] parameters, final String defaultValue, final Component component) { return newBookmarkablePageLink(linkId, pageClass, labelId, ResourceBundleKey.builder() .key(resourceModelKey).parameters(parameters).defaultValue(defaultValue).build(), component); }
/** * Creates an external link from the given parameters. * * @param linkId * the link id * @param url * the external url * @param labelId * the label id * @param resourceModelKey * the resource model key * @param parameters * the parameters for the resource key * @param defaultValue * a default value * @param component * the component * @return the external link */ public static ExternalLink newExternalLink(final String linkId, final String url, final String labelId, final String resourceModelKey, final Object[] parameters, final String defaultValue, final Component component) { return newExternalLink(linkId, url, labelId, ResourceBundleKey.builder() .key(resourceModelKey).parameters(parameters).defaultValue(defaultValue).build(), component); }
/** * Creates the bookmarkable page link. * * @param linkId * the link id * @param pageClass * the page class * @param labelId * the label id * @param resourceModelKey * the resource model key * @param parameters * the parameters * @param defaultValue * the default value * @param component * the component * @return the bookmarkable page link */ public static BookmarkablePageLink<String> newBookmarkablePageLink(final String linkId, final Class<? extends Page> pageClass, final String labelId, final String resourceModelKey, final Object[] parameters, final String defaultValue, final Component component) { return newBookmarkablePageLink(linkId, pageClass, labelId, ResourceBundleKey.builder() .key(resourceModelKey).parameters(parameters).defaultValue(defaultValue).build(), component); }
/** * Factory method to create a new {@link IModel} for the 'slogan'. This method is invoked in the * constructor from this class and can be overridden so users can provide their own version of a * new {@link IModel} for the 'slogan'. * * @param domainNameParams * the domain name params * @return the new {@link IModel} for the 'slogan'. */ protected IModel<String> newSloganModel(final Object[] domainNameParams) { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("main.global.company.url.and.slogan.label") .parameters(domainNameParams).defaultValue("").build(), this); }
/** * Factory method to create a new {@link IModel} for the 'slogan'. This method is invoked in the * constructor from this class and can be overridden so users can provide their own version of a * new {@link IModel} for the 'slogan'. * * @param domainNameParams * the domain name params * @return the new {@link IModel} for the 'slogan'. */ protected IModel<String> newSloganModel(final Object[] domainNameParams) { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("main.global.company.url.and.slogan.label") .parameters(domainNameParams).defaultValue("").build(), this); }
/** * Factory method to create a new StringResourceModel from the given key. * * @param key * the key * @return the new {@link IModel} */ protected IModel<String> newIModel(final String key) { return ResourceModelFactory.newResourceModel(ResourceBundleKey.builder().key(key) .defaultValue("").build(), this); }
/** * Factory method that can be overwritten for new meta tag content for description. * * @return the new <code>{@link IModel}</code> for the meta tag content for description. */ protected IModel<String> newDescription() { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("page.meta.description").defaultValue("").build(), this); }
/** * Factory method to create a new StringResourceModel from the given key. * * @param key * the key * @return the new {@link IModel} */ protected IModel<String> newIModel(final String key) { return ResourceModelFactory .newResourceModel(ResourceBundleKey.builder().key(key).defaultValue("").build(), this); }
/** * Factory method that can be overwritten for new meta tag content for the title. * * @return the new <code>IModel</code> */ protected IModel<String> newTitle() { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("page.title").defaultValue("Home page").build(), this); }
/** * Factory method that can be overwritten for new meta tag content for keywords. * * @return the new <code>{@link IModel}</code> for the meta tag content for keywords. */ protected IModel<String> newKeywords() { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("page.meta.keywords").defaultValue("").build(), this); }
/** * Creates a new {@link IModel} from the given key. * * @param key * the key * @return the new {@link IModel} from the given key. */ protected IModel<String> newIModel(final String key) { return ResourceModelFactory .newResourceModel(ResourceBundleKey.builder().key(key).defaultValue("").build(), this); }
/** * Factory method that can be overwritten for new meta tag content for keywords. * * @return the new <code>IModel</code> */ protected IModel<String> newKeywords() { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("page.meta.keywords").defaultValue("").build(), this); }
/** * Factory method that can be overwritten for new meta tag content for description. * * @return the new <code>IModel</code> */ protected IModel<String> newDescription() { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("page.meta.description").defaultValue("").build(), this); }
/** * Creates a new {@link IModel} from the given key. * * @param key * the key * @return the new {@link IModel} from the given key. */ protected IModel<String> newIModel(final String key) { return ResourceModelFactory.newResourceModel(ResourceBundleKey.builder().key(key) .defaultValue("").build(), this); }
/** * Factory method that can be overwritten for new meta tag content for the title. * * @return the new <code>{@link IModel}</code> for the meta tag content for title. */ protected IModel<String> newTitle() { return ResourceModelFactory.newResourceModel( ResourceBundleKey.builder().key("page.title").defaultValue("Home page").build(), this); }