本文整理匯總了Java中org.apache.wicket.request.mapper.parameter.PageParameters.get方法的典型用法代碼示例。如果您正苦於以下問題:Java PageParameters.get方法的具體用法?Java PageParameters.get怎麽用?Java PageParameters.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.request.mapper.parameter.PageParameters
的用法示例。
在下文中一共展示了PageParameters.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AllFacetValuesPage
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
public AllFacetValuesPage(PageParameters params) {
super(params);
this.selectionModel = Model.of(parametersConverter.fromParameters(params));
final StringValue facetValue = params.get(SELECTED_FACET_PARAM);
if (facetValue.isEmpty()) {
Session.get().error("No facet provided for all values page");
throw new RestartResponseException(new FacetedSearchPage(selectionModel));
}
final String facet = facetParamMapper.getFacet(facetValue.toString());
if (vloConfig.getFacetsInSearch().contains(facet)) {
// create a new model so that all values will be retrieved
setModel(new FacetFieldModel(facet, facetFieldsService, selectionModel)); // gets all facet values
}
if (getModelObject() == null) {
Session.get().error(String.format("Facet '%s' could not be found", facet));
ErrorPage.triggerErrorPage(ErrorPage.ErrorType.PAGE_NOT_FOUND, params);
}
addComponents();
}
示例2: processTheme
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
/**
* Sets the theme from the page parameters if applicable. An present but
* empty theme value will reset the theme (by unsetting the style).
*
* @param parameters page parameters to process
* @see VloWebAppParameters#THEME
* @see Session#setStyle(java.lang.String)
*/
private void processTheme(PageParameters parameters) {
final StringValue themeValue = parameters.get(VloWebAppParameters.THEME);
if (!themeValue.isNull()) {
if (themeValue.isEmpty()) {
// empty string resets theme
logger.debug("Resetting theme");
Session.get().setStyle(null);
} else {
// theme found, set it as style in the session
final String theme = themeValue.toString().toLowerCase();
logger.debug("Setting theme to {}", theme);
Session.get().setStyle(theme);
}
/*
* Remove theme parameter to prevent it from interfering with
* further processing, specifically the parameters check in
* the simple page search
*/
parameters.remove(VloWebAppParameters.THEME, themeValue.toString());
}
}
示例3: onBeforeRender
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
@Override
protected void onBeforeRender() {
super.onBeforeRender();
if (!initialized) {
PageParameters params = getPageParameters();
StringValue val = params.get(SELECTED_TAB_INDEX);
String value = null;
if (val != null && !val.isNull()) {
value = val.toString();
}
int index = StringUtils.isNumeric(value) ? Integer.parseInt(value) : CONFIGURATION_TAB_BASIC;
getTabPanel().setSelectedTab(index);
initialized = true;
}
}
示例4: getOidFromParameter
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
private String getOidFromParameter(PageParameters params){
if (params == null || params.isEmpty()) {
LOGGER.error("No page paraeters found for account activation. No user to activate his/her accounts");
return null;
}
StringValue userValue = params.get(SchemaConstants.USER_ID);
if (userValue == null || userValue.isEmpty()) {
LOGGER.error("No user defined in the page parameter. Expected user=? attribute filled but didmn't find one.");
return null;
}
return userValue.toString();
}
示例5: encodePageParameters
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
@Override
protected Url encodePageParameters(Url url, PageParameters pageParameters, IPageParametersEncoder encoder) {
//get special page parameter that encodes the page fragment/anchor
final StringValue fragment = pageParameters.get(FRAGMENT_PAGE_PARAMETER);
if (fragment.isEmpty()) {
//business as usual
return super.encodePageParameters(url, pageParameters, encoder);
} else {
//we have a fragment parameter, remove from normal parameters and do post-processing
pageParameters.remove(FRAGMENT_PAGE_PARAMETER);
final Url result = super.encodePageParameters(url, pageParameters, encoder);
//set the fragment on the resulting URL
result.setFragment(fragment.toString());
return result;
}
}
示例6: loadAccount
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
private ObjectWrapper<ShadowType> loadAccount(PageParameters parameters) {
Task task = createSimpleTask(OPERATION_LOAD_ACCOUNT);
OperationResult result = task.getResult();
Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(
ShadowType.F_RESOURCE, GetOperationOptions.createResolve());
StringValue oid = parameters != null ? parameters.get(OnePageParameterEncoder.PARAMETER) : null;
PrismObject<ShadowType> account = WebModelServiceUtils.loadObject(ShadowType.class, oid.toString(), options,
PageAccount.this, task, result);
if (account == null) {
getSession().error(getString("pageAccount.message.cantEditAccount"));
showResult(result);
throw new RestartResponseException(PageResources.class);
}
ObjectWrapper wrapper = ObjectWrapperUtil.createObjectWrapper(null, null, account, ContainerStatus.MODIFYING, task, this);
OperationResultType fetchResult = account.getPropertyRealValue(ShadowType.F_FETCH_RESULT, OperationResultType.class);
try {
wrapper.setFetchResult(OperationResult.createOperationResult(fetchResult));
} catch (SchemaException e) {
throw new SystemException(e.getMessage(), e);
}
wrapper.setShowEmpty(false);
return wrapper;
}
示例7: PageCertCampaign
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
public PageCertCampaign(PageParameters parameters) {
StringValue campaignOidValue = parameters.get(OnePageParameterEncoder.PARAMETER);
if (campaignOidValue != null) {
campaignOid = campaignOidValue.toString();
}
initModels();
initLayout();
}
示例8: getOidFromParams
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
private String getOidFromParams(PageParameters pageParameters) {
if (pageParameters == null) {
return null;
}
StringValue oidValue = pageParameters.get(PARAM_USER_OID);
if (oidValue != null) {
return oidValue.toString();
}
return null;
}
示例9: getIntegerParameter
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
public static Integer getIntegerParameter(PageParameters params, String key) {
if (params == null || params.get(key) == null) {
return null;
}
StringValue value = params.get(key);
if (!StringUtils.isNumeric(value.toString())) {
return null;
}
return value.toInteger();
}
示例10: getSelectedTabForConfiguration
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
private int getSelectedTabForConfiguration(WebPage page) {
PageParameters params = page.getPageParameters();
StringValue val = params.get(PageSystemConfiguration.SELECTED_TAB_INDEX);
String value = null;
if (val != null && !val.isNull()) {
value = val.toString();
}
return StringUtils.isNumeric(value) ? Integer.parseInt(value) : PageSystemConfiguration.CONFIGURATION_TAB_BASIC;
}
示例11: fromParameters
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
@Override
public SearchContext fromParameters(PageParameters params) {
final StringValue indexParam = params.get(VloWebAppParameters.SEARCH_INDEX);
final StringValue countParam = params.get(VloWebAppParameters.SEARCH_COUNT);
final QueryFacetsSelection selection = selectionConverter.fromParameters(params);
if (!indexParam.isEmpty() && !countParam.isEmpty() && selection != null) {
try {
return new SearchContextModel(indexParam.toLong(), countParam.toLong(), Model.of(selection));
} catch (StringValueConversionException ex) {
logger.warn("Illegal query parameter value", ex);
}
}
return null;
}
示例12: fromParameters
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
@Override
public SolrDocument fromParameters(PageParameters params) {
final StringValue docIdParam = params.get(VloWebAppParameters.DOCUMENT_ID);
if (docIdParam.isEmpty()) {
return null;
} else {
return VloWicketApplication.get().getDocumentService().getDocument(docIdParam.toString());
}
}
示例13: MainPage
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
public MainPage(final PageParameters pageParameters) {
this();
if (pageParameters.get("successFeedback") != null) {
this.getFeedbackPanel().success(pageParameters.get("successFeedback"));
} else if (pageParameters.get("errorFeedback") != null) {
this.getFeedbackPanel().error(pageParameters.get("errorFeedback"));
}
}
示例14: init
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
private void init(final PageParameters pageParameters) {
PageParameters params = pageParameters;
if (params == null) {
params = getPageParameters();
}
OperationResult result = new OperationResult(OPERATION_FINISH_REGISTRATION);
if (params == null) {
LOGGER.error("Confirmation link is not valid. No credentials provided in it");
String msg = createStringResource("PageSelfRegistration.invalid.registration.link").getString();
getSession().error(createStringResource(msg));
result.recordFatalError(msg);
initLayout(result);
return;
}
StringValue userNameValue = params.get(SchemaConstants.USER_ID);
Validate.notEmpty(userNameValue.toString());
StringValue tokenValue = params.get(SchemaConstants.TOKEN);
Validate.notEmpty(tokenValue.toString());
UserType userType = checkUserCredentials(userNameValue.toString(), tokenValue.toString(), result);
if (userType == null) {
initLayout(result);
return;
}
result = assignDefaultRoles(userType.getOid());
if (result.getStatus() == OperationResultStatus.FATAL_ERROR) {
LOGGER.error("Failed to assign default roles, {}", result.getMessage());
initLayout(result);
return;
}
final NonceType nonceClone = userType.getCredentials().getNonce().clone();
result = removeNonce(userType.getOid(), nonceClone);
result = assignAdditionalRoleIfPresent(userType.getOid(), nonceClone, result);
initLayout(result);
}
示例15: init
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
private void init(final PageParameters pageParameters) {
PageParameters params = pageParameters;
if (params == null) {
params = getPageParameters();
}
OperationResult result = new OperationResult(OPERATION_FINISH_REGISTRATION);
if (params == null) {
LOGGER.error("Confirmation link is not valid. No credentials provided in it");
String msg = createStringResource("PageSelfRegistration.invalid.registration.link").getString();
getSession().error(createStringResource(msg));
result.recordFatalError(msg);
initLayout(result);
return;
}
StringValue userNameValue = params.get(SchemaConstants.USER_ID);
Validate.notEmpty(userNameValue.toString());
StringValue tokenValue = params.get(SchemaConstants.TOKEN);
Validate.notEmpty(tokenValue.toString());
UsernamePasswordAuthenticationToken token = authenticateUser(userNameValue.toString(), tokenValue.toString(), result);
if (token == null) {
initLayout(result);
return;
} else {
// SecurityContextHolder.getContext().setAuthentication(token);
MidPointPrincipal principal = (MidPointPrincipal) token.getPrincipal();
Collection<Authorization> authz = principal.getAuthorities();
if (authz != null) {
Iterator<Authorization> authzIterator = authz.iterator();
while (authzIterator.hasNext()) {
Authorization authzI= authzIterator.next();
Iterator<String> actionIterator = authzI.getAction().iterator();
while (actionIterator.hasNext()) {
String action = actionIterator.next();
if (action.contains(AuthorizationConstants.NS_AUTHORIZATION_UI)) {
actionIterator.remove();
}
}
}
}
AuthorizationType authorizationType = new AuthorizationType();
authorizationType.getAction().add(AuthorizationConstants.AUTZ_UI_SELF_CREDENTIALS_URL);
Authorization selfServiceCredentialsAuthz = new Authorization(authorizationType);
authz.add(selfServiceCredentialsAuthz);
SecurityContextHolder.getContext().setAuthentication(token);
setResponsePage(PageResetPassword.class);
}
initLayout(result);
}