Fixes for ALFCOM-2313, ETHREEOH-1006, ALFCOM-2302, ETHREEOH-1023, ETWOTWO-1069

- correct enable/disable of OK button for applying Templates and RSS feeds to spaces and documents
 - clean up of related bean and JSP pages - conversion to JSF components from horrid verbatim tag based dialogs

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2009-06-18 11:18:59 +00:00
parent 818c99168d
commit 7bc8553167
7 changed files with 134 additions and 111 deletions

View File

@@ -40,14 +40,13 @@ import org.alfresco.web.ui.common.Utils;
public class ApplyDocTemplateDialog extends BaseDialogBean public class ApplyDocTemplateDialog extends BaseDialogBean
{ {
private static final long serialVersionUID = -9098279672434597354L; private static final long serialVersionUID = -9098279672434597354L;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
protected String template; protected String template;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
@Override @Override
protected String finishImpl(FacesContext context, String outcome) throws Exception protected String finishImpl(FacesContext context, String outcome) throws Exception
@@ -80,27 +79,22 @@ public class ApplyDocTemplateDialog extends BaseDialogBean
return DIALOG_CLOSE; return DIALOG_CLOSE;
} }
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle() public String getContainerTitle()
{ {
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_TEMPLATE) + " '" + getName() + "'"; return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_TEMPLATE) + " '" + getName() + "'";
} }
public String getTemplate() public String getTemplate()
{ {
// return current template if it exists // return current template if it exists
NodeRef ref = (NodeRef) getNode().getProperties().get(ContentModel.PROP_TEMPLATE); NodeRef ref = (NodeRef) getNode().getProperties().get(ContentModel.PROP_TEMPLATE);
return ref != null ? ref.getId() : this.template; return ref != null ? ref.getId() : this.template;
} }
public void setTemplate(String template) public void setTemplate(String template)
{ {
this.template = template; this.template = template;
} }
public Node getNode() public Node getNode()
{ {

View File

@@ -41,14 +41,14 @@ import org.alfresco.web.ui.common.Utils;
public class ApplyRssTemplateDialog extends BaseDialogBean public class ApplyRssTemplateDialog extends BaseDialogBean
{ {
private static final long serialVersionUID = 9207265799149337182L; private static final long serialVersionUID = 9207265799149337182L;
private static final String DIALOG_CLOSE = "dialog:close"; private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_RSS_FEED = "apply_rss_feed"; private static final String MSG_APPLY_RSS_FEED = "apply_rss_feed";
private String rssTemplate; private String rssTemplate;
public void setRSSTemplate(String rssTemplate) public void setRSSTemplate(String rssTemplate)
{ {
this.rssTemplate = rssTemplate; this.rssTemplate = rssTemplate;
@@ -71,11 +71,6 @@ public class ApplyRssTemplateDialog extends BaseDialogBean
return DIALOG_CLOSE; return DIALOG_CLOSE;
} }
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle() public String getContainerTitle()
{ {
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_RSS_FEED) + " '" + getNode().getName() + "'"; return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_RSS_FEED) + " '" + getNode().getName() + "'";

View File

@@ -41,14 +41,13 @@ import org.alfresco.web.ui.common.Utils;
public class ApplySpaceTemplateDialog extends BaseDialogBean public class ApplySpaceTemplateDialog extends BaseDialogBean
{ {
private static final long serialVersionUID = -3019234033026890265L; private static final long serialVersionUID = -3019234033026890265L;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
protected String template; protected String template;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
@Override @Override
protected String finishImpl(FacesContext context, String outcome) throws Exception protected String finishImpl(FacesContext context, String outcome) throws Exception
@@ -57,11 +56,6 @@ public class ApplySpaceTemplateDialog extends BaseDialogBean
return DIALOG_CLOSE; return DIALOG_CLOSE;
} }
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle() public String getContainerTitle()
{ {
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_TEMPLATE) + " '" + getNode().getName() + "'"; return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_TEMPLATE) + " '" + getNode().getName() + "'";

View File

@@ -676,6 +676,11 @@ a.topToolbarLinkHighlight, a.topToolbarLinkHighlight:link, a.topToolbarLinkHighl
width: 20px; width: 20px;
} }
.panelGridLabelColumnAuto
{
white-space: nowrap;
}
.panelGridLabelColumn .panelGridLabelColumn
{ {
white-space: nowrap; white-space: nowrap;

View File

@@ -29,13 +29,32 @@
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<f:verbatim> <f:verbatim>
<table cellpadding="2" cellspacing="2" border="0" width="100%"> <script type="text/javascript">
<tr> var finishButtonPressed = false;
<td></f:verbatim><h:outputText value="#{msg.template}" /><f:verbatim>:</td> window.onload = pageLoaded;
<td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplyDocTemplateDialog.template}"> function pageLoaded()
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" /> {
</h:selectOneMenu><f:verbatim></td> checkButtonState();
</tr> }
</table>
function checkButtonState()
{
if (document.getElementById("dialog:dialog-body:template").value == "none")
{
document.getElementById("dialog:finish-button").disabled = true;
}
else
{
document.getElementById("dialog:finish-button").disabled = false;
}
}
</script>
</f:verbatim> </f:verbatim>
<h:panelGrid id="template-panel" columns="2" cellpadding="2" cellspacing="2" border="0" width="100%" columnClasses="panelGridLabelColumnAuto,panelGridValueColumn">
<h:outputText value="#{msg.template}:" />
<h:selectOneMenu id="template" value="#{ApplyDocTemplateDialog.template}" onchange="checkButtonState();">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu>
</h:panelGrid>

View File

@@ -35,51 +35,48 @@
<r:loadBundle var="msg"/> <r:loadBundle var="msg"/>
<f:verbatim> <f:verbatim>
<table cellspacing="0" cellpadding="0" border="0" width="100%"> <script type="text/javascript">
<tr> var finishButtonPressed = false;
<%-- TODO: check for Guest user access and hide panel? --%> window.onload = pageLoaded;
<td width="100%" valign="top">
<%
PanelGenerator.generatePanelStart(out, request.getContextPath(),
"yellowInner", "#ffffcc");
%>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign=top style="padding-top:2px" width=20></f:verbatim><h:graphicImage
url="/images/icons/info_icon.gif" width="16" height="16" /><f:verbatim></td>
<td class="mainSubText"></f:verbatim><h:outputText
value="#{msg.apply_rss_feed_warning1} " /> <a:actionLink
value="#{msg.manage_invited_users}"
actionListener="#{BrowseBean.setupSpaceAction}"
action="dialog:manageInvitedUsers">
<f:param name="id" value="#{SpaceDetailsDialog.id}" />
</a:actionLink> <h:outputText value=" #{msg.apply_rss_feed_warning2}" /><f:verbatim></td>
</tr>
</table>
<%
PanelGenerator.generatePanelEnd(out, request.getContextPath(),
"yellowInner");
%>
<div style="padding:4px"></div> function pageLoaded()
<% {
PanelGenerator.generatePanelStart(out, request.getContextPath(), checkButtonState();
"white", "white"); }
%>
<table cellpadding="2" cellspacing="2" border="0" width="100%"> function checkButtonState()
<tr> {
<td><nobr></f:verbatim><h:outputText value="#{msg.rss_template}" /><f:verbatim>:</nobr></td> if (document.getElementById("dialog:dialog-body:template").value == "none")
<td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu {
value="#{ApplyRssTemplateDialog.RSSTemplate}"> document.getElementById("dialog:finish-button").disabled = true;
<f:selectItems value="#{TemplateSupportBean.RSSTemplates}" /> }
</h:selectOneMenu><f:verbatim></td> else
</tr> {
</table> document.getElementById("dialog:finish-button").disabled = false;
<% }
PanelGenerator.generatePanelEnd(out, request.getContextPath(), }
"white"); </script>
%>
</td> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
</tr> <table cellpadding="0" cellspacing="0" border="0" width="100%">
</table> <tr>
<td valign="top" style="padding-top:2px" width="20"></f:verbatim><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16" /><f:verbatim></td>
<td class="mainSubText"></f:verbatim>
<h:outputText value="#{msg.apply_rss_feed_warning1}" />
<a:actionLink value=" #{msg.manage_invited_users} " actionListener="#{BrowseBean.setupSpaceAction}" action="dialog:manageInvitedUsers">
<f:param name="id" value="#{SpaceDetailsDialog.id}" />
</a:actionLink>
<h:outputText value="#{msg.apply_rss_feed_warning2}" /><f:verbatim></td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
<div style="padding:4px"></div>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %></f:verbatim>
<h:panelGrid id="template-panel" columns="2" cellpadding="2" cellspacing="2" border="0" width="100%" columnClasses="panelGridLabelColumnAuto,panelGridValueColumn">
<h:outputText value="#{msg.rss_template}:" />
<h:selectOneMenu id="template" value="#{ApplyRssTemplateDialog.RSSTemplate}" onchange="checkButtonState();">
<f:selectItems value="#{TemplateSupportBean.RSSTemplates}" />
</h:selectOneMenu>
</h:panelGrid><f:verbatim>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</f:verbatim> </f:verbatim>

View File

@@ -29,13 +29,32 @@
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<f:verbatim> <f:verbatim>
<table cellpadding="2" cellspacing="2" border="0" width="100%"> <script type="text/javascript">
<tr> var finishButtonPressed = false;
<td></f:verbatim><h:outputText value="#{msg.template}" /><f:verbatim>:</td> window.onload = pageLoaded;
<td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplySpaceTemplateDialog.template}"> function pageLoaded()
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" /> {
</h:selectOneMenu><f:verbatim></td> checkButtonState();
</tr> }
</table>
function checkButtonState()
{
if (document.getElementById("dialog:dialog-body:template").value == "none")
{
document.getElementById("dialog:finish-button").disabled = true;
}
else
{
document.getElementById("dialog:finish-button").disabled = false;
}
}
</script>
</f:verbatim> </f:verbatim>
<h:panelGrid id="template-panel" columns="2" cellpadding="2" cellspacing="2" border="0" width="100%" columnClasses="panelGridLabelColumnAuto,panelGridValueColumn">
<h:outputText value="#{msg.template}:" />
<h:selectOneMenu id="template" value="#{ApplySpaceTemplateDialog.template}" onchange="checkButtonState();">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu>
</h:panelGrid>