Skip to content

Commit

Permalink
Predefined identifiers of dashboard components (MID-3755)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik authored and KaterynaHonchar committed Feb 27, 2017
1 parent 11fe5cf commit b8b856e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2016 Evolveum
* Copyright (c) 2010-2017 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,7 @@
public class ComponentConstants {

public static final String NS_COMPONENTS_PREFIX = SchemaConstants.NS_MIDPOINT_PUBLIC_PREFIX + "gui/component-3";
public static final String NS_DASHBOARD_WIDGET = NS_COMPONENTS_PREFIX + "/dashboard/widget";

// UI - Tabs for focus objects
public static final QName UI_FOCUS_TAB_BASIC = new QName(NS_COMPONENTS_PREFIX, "focusTabBasic");
Expand Down Expand Up @@ -60,5 +61,6 @@ public class ComponentConstants {
public static final String UI_FOCUS_TAB_POLICY_CONSTRAINTS_URL = QNameUtil.qNameToUri(UI_FOCUS_TAB_POLICY_CONSTRAINTS);

public static final QName UI_FOCUS_TAB_MEMBERS = new QName(NS_COMPONENTS_PREFIX, "focusTabMembers");
public static final String UI_FOCUS_TAB_MEMBERS_URL = QNameUtil.qNameToUri(UI_FOCUS_TAB_MEMBERS);
public static final String UI_FOCUS_TAB_MEMBERS_URL = QNameUtil.qNameToUri(UI_FOCUS_TAB_MEMBERS);

}
@@ -0,0 +1,51 @@
/**
* Copyright (c) 2017 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.gui.api;

import javax.xml.namespace.QName;

import com.evolveum.midpoint.util.QNameUtil;

/**
* @author semancik
*
*/
public enum PredefinedDashboardWidgetId {

SEARCH("search"),
SHORTCUTS("shortcuts"),
MY_WORKITEMS("myWorkitems"),
MY_REQUESTS("myRequests"),
MY_ASSIGNMENTS("myAssignments"),
MY_ACCOUNTS("myAccounts");

private final QName qname;
private final String uri;

private PredefinedDashboardWidgetId(String localPart) {
this.qname = new QName(ComponentConstants.NS_DASHBOARD_WIDGET, localPart);
this.uri = QNameUtil.qNameToUri(qname);
}

public QName getQname() {
return qname;
}

public String getUri() {
return uri;
}

}
4 changes: 2 additions & 2 deletions model/model-intest/src/test/resources/common/role-pirate.xml
Expand Up @@ -146,11 +146,11 @@
</objectForms>
<userDashboard>
<widget>
<identifier>http://midpoint.evolveum.com/xml/ns/test#widget1</identifier>
<identifier>http://midpoint.evolveum.com/xml/ns/public/gui/component-3/dashboard/widget#search</identifier>
<visibility>automatic</visibility>
</widget>
<widget>
<identifier>http://midpoint.evolveum.com/xml/ns/test#widget2</identifier>
<identifier>http://midpoint.evolveum.com/xml/ns/public/gui/component-3/dashboard/widget#myWorkitems</identifier>
<visibility>vacant</visibility>
</widget>
</userDashboard>
Expand Down

0 comments on commit b8b856e

Please sign in to comment.