-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MID-7484 initial UI for message template, wip
- Loading branch information
Showing
11 changed files
with
312 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../java/com/evolveum/midpoint/gui/impl/page/admin/messagetemplate/MessageTemplateModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2010-2022 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.impl.page.admin.messagetemplate; | ||
|
||
import com.evolveum.midpoint.gui.api.util.ModelServiceLocator; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel; | ||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateType; | ||
|
||
import org.apache.wicket.model.LoadableDetachableModel; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class MessageTemplateModel extends AssignmentHolderDetailsModel<MessageTemplateType> { | ||
|
||
public MessageTemplateModel(LoadableDetachableModel<PrismObject<MessageTemplateType>> prismObjectModel, ModelServiceLocator serviceLocator) { | ||
super(prismObjectModel, serviceLocator); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...om/evolveum/midpoint/gui/impl/page/admin/messagetemplate/MessageTemplateSummaryPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2010-2022 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.impl.page.admin.messagetemplate; | ||
|
||
import com.evolveum.midpoint.gui.api.GuiStyleConstants; | ||
import com.evolveum.midpoint.web.component.ObjectSummaryPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SummaryPanelSpecificationType; | ||
|
||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class MessageTemplateSummaryPanel extends ObjectSummaryPanel<MessageTemplateType> { | ||
|
||
public MessageTemplateSummaryPanel(String id, IModel<MessageTemplateType> model, SummaryPanelSpecificationType specification) { | ||
super(id, MessageTemplateType.class, model, specification); | ||
} | ||
|
||
@Override | ||
protected String getDefaultIconCssClass() { | ||
return GuiStyleConstants.CLASS_VALUE_POLICY_ICON; | ||
} | ||
|
||
@Override | ||
protected String getIconBoxAdditionalCssClass() { | ||
return null; | ||
} | ||
|
||
@Override | ||
protected String getBoxAdditionalCssClass() { | ||
return null; | ||
} | ||
|
||
@Override | ||
protected boolean isIdentifierVisible() { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected IModel<String> getTitleModel() { | ||
return Model.of("title"); | ||
} | ||
|
||
@Override | ||
protected IModel<String> getTitle2Model() { | ||
return super.getTitle2Model(); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
...n/java/com/evolveum/midpoint/gui/impl/page/admin/messagetemplate/PageMessageTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright (c) 2010-2022 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.impl.page.admin.messagetemplate; | ||
|
||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.request.mapper.parameter.PageParameters; | ||
|
||
import com.evolveum.midpoint.authentication.api.authorization.AuthorizationAction; | ||
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor; | ||
import com.evolveum.midpoint.authentication.api.authorization.Url; | ||
import com.evolveum.midpoint.authentication.api.util.AuthConstants; | ||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails; | ||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.security.api.AuthorizationConstants; | ||
import com.evolveum.midpoint.web.util.OnePageParameterEncoder; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateType; | ||
|
||
@PageDescriptor( | ||
urls = { | ||
@Url(mountUrl = "/admin/messageTemplate") | ||
}, | ||
encoder = OnePageParameterEncoder.class, | ||
action = { | ||
@AuthorizationAction(actionUri = AuthConstants.AUTH_CONFIGURATION_ALL, | ||
label = AuthConstants.AUTH_CONFIGURATION_ALL_LABEL, | ||
description = AuthConstants.AUTH_CONFIGURATION_ALL_DESCRIPTION), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_MESSAGE_TEMPLATES_ALL_URL, | ||
label = "PageMessageTemplates.auth.messageTemplatesAll.label", | ||
description = "PageMessageTemplates.auth.messageTemplatesAll.description"), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_MESSAGE_TEMPLATE_URL, | ||
label = "PageMessageTemplate.auth.messageTemplate.label", | ||
description = "PageMessageTemplate.auth.messageTemplate.description") | ||
}) | ||
public class PageMessageTemplate extends PageAssignmentHolderDetails<MessageTemplateType, MessageTemplateModel> { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public PageMessageTemplate() { | ||
super(); | ||
} | ||
|
||
public PageMessageTemplate(PageParameters parameters) { | ||
super(parameters); | ||
} | ||
|
||
public PageMessageTemplate(final PrismObject<MessageTemplateType> object) { | ||
super(object); | ||
} | ||
|
||
@Override | ||
public Class<MessageTemplateType> getType() { | ||
return MessageTemplateType.class; | ||
} | ||
|
||
@Override | ||
protected Panel createSummaryPanel(String id, IModel<MessageTemplateType> model) { | ||
return new MessageTemplateSummaryPanel(id, model, getSummaryPanelSpecification()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../java/com/evolveum/midpoint/gui/impl/page/admin/messagetemplate/PageMessageTemplates.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2010-2018 Evolveum | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:extend> | ||
<form wicket:id="mainForm" class="clearfix form-horizontal"> | ||
<wicket:child/> | ||
<div wicket:id="table"/> | ||
</form> | ||
</wicket:extend> | ||
</body> | ||
</html> |
94 changes: 94 additions & 0 deletions
94
.../java/com/evolveum/midpoint/gui/impl/page/admin/messagetemplate/PageMessageTemplates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* Copyright (c) 2010-2022 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.impl.page.admin.messagetemplate; | ||
|
||
import com.evolveum.midpoint.authentication.api.authorization.AuthorizationAction; | ||
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor; | ||
import com.evolveum.midpoint.authentication.api.authorization.Url; | ||
import com.evolveum.midpoint.authentication.api.util.AuthConstants; | ||
import com.evolveum.midpoint.gui.api.GuiStyleConstants; | ||
import com.evolveum.midpoint.gui.api.component.MainObjectListPanel; | ||
import com.evolveum.midpoint.security.api.AuthorizationConstants; | ||
import com.evolveum.midpoint.web.application.CollectionInstance; | ||
import com.evolveum.midpoint.web.application.PanelDisplay; | ||
import com.evolveum.midpoint.web.component.form.MidpointForm; | ||
import com.evolveum.midpoint.web.component.util.SelectableBean; | ||
import com.evolveum.midpoint.web.page.admin.PageAdmin; | ||
import com.evolveum.midpoint.web.session.UserProfileStorage.TableId; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypeType; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateType; | ||
|
||
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; | ||
import org.apache.wicket.markup.html.form.Form; | ||
|
||
@PageDescriptor( | ||
urls = { | ||
@Url(mountUrl = "/admin/messageTemplates") | ||
}, | ||
action = { | ||
@AuthorizationAction(actionUri = AuthConstants.AUTH_CONFIGURATION_ALL, | ||
label = AuthConstants.AUTH_CONFIGURATION_ALL_LABEL, | ||
description = AuthConstants.AUTH_CONFIGURATION_ALL_DESCRIPTION), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_MESSAGE_TEMPLATES_ALL_URL, | ||
label = "PageMessageTemplates.auth.archetypesAll.label", | ||
description = "PageMessageTemplates.auth.archetypesAll.description"), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_MESSAGE_TEMPLATES_URL, | ||
label = "PageMessageTemplates.auth.messageTemplates.label", | ||
description = "PageMessageTemplates.auth.messageTemplates.description"), | ||
@AuthorizationAction(actionUri = AuthorizationConstants.AUTZ_UI_MESSAGE_TEMPLATES_VIEW_URL, | ||
label = "PageMessageTemplates.auth.messageTemplates.view.label", | ||
description = "PageMessageTemplates.auth.messageTemplates.view.description") | ||
}) | ||
@CollectionInstance(identifier = "allMessageTemplates", applicableForType = MessageTemplateType.class, | ||
display = @PanelDisplay(label = "PageAdmin.menu.top.messageTemplates.list", singularLabel = "ObjectType.messageTemplate", icon = GuiStyleConstants.EVO_MESSAGE_TEMPLATE_TYPE_ICON)) | ||
public class PageMessageTemplates extends PageAdmin { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private static final String ID_MAIN_FORM = "mainForm"; | ||
private static final String ID_TABLE = "table"; | ||
|
||
public PageMessageTemplates() { | ||
super(); | ||
} | ||
|
||
@Override | ||
protected void onInitialize() { | ||
super.onInitialize(); | ||
initLayout(); | ||
} | ||
|
||
private void initLayout() { | ||
Form mainForm = new MidpointForm(ID_MAIN_FORM); | ||
add(mainForm); | ||
|
||
MainObjectListPanel<MessageTemplateType> table = new MainObjectListPanel<>(ID_TABLE, MessageTemplateType.class) { | ||
|
||
@Override | ||
protected TableId getTableId() { | ||
return TableId.TABLE_MESSAGE_TEMPLATES; | ||
} | ||
|
||
@Override | ||
protected IColumn<SelectableBean<MessageTemplateType>, String> createCheckboxColumn() { | ||
return null; | ||
} | ||
}; | ||
table.setOutputMarkupId(true); | ||
mainForm.add(table); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.