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
{
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;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
@@ -80,11 +79,6 @@ public class ApplyDocTemplateDialog extends BaseDialogBean
return DIALOG_CLOSE;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_TEMPLATE) + " '" + getName() + "'";

View File

@@ -41,14 +41,14 @@ import org.alfresco.web.ui.common.Utils;
public class ApplyRssTemplateDialog extends BaseDialogBean
{
private static final long serialVersionUID = 9207265799149337182L;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_RSS_FEED = "apply_rss_feed";
private String rssTemplate;
public void setRSSTemplate(String rssTemplate)
{
this.rssTemplate = rssTemplate;
@@ -71,11 +71,6 @@ public class ApplyRssTemplateDialog extends BaseDialogBean
return DIALOG_CLOSE;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle()
{
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
{
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;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
@@ -57,11 +56,6 @@ public class ApplySpaceTemplateDialog extends BaseDialogBean
return DIALOG_CLOSE;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle()
{
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;
}
.panelGridLabelColumnAuto
{
white-space: nowrap;
}
.panelGridLabelColumn
{
white-space: nowrap;

View File

@@ -29,13 +29,32 @@
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<f:verbatim>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td></f:verbatim><h:outputText value="#{msg.template}" /><f:verbatim>:</td>
<td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplyDocTemplateDialog.template}">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu><f:verbatim></td>
</tr>
</table>
<script type="text/javascript">
var finishButtonPressed = false;
window.onload = pageLoaded;
function pageLoaded()
{
checkButtonState();
}
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>
<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"/>
<f:verbatim>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<%-- TODO: check for Guest user access and hide panel? --%>
<td width="100%" valign="top">
<%
PanelGenerator.generatePanelStart(out, request.getContextPath(),
"yellowInner", "#ffffcc");
%>
<script type="text/javascript">
var finishButtonPressed = false;
window.onload = pageLoaded;
function pageLoaded()
{
checkButtonState();
}
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>
<% 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">
<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>
</a:actionLink>
<h:outputText value="#{msg.apply_rss_feed_warning2}" /><f:verbatim></td>
</tr>
</table>
<%
PanelGenerator.generatePanelEnd(out, request.getContextPath(),
"yellowInner");
%>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
<div style="padding:4px"></div>
<%
PanelGenerator.generatePanelStart(out, request.getContextPath(),
"white", "white");
%>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><nobr></f:verbatim><h:outputText value="#{msg.rss_template}" /><f:verbatim>:</nobr></td>
<td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplyRssTemplateDialog.RSSTemplate}">
<% 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><f:verbatim></td>
</tr>
</table>
<%
PanelGenerator.generatePanelEnd(out, request.getContextPath(),
"white");
%>
</td>
</tr>
</table>
</h:selectOneMenu>
</h:panelGrid><f:verbatim>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</f:verbatim>

View File

@@ -29,13 +29,32 @@
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<f:verbatim>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td></f:verbatim><h:outputText value="#{msg.template}" /><f:verbatim>:</td>
<td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplySpaceTemplateDialog.template}">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu><f:verbatim></td>
</tr>
</table>
<script type="text/javascript">
var finishButtonPressed = false;
window.onload = pageLoaded;
function pageLoaded()
{
checkButtonState();
}
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>
<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>