use of org.apache.wicket.util.string.StringValue in project midpoint by Evolveum.
the class PageBase method getSelectedTabForConfiguration.
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;
}
use of org.apache.wicket.util.string.StringValue in project midpoint by Evolveum.
the class FocusMainPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
StringValue oidValue = getPage().getPageParameters().get(OnePageParameterEncoder.PARAMETER);
taskDtoProvider.setQuery(createTaskQuery(oidValue != null ? oidValue.toString() : null, (PageBase) getPage()));
}
use of org.apache.wicket.util.string.StringValue in project midpoint by Evolveum.
the class PageReport method loadReport.
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;
}
use of org.apache.wicket.util.string.StringValue in project midpoint by Evolveum.
the class PageTasks method loadTasksSearchDto.
private TasksSearchDto loadTasksSearchDto() {
TasksStorage storage = getSessionStorage().getTasks();
TasksSearchDto dto = storage.getTasksSearch();
if (dto == null) {
dto = new TasksSearchDto();
dto.setShowSubtasks(false);
}
if (getPageParameters() != null) {
StringValue category = getPageParameters().get(SELECTED_CATEGORY);
if (category != null && category.toString() != null && !category.toString().isEmpty()) {
dto.setCategory(category.toString());
}
}
if (dto.getStatus() == null) {
dto.setStatus(TaskDtoExecutionStatusFilter.ALL);
}
return dto;
}
use of org.apache.wicket.util.string.StringValue in project midpoint by Evolveum.
the class PageDebugView method loadObject.
private ObjectViewDto loadObject() {
StringValue objectOid = getPageParameters().get(PARAM_OBJECT_ID);
if (objectOid == null || StringUtils.isEmpty(objectOid.toString())) {
getSession().error(getString("pageDebugView.message.oidNotDefined"));
throw new RestartResponseException(PageDebugList.class);
}
Task task = createSimpleTask(OPERATION_LOAD_OBJECT);
//todo is this result != null ?
OperationResult result = task.getResult();
ObjectViewDto dto = null;
try {
MidPointApplication application = PageDebugView.this.getMidpointApplication();
GetOperationOptions rootOptions = GetOperationOptions.createRaw();
rootOptions.setResolveNames(true);
rootOptions.setTolerateRawData(true);
Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(rootOptions);
// FIXME: ObjectType.class will not work well here. We need more specific type.
//todo on page debug list create page params, put there oid and class for object type and send that to this page....read it here
Class type = ObjectType.class;
StringValue objectType = getPageParameters().get(PARAM_OBJECT_TYPE);
if (objectType != null && StringUtils.isNotBlank(objectType.toString())) {
type = getPrismContext().getSchemaRegistry().determineCompileTimeClass(new QName(SchemaConstantsGenerated.NS_COMMON, objectType.toString()));
}
// TODO make this configurable (or at least do not show campaign cases in production)
if (UserType.class.isAssignableFrom(type)) {
options.add(SelectorOptions.create(UserType.F_JPEG_PHOTO, GetOperationOptions.createRetrieve(RetrieveOption.INCLUDE)));
}
if (LookupTableType.class.isAssignableFrom(type)) {
options.add(SelectorOptions.create(LookupTableType.F_ROW, GetOperationOptions.createRetrieve(new RelationalValueSearchQuery(ObjectPaging.createPaging(PrismConstants.T_ID, OrderDirection.ASCENDING)))));
}
if (AccessCertificationCampaignType.class.isAssignableFrom(type)) {
options.add(SelectorOptions.create(AccessCertificationCampaignType.F_CASE, GetOperationOptions.createRetrieve(RetrieveOption.INCLUDE)));
}
PrismObject<ObjectType> object = getModelService().getObject(type, objectOid.toString(), options, task, result);
PrismContext context = application.getPrismContext();
String lex = context.serializerFor(dataLanguage).serialize(object);
dto = new ObjectViewDto(object.getOid(), WebComponentUtil.getName(object), object, lex);
result.recomputeStatus();
} catch (Exception ex) {
result.recordFatalError("Couldn't load object.", ex);
}
if (dto == null) {
showResult(result);
throw new RestartResponseException(PageDebugList.class);
}
showResult(result, false);
if (!WebComponentUtil.isSuccessOrHandledErrorOrWarning(result)) {
showResult(result, false);
throw new RestartResponseException(PageDebugList.class);
}
return dto;
}
Aggregations