Skip to content

Commit

Permalink
MID-7484 more detail for message template UI, wip
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Feb 11, 2022
1 parent ae44d78 commit 9794efc
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.page.PageBase;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.web.application.SimpleCounter;
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateType;

/**
* Created by Viliam Repan (lazyman).
*/
public class LocalizedContentCounter extends SimpleCounter<AssignmentHolderDetailsModel<MessageTemplateType>, MessageTemplateType> {

public LocalizedContentCounter() {
super();
}

@Override
public int count(AssignmentHolderDetailsModel<MessageTemplateType> model, PageBase pageBase) {
MessageTemplateType message = model.getObjectType();
return message.getLocalizedContent().size();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
~ 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.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div class="row">
<div class="col-md-12">
<div wicket:id="mainPanel" />
</div>
</div>
</wicket:panel>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateContentType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateType;

/**
* Created by Viliam Repan (lazyman).
*/
@PanelType(name = "messageTemplateContent")
@PanelInstance(
identifier = "messageTemplateContent",
applicableForType = MessageTemplateType.class,
display = @PanelDisplay(
label = "PageMessageTemplate.defaultContent",
icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
order = 20
)
)
public class MessageTemplateContentPanel extends AbstractObjectMainPanel<MessageTemplateType, AssignmentHolderDetailsModel<MessageTemplateType>> {

private static final String ID_MAIN_PANEL = "mainPanel";

public MessageTemplateContentPanel(String id, AssignmentHolderDetailsModel<MessageTemplateType> model, ContainerPanelConfigurationType config) {
super(id, model, config);
}

@Override
protected void initLayout() {
SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(MessageTemplateType.F_DEFAULT_CONTENT)),
MessageTemplateContentType.COMPLEX_TYPE);
add(panel);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
~ 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.
-->

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div class="row">
<div class="col-md-12">

</div>
</div>
</wicket:panel>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* 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.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.web.application.*;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.MessageTemplateType;

/**
* Created by Viliam Repan (lazyman).
*/
@PanelType(name = "messageTemplateLocalizedContent")
@PanelInstance(
identifier = "messageTemplateLocalizedContent",
applicableForType = MessageTemplateType.class,
display = @PanelDisplay(
label = "PageMessageTemplate.localizedContent",
icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
order = 30
)
)
@Counter(provider = LocalizedContentCounter.class)
public class MessageTemplateLocalizedContentPanel extends AbstractObjectMainPanel<MessageTemplateType, AssignmentHolderDetailsModel<MessageTemplateType>> {

public MessageTemplateLocalizedContentPanel(String id, AssignmentHolderDetailsModel<MessageTemplateType> model, ContainerPanelConfigurationType config) {
super(id, model, config);
}

@Override
protected void initLayout() {
setOutputMarkupId(true);


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

package com.evolveum.midpoint.gui.impl.page.admin.messagetemplate;

import org.apache.wicket.model.IModel;

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).
*/
Expand Down Expand Up @@ -52,14 +51,4 @@ protected String getBoxAdditionalCssClass() {
protected boolean isIdentifierVisible() {
return false;
}

@Override
protected IModel<String> getTitleModel() {
return Model.of("title");
}

@Override
protected IModel<String> getTitle2Model() {
return super.getTitle2Model();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
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;
Expand Down

0 comments on commit 9794efc

Please sign in to comment.