当前位置: 首页>>代码示例>>Java>>正文


Java RestartResponseException类代码示例

本文整理汇总了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();
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:24,代码来源:AllFacetValuesPage.java

示例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();
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:22,代码来源:RequestDetailPage.java

示例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));
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:26,代码来源:ServerInitPage.java

示例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;
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:PrismPropertyRealValueFromObjectWrapperModel.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:24,代码来源:ObjectDataProvider.java

示例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);
	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:22,代码来源:DynamicFormPanel.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:ResourceAssociationEditor.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:ResourceAttributeEditor.java

示例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);
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:SchemaListPanel.java

示例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);
			}
		}
	};
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:23,代码来源:PageResourceWizard.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:CertWorkItemDtoProvider.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:24,代码来源:CertCaseDtoProvider.java

示例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());
 }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:26,代码来源:PageAbout.java

示例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;
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:PageReport.java

示例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);
	}

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:17,代码来源:PageRegistrationBase.java


注:本文中的org.apache.wicket.RestartResponseException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。