summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-08-05 03:16:14 (EDT)
committerStephan Born2013-09-23 04:57:52 (EDT)
commit876879832a7536267bf79dd55220d3cae86fff7a (patch)
treee1757b121ede3a691baa1b91c522fe4c9602aad4
parentfb66f8dfa2dcae80619299a9fef921017af1b862 (diff)
downloadorg.eclipse.stardust.ui.web-876879832a7536267bf79dd55220d3cae86fff7a.zip
org.eclipse.stardust.ui.web-876879832a7536267bf79dd55220d3cae86fff7a.tar.gz
org.eclipse.stardust.ui.web-876879832a7536267bf79dd55220d3cae86fff7a.tar.bz2
Jira-ID: CRNT-29403
Added logic to show/hide apply btn on SecurityDialog.java. Removed unwanted setters from AccessControlBean.java. git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@66465 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/AccessControlBean.java37
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/SecurityDialog.java21
-rw-r--r--views-common/src/main/resources/META-INF/xhtml/security/securityDialog.xhtml6
-rw-r--r--views-common/src/main/resources/META-INF/xhtml/security/securityDialogColumns.xhtml4
4 files changed, 18 insertions, 50 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/AccessControlBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/AccessControlBean.java
index 55ba991..717d5e2 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/AccessControlBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/AccessControlBean.java
@@ -159,11 +159,8 @@ public class AccessControlBean extends DefaultRowModel
public void editClicked(ActionEvent ae)
{
setEdit(true);
- setNewOrModified(true);
}
-
-
public void setParticipant(Participant participant)
{
this.participant = participant;
@@ -220,71 +217,37 @@ public class AccessControlBean extends DefaultRowModel
return newOrModified;
}
- public void setNewOrModified(boolean newOrModified)
- {
- // this.newOrModified = newOrModified;
- }
-
public String getCreatePolicyChangedValue()
{
return createPolicyChangedValue;
}
- public void setCreatePolicyChangedValue(String createPolicyChangedValue)
- {
- // this.createPolicyChangedValue = createPolicyChangedValue;
- }
-
public String getReadPolicyChangedValue()
{
return readPolicyChangedValue;
}
- public void setReadPolicyChangedValue(String readPolicyChangedValue)
- {
- // this.readPolicyChangedValue = readPolicyChangedValue;
- }
-
public String getModifyPolicyChangedValue()
{
return modifyPolicyChangedValue;
}
- public void setModifyPolicyChangedValue(String modifyPolicyChangedValue)
- {
- // this.modifyPolicyChangedValue = modifyPolicyChangedValue;
- }
-
public String getDeletePolicyChangedValue()
{
return deletePolicyChangedValue;
}
- public void setDeletePolicyChangedValue(String deletePolicyChangedValue)
- {
- // this.deletePolicyChangedValue = deletePolicyChangedValue;
- }
public String getReadACLPolicyChangedValue()
{
return readACLPolicyChangedValue;
}
- public void setReadACLPolicyChangedValue(String readACLPolicyChangedValue)
- {
- // this.readACLPolicyChangedValue = readACLPolicyChangedValue;
- }
-
public String getModifyACLPolicyChangedValue()
{
return modifyACLPolicyChangedValue;
}
- public void setModifyACLPolicyChangedValue(String modifyACLPolicyChangedValue)
- {
- // this.modifyACLPolicyChangedValue = modifyACLPolicyChangedValue;
- }
-
public boolean isSelectedRow()
{
return selectedRow;
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/SecurityDialog.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/SecurityDialog.java
index d5c18f5..b7a1702 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/SecurityDialog.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/security/SecurityDialog.java
@@ -49,7 +49,6 @@ import org.eclipse.stardust.ui.web.common.util.StringUtils;
import org.eclipse.stardust.ui.web.viewscommon.core.CommonProperties;
import org.eclipse.stardust.ui.web.viewscommon.core.ResourcePaths;
import org.eclipse.stardust.ui.web.viewscommon.docmgmt.ParametricCallbackHandler;
-import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.services.ContextPortalServices;
import org.eclipse.stardust.ui.web.viewscommon.utils.DMSHelper;
import org.eclipse.stardust.ui.web.viewscommon.utils.ModelUtils;
@@ -71,7 +70,6 @@ public class SecurityDialog extends PopupUIComponentBean
private boolean policyChanged = false;
private boolean allInheritPolicy = true;
private Map<String, QualifiedModelParticipantInfo> allParticipants;
- private final MessagesViewsCommonBean COMMON_MESSAGE_BEAN = MessagesViewsCommonBean.getInstance();
public List<SelectItem> getPermission()
@@ -199,7 +197,6 @@ public class SecurityDialog extends PopupUIComponentBean
if (!getAccessControlBean().contains(acb))
{
acb.setEdit(true);
- acb.setNewOrModified(true);
getAccessControlBean().add(acb);
securityDialogTable.setList(accessControlBean);
securityDialogTable.initialize();
@@ -348,11 +345,17 @@ public class SecurityDialog extends PopupUIComponentBean
return false;
}
+ /**
+ * When all the permission's are Inherit, no need to show APPLY btn
+ *
+ * @param acb
+ * @return
+ */
private boolean checkAllRolesInherit(AccessControlBean acb)
{
- if (!isLeaf && AccessControlBean.INHERIT.equals(acb.getCreate()))
+ if (!isLeaf() && !(AccessControlBean.INHERIT.equals(acb.getCreate())))
return false;
- else if (!AccessControlBean.INHERIT.equals(acb.getModify()))
+ else if (!AccessControlBean.INHERIT.equals(acb.getRead()))
return false;
else if (!AccessControlBean.INHERIT.equals(acb.getModify()))
return false;
@@ -415,13 +418,11 @@ public class SecurityDialog extends PopupUIComponentBean
if (CommonProperties.ADMINISTRATOR.equals(acb.getParticipant().getId()))
{
acb.setEdit(false);
- acb.setNewOrModified(false);
continue;
}
if (next != null)
{
acb.setEdit(false);
- acb.setNewOrModified(false);
if (!acb.getCreate().equals(AccessControlBean.INHERIT))
{
next.addAccessControlEntry(acb.getParticipant().getPrincipal(),
@@ -530,7 +531,6 @@ public class SecurityDialog extends PopupUIComponentBean
{
acb.setModifyAcl(newValue);
}
- acb.setNewOrModified(true);
}
for (int i = 0; i < accessControlBean.size(); i++)
{
@@ -716,6 +716,11 @@ public class SecurityDialog extends PopupUIComponentBean
break;
}
}
+ // When all roles are removed, do not show Apply btn
+ if (accessControlBean.size() == 0)
+ {
+ allInheritPolicy = true;
+ }
securityDialogTable.setList(accessControlBean);
securityDialogTable.initialize();
}
diff --git a/views-common/src/main/resources/META-INF/xhtml/security/securityDialog.xhtml b/views-common/src/main/resources/META-INF/xhtml/security/securityDialog.xhtml
index 5449e45..4c2cbf6 100644
--- a/views-common/src/main/resources/META-INF/xhtml/security/securityDialog.xhtml
+++ b/views-common/src/main/resources/META-INF/xhtml/security/securityDialog.xhtml
@@ -70,12 +70,12 @@
<ice:panelGroup>
<ice:panelGrid columns="3" style="float:right;">
<pc:automationTag value="auto-COM-SecurityDlg-BtnsBar" standAlone="false"/>
- <ice:commandButton rendered="#{securityDialog.editMode}"
+ <ice:commandButton rendered="#{securityDialog.editMode and (!(securityDialog.allInheritPolicy))}"
value="#{securityDialog.messages['securityDialog.button.apply']}"
- styleClass="button" action="#{securityDialog.apply}" />
+ styleClass="button" action="#{securityDialog.apply}" onclick="Event.stop(event);" partialSubmit="true" immediate ="true"/>
<ice:commandButton
value="#{views_common_msgPropsBean['common.close']}"
- styleClass="button secondary" action="#{securityDialog.closePopup}" />
+ styleClass="button secondary" action="#{securityDialog.closePopup}" onclick="Event.stop(event);" partialSubmit="true" immediate ="true"/>
</ice:panelGrid>
</ice:panelGroup>
diff --git a/views-common/src/main/resources/META-INF/xhtml/security/securityDialogColumns.xhtml b/views-common/src/main/resources/META-INF/xhtml/security/securityDialogColumns.xhtml
index 5a8f47f..545943c 100644
--- a/views-common/src/main/resources/META-INF/xhtml/security/securityDialogColumns.xhtml
+++ b/views-common/src/main/resources/META-INF/xhtml/security/securityDialogColumns.xhtml
@@ -238,11 +238,11 @@
<ice:panelGroup rendered="#{col.columnName == 'Actions'}">
<ice:commandLink value="#{views_common_msgPropsBean['common.edit']}" styleClass="action-link" disabled="#{!securityDialog.modifyACL}"
- actionListener="#{row.editClicked}" style="padding-right:15px;" >
+ actionListener="#{row.editClicked}" style="padding-right:15px;" onclick="Event.stop(event);" partialSubmit="true" immediate="true">
<pc:automationTag value="auto-COM-SecurityDlg-SecurityDlgTbl-ActionsEdit" standAlone="false"/>
</ice:commandLink>
<ice:commandLink value="#{views_common_msgPropsBean['common.remove']}" styleClass="action-link" disabled="#{!securityDialog.modifyACL}"
- actionListener="#{securityDialog.removeRole}" style="padding-right:15px;" >
+ actionListener="#{securityDialog.removeRole}" style="padding-right:15px;" onclick="Event.stop(event);" partialSubmit="true" immediate="true">
<pc:automationTag value="auto-COM-SecurityDlg-SecurityDlgTbl-ActionsRemove" standAlone="false"/>
<f:attribute name="acb" value="#{row}" />
</ice:commandLink>