Skip to content

Commit

Permalink
MID-1767 - Role Editor implementation. Work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Suta committed Mar 14, 2014
1 parent ed18292 commit cbdeb8f
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 8 deletions.
Expand Up @@ -17,7 +17,6 @@
package com.evolveum.midpoint.web.page.admin;

import com.evolveum.midpoint.common.security.AuthorizationConstants;
import com.evolveum.midpoint.web.application.DescriptorLoader;
import com.evolveum.midpoint.web.component.menu.top.MenuBarItem;
import com.evolveum.midpoint.web.component.menu.top.MenuItem;
import com.evolveum.midpoint.web.component.menu.top.TopMenuBar;
Expand All @@ -28,7 +27,6 @@
import com.evolveum.midpoint.web.page.admin.reports.PageCreatedReports;
import com.evolveum.midpoint.web.page.admin.reports.PageReports;
import com.evolveum.midpoint.web.page.admin.resources.PageResourceEdit;
import com.evolveum.midpoint.web.page.admin.resources.PageResourceWizard;
import com.evolveum.midpoint.web.page.admin.resources.PageResources;
import com.evolveum.midpoint.web.page.admin.roles.PageRole;
import com.evolveum.midpoint.web.page.admin.roles.PageRoles;
Expand Down
Expand Up @@ -48,17 +48,17 @@
@PageDescriptor(url = "/admin/role", encoder = OnePageParameterEncoder.class, action = {
PageAdminRoles.AUTHORIZATION_ROLE_ALL,
AuthorizationConstants.NS_AUTHORIZATION + "#role"})
public class PageRole extends PageAdminRoles {
public class PageRoleOld extends PageAdminRoles {

private static final String DOT_CLASS = PageRole.class.getName() + ".";
private static final String DOT_CLASS = PageRoleOld.class.getName() + ".";
private static final String OPERATION_LOAD_ROLE = DOT_CLASS + "loadRole";
private static final String OPERATION_SAVE_ROLE = DOT_CLASS + "saveRole";

private static final String ID_MAIN_FORM = "mainForm";

private IModel<ObjectViewDto> model;

public PageRole() {
public PageRoleOld() {
model = new LoadableModel<ObjectViewDto>(false) {

@Override
Expand All @@ -76,11 +76,11 @@ protected IModel<String> createPageTitleModel() {
@Override
protected String load() {
if (!isEditing()) {
return PageRole.super.createPageTitleModel().getObject();
return PageRoleOld.super.createPageTitleModel().getObject();
}

String name = model.getObject().getName();
return new StringResourceModel("pageRole.title.editing", PageRole.this, null, null, name).getString();
return new StringResourceModel("pageRole.title.editing", PageRoleOld.this, null, null, name).getString();
}
};
}
Expand Down
Expand Up @@ -58,7 +58,6 @@
import org.apache.wicket.request.mapper.parameter.PageParameters;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
Expand Down
@@ -0,0 +1,114 @@
/*
* Copyright (c) 2010-2013 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.web.page.admin.roles.dto;

import com.evolveum.midpoint.xml.ns._public.common.common_2a.ActivationStatusType;

import javax.xml.datatype.XMLGregorianCalendar;
import java.io.Serializable;
import java.util.Date;

/**
* @author shood
* */
public class RoleDto implements Serializable{

public static final String F_NAME = "name";
public static final String F_DESCRIPTION = "description";
public static final String F_TYPE = "type";
public static final String F_REQUESTABLE = "requestable";
public static final String F_FROM = "from";
public static final String F_TO = "to";
public static final String F_ADMIN_STATUS = "adminStatus";

private String name;
private String description;
private String type;
private Boolean requestable;
private XMLGregorianCalendar from;
private XMLGregorianCalendar to;
private ActivationStatusType adminStatus;

public RoleDto(){}

public RoleDto(String name, String description, String type, Boolean requestable,
XMLGregorianCalendar from, XMLGregorianCalendar to, ActivationStatusType adminStatus){

this.name = name;
this.description = description;
this.type = type;
this.requestable = requestable;
this.from = from;
this.to = to;
this.adminStatus = adminStatus;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public Boolean getRequestable() {
return requestable;
}

public void setRequestable(Boolean requestable) {
this.requestable = requestable;
}

public XMLGregorianCalendar getFrom() {
return from;
}

public void setFrom(XMLGregorianCalendar from) {
this.from = from;
}

public XMLGregorianCalendar getTo() {
return to;
}

public void setTo(XMLGregorianCalendar to) {
this.to = to;
}

public ActivationStatusType getAdminStatus() {
return adminStatus;
}

public void setAdminStatus(ActivationStatusType adminStatus) {
this.adminStatus = adminStatus;
}
}

0 comments on commit cbdeb8f

Please sign in to comment.