本文整理汇总了Java中org.apache.wicket.RestartResponseException类的典型用法代码示例。如果您正苦于以下问题:Java RestartResponseException类的具体用法?Java RestartResponseException怎么用?Java RestartResponseException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RestartResponseException类属于org.apache.wicket包,在下文中一共展示了RestartResponseException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AllFacetValuesPage
import org.apache.wicket.RestartResponseException; //导入依赖的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: RequestDetailPage
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
public RequestDetailPage(PageParameters params) {
super(params);
if (getProject().getDefaultBranch() == null)
throw new RestartResponseException(NoBranchesPage.class, paramsOf(getProject()));
requestModel = new LoadableDetachableModel<PullRequest>() {
@Override
protected PullRequest load() {
Long requestNumber = params.get(PARAM_REQUEST).toLong();
PullRequest request = GitPlex.getInstance(PullRequestManager.class).find(getProject(), requestNumber);
if (request == null)
throw new EntityNotFoundException("Unable to find request #" + requestNumber + " in project " + getProject());
return request;
}
};
reviewUpdateId = requestModel.getObject().getLatestUpdate().getId();
}
示例3: onInitialize
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new Label("title", initStage.getMessage()));
if (!initStage.getManualConfigs().isEmpty()) {
List<ManualConfigStep> configSteps = new ArrayList<ManualConfigStep>();
for (ManualConfig each: initStage.getManualConfigs())
configSteps.add(new ManualConfigStep(each));
add(new Wizard("wizard", configSteps) {
@Override
protected void finished() {
WebSession.get().logout();
User root = GitPlex.getInstance(UserManager.class).getRoot();
SecurityUtils.getSubject().runAs(root.getPrincipals());
throw new RestartResponseException(DashboardPage.class);
}
});
} else {
add(new WebMarkupContainer("wizard").setVisible(false));
}
}
示例4: getObject
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
@Override
public T getObject() {
PrismProperty<T> property;
try {
property = getPrismObject().findOrCreateProperty(path);
} catch (SchemaException ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't create property in path {}", ex, path);
//todo show message in page error [lazyman]
throw new RestartResponseException(PageError.class);
}
T val = getRealValue(property != null ? property.getRealValue() : null);
if (val == null) {
return defaultValue;
} else {
return val;
}
}
示例5: internalSize
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
@Override
protected int internalSize() {
LOGGER.trace("begin::internalSize()");
int count = 0;
OperationResult result = new OperationResult(OPERATION_COUNT_OBJECTS);
try {
Task task = getPage().createSimpleTask(OPERATION_COUNT_OBJECTS);
count = getModel().countObjects(type, getQuery(), options, task, result);
} catch (Exception ex) {
result.recordFatalError("Couldn't count objects.", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't count objects", ex);
} finally {
result.computeStatusIfUnknown();
}
if (!WebComponentUtil.isSuccessOrHandledError(result)) {
getPage().showResult(result);
throw new RestartResponseException(PageError.class);
}
LOGGER.trace("end::internalSize(): {}", count);
return count;
}
示例6: initialize
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
private void initialize(final PrismObject<O> prismObject, String formOid, Form<?> mainForm,
final Task task, final PageBase parentPage, boolean enforceRequiredFields) {
if (prismObject == null) {
getSession().error(getString("DynamicFormPanel.object.must.not.be.null"));
throw new RestartResponseException(parentPage);
}
// setParent(parentPage);
form = loadForm(formOid, task, parentPage);
if (form == null || form.getFormDefinition() == null) {
LOGGER.debug("No form or form definition; form OID = {}", formOid);
add(new Label(ID_FORM_FIELDS)); // to avoid wicket exceptions
return;
}
final ObjectWrapperFactory owf = new ObjectWrapperFactory(parentPage);
ObjectWrapper<O> objectWrapper = createObjectWrapper(owf, task, prismObject, enforceRequiredFields);
wrapperModel = LoadableModel.create(() -> objectWrapper, true);
initLayout(mainForm, parentPage);
}
示例7: loadResourceSchema
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
private ResourceSchema loadResourceSchema() {
if(resource != null){
Element xsdSchema = ResourceTypeUtil.getResourceXsdSchema(resource);
if (xsdSchema == null) {
return null;
}
try {
return ResourceSchemaImpl.parse(xsdSchema, resource.toString(), getPageBase().getPrismContext());
} catch (SchemaException|RuntimeException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse resource schema.", e);
getSession().error(getString("ResourceAssociationEditor.message.cantParseSchema") + " " + e.getMessage());
throw new RestartResponseException(PageResources.class);
}
}
return null;
}
示例8: loadResourceSchema
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
private ResourceSchema loadResourceSchema() {
if(resource != null){
Element xsdSchema = ResourceTypeUtil.getResourceXsdSchema(resource);
if (xsdSchema == null) {
return null;
}
try {
return ResourceSchemaImpl.parse(xsdSchema, resource.toString(), getPageBase().getPrismContext());
} catch (SchemaException|RuntimeException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse resource schema.", e);
getSession().error(getString("ResourceAttributeEditor.message.cantParseSchema") + " " + e.getMessage());
throw new RestartResponseException(PageResources.class);
}
}
return null;
}
示例9: loadResourceSchema
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
private RefinedResourceSchema loadResourceSchema() {
PrismObject<ResourceType> resource = getModel().getObject();
try {
Element xsdSchema = ResourceTypeUtil.getResourceXsdSchema(resource);
if (xsdSchema == null) {
return null;
}
return RefinedResourceSchemaImpl.getRefinedSchema(resource, getPageBase().getPrismContext());
} catch (SchemaException|RuntimeException ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse resource schema.", ex);
getSession().error(getString("SchemaListPanel.message.couldntParseSchema") + " " + ex.getMessage());
throw new RestartResponseException(PageResources.class);
}
}
示例10: createResourceModel
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
@NotNull
private NonEmptyLoadableModel<PrismObject<ResourceType>> createResourceModel(final Collection<SelectorOptions<GetOperationOptions>> options) {
return new NonEmptyLoadableModel<PrismObject<ResourceType>>(false) {
@NotNull
@Override
protected PrismObject<ResourceType> load() {
try {
if (editedResourceOid == null) {
return getPrismContext().createObject(ResourceType.class);
}
PrismObject<ResourceType> resource = loadResourceModelObject(options);
if (resource == null) {
throw new RestartResponseException(PageError.class);
}
return resource;
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load resource", ex);
throw new RestartResponseException(PageError.class);
}
}
};
}
示例11: internalSize
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
@Override
protected int internalSize() {
LOGGER.trace("begin::internalSize()");
int count = 0;
OperationResult result = new OperationResult(OPERATION_COUNT_OBJECTS);
try {
Task task = getPage().createSimpleTask(OPERATION_COUNT_OBJECTS);
AccessCertificationService acs = getPage().getCertificationService();
ObjectQuery query = getQuery().clone();
count = acs.countOpenWorkItems(query, notDecidedOnly, null, task, result);
} catch (Exception ex) {
result.recordFatalError("Couldn't count objects.", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't count objects", ex);
} finally {
result.computeStatusIfUnknown();
}
if (!WebComponentUtil.isSuccessOrHandledError(result)) {
getPage().showResult(result);
throw new RestartResponseException(PageError.class);
}
LOGGER.trace("end::internalSize()");
return count;
}
示例12: internalSize
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
@Override
protected int internalSize() {
LOGGER.trace("begin::internalSize()");
int count = 0;
OperationResult result = new OperationResult(OPERATION_COUNT_OBJECTS);
try {
Task task = getPage().createSimpleTask(OPERATION_COUNT_OBJECTS);
count = countCases(campaignOid, null, task, result);
} catch (Exception ex) {
result.recordFatalError("Couldn't count objects.", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't count objects", ex);
} finally {
result.computeStatusIfUnknown();
}
if (!WebComponentUtil.isSuccessOrHandledError(result)) {
getPage().showResult(result, false);
throw new RestartResponseException(PageError.class);
}
LOGGER.trace("end::internalSize()");
return count;
}
示例13: reindexRepositoryObjectsPerformed
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
private void reindexRepositoryObjectsPerformed(AjaxRequestTarget target) {
OperationResult result = new OperationResult(OPERATION_SUBMIT_REINDEX);
try {
TaskManager taskManager = getTaskManager();
Task task = taskManager.createTaskInstance();
MidPointPrincipal user = SecurityUtils.getPrincipalUser();
if (user == null) {
throw new RestartResponseException(PageLogin.class);
} else {
task.setOwner(user.getUser().asPrismObject());
}
getSecurityEnforcer().authorize(AuthorizationConstants.AUTZ_ALL_URL, null, null, null, null, null, result);
task.setChannel(SchemaConstants.CHANNEL_GUI_USER_URI);
task.setHandlerUri(ModelPublicConstants.REINDEX_TASK_HANDLER_URI);
task.setName("Reindex repository objects");
taskManager.switchToBackground(task, result);
result.setBackgroundTaskOid(task.getOid());
} catch (SecurityViolationException|SchemaException|RuntimeException e) {
result.recordFatalError(e);
} finally {
result.computeStatusIfUnknown();
}
showResult(result);
target.add(getFeedbackPanel());
}
示例14: loadReport
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
private ReportDto loadReport() {
StringValue reportOid = getPageParameters().get(OnePageParameterEncoder.PARAMETER);
Task task = createSimpleTask(OPERATION_LOAD_REPORT);
OperationResult result = task.getResult();
PrismObject<ReportType> prismReport = WebModelServiceUtils.loadObject(ReportType.class, reportOid.toString(),
this, task, result);
if (prismReport == null) {
LOGGER.error("Couldn't load report.");
throw new RestartResponseException(PageReports.class);
}
return new ReportDto(prismReport.asObjectable());
// return prismReport;
}
示例15: initSelfRegistrationConfiguration
import org.apache.wicket.RestartResponseException; //导入依赖的package包/类
private void initSelfRegistrationConfiguration() {
SecurityPolicyType securityPolicy = resolveSecurityPolicy();
this.selfRegistrationDto = new SelfRegistrationDto();
try {
this.selfRegistrationDto.initSelfRegistrationDto(securityPolicy);
} catch (SchemaException e) {
LOGGER.error("Failed to initialize self registration configuration.", e);
getSession().error(
createStringResource("PageSelfRegistration.selfRegistration.configuration.init.failed")
.getString());
throw new RestartResponseException(PageLogin.class);
}
}