(1);
+ params.put("store", storeName);
+ params.put("directView", "true");
+ Application.getDialogManager().setupParameters(params);
+
+ return "dialog:linkValidationReport";
+ }
+
+ // ------------------------------------------------------------------------------
+ // Getters and Setters
+
+ /**
+ * @param avmBrowseBean AVMBrowseBean instance
+ */
+ public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
+ {
+ this.avmBrowseBean = avmBrowseBean;
+ }
+}
diff --git a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java
index fda3c7fd78..81447d7b5e 100644
--- a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java
+++ b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java
@@ -97,6 +97,7 @@ public class SubmitDialog extends BaseDialogBean
private String[] workflowSelectedValue;
private boolean enteringExpireDate = false;
private boolean startedFromWorkflow = false;
+ private boolean validateLinks = false;
private Date defaultExpireDate;
private Date launchDate;
@@ -195,6 +196,7 @@ public class SubmitDialog extends BaseDialogBean
this.defaultExpireDate = new Date();
this.workflowSelectedValue = null;
this.launchDate = null;
+ this.validateLinks = false;
// determine if the dialog has been started from a workflow
Boolean bool = new Boolean(this.parameters.get(PARAM_STARTED_FROM_WORKFLOW));
@@ -330,6 +332,7 @@ public class SubmitDialog extends BaseDialogBean
params.put(WCMWorkflowModel.PROP_FROM_PATH,
AVMUtil.buildStoreRootPath(this.avmBrowseBean.getSandbox()));
params.put(WCMWorkflowModel.PROP_LAUNCH_DATE, this.launchDate);
+ params.put(WCMWorkflowModel.PROP_VALIDATE_LINKS, new Boolean(this.validateLinks));
params.put(WCMWorkflowModel.ASSOC_WEBPROJECT,
this.avmBrowseBean.getWebsite().getNodeRef());
@@ -517,6 +520,22 @@ public class SubmitDialog extends BaseDialogBean
this.launchDate = launchDate;
}
+ /**
+ * @return Flag to indicate whether links should be validated
+ */
+ public boolean isValidateLinks()
+ {
+ return this.validateLinks;
+ }
+
+ /**
+ * @param validateLinks Flag to indicate whether links should be validated
+ */
+ public void setValidateLinks(boolean validateLinks)
+ {
+ this.validateLinks = validateLinks;
+ }
+
/**
* @return List of UIListItem object representing the available workflows for the website
*/
diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java
index 498926bec1..2e1bd6d690 100644
--- a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java
+++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java
@@ -72,14 +72,87 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
}
// get the link validation state object to get the data from
+ ResourceBundle bundle = Application.getBundle(context);
ResponseWriter out = context.getResponseWriter();
LinkValidationState linkState = getValue();
if (logger.isDebugEnabled())
logger.debug("Rendering summary from state object: " + linkState);
- // resolve all the strings holding data
- ResourceBundle bundle = Application.getBundle(context);
+ if (linkState.getError() == null)
+ {
+ Object initialCheckOnly = this.getAttributes().get("initialCheckOnly");
+ if (initialCheckOnly instanceof Boolean &&
+ ((Boolean)initialCheckOnly).booleanValue())
+ {
+ out.write("");
+ renderInitialCheckSummary(context, out, linkState, bundle);
+ out.write("
");
+ }
+ else
+ {
+ String pattern = bundle.getString("files_links_still_broken");
+ String stillBroken = MessageFormat.format(pattern,
+ new Object[] {linkState.getNumberBrokenFiles(), linkState.getNumberBrokenLinks()});
+ pattern = bundle.getString("broken_links_fixed");
+ String linksFixed = MessageFormat.format(pattern,
+ new Object[] {linkState.getNumberFixedLinks()});
+
+ // get the action to update the current status
+ UICommand updateStatusAction = aquireAction(context, "update_status_" + linkState.getStore());
+
+ // render the summary area
+ out.write("");
+ out.write(bundle.getString("summary"));
+ out.write("
");
+ out.write("");
+ out.write(bundle.getString("initial_check"));
+ out.write(": | ");
+ renderInitialCheckSummary(context, out, linkState, bundle);
+ out.write(" |
");
+ out.write(bundle.getString("current_status"));
+ out.write(": | ;
+ out.write(context.getExternalContext().getRequestContextPath());
+ out.write("/images/icons/broken_link.gif) ");
+ out.write(stillBroken);
+ out.write(" ;
+ out.write(context.getExternalContext().getRequestContextPath());
+ out.write("/images/icons/fixed_link.gif) ");
+ out.write(linksFixed);
+ out.write(" ");
+ Utils.encodeRecursive(context, updateStatusAction);
+ out.write(" |
");
+ out.write("
");
+ }
+ }
+ else
+ {
+ String pattern = bundle.getString("files_links_checked_error");
+ Date initialCheck = linkState.getInitialCheckCompletedAt();
+ String initialCheckTime = Utils.getDateTimeFormat(context).format(initialCheck);
+ String initialCheckSummary = MessageFormat.format(pattern,
+ new Object[] {initialCheckTime});
+
+ out.write("");
+ out.write(initialCheckSummary);
+ out.write(" ");
+ String err = linkState.getError().getMessage();
+ if (err == null)
+ {
+ out.write(linkState.getError().toString());
+ }
+ else
+ {
+ out.write(err);
+ }
+ out.write("
");
+ }
+ }
+
+ protected void renderInitialCheckSummary(FacesContext context,
+ ResponseWriter out, LinkValidationState linkState,
+ ResourceBundle bundle) throws IOException
+ {
String pattern = bundle.getString("files_links_checked");
Date initialCheck = linkState.getInitialCheckCompletedAt();
String initialCheckTime = Utils.getDateTimeFormat(context).format(initialCheck);
@@ -89,45 +162,16 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
pattern = bundle.getString("files_links_broken");
String initialBrokenSummary = MessageFormat.format(pattern,
new Object[] {linkState.getInitialNumberBrokenFiles(), linkState.getInitialNumberBrokenLinks()});
- pattern = bundle.getString("files_links_still_broken");
- String stillBroken = MessageFormat.format(pattern,
- new Object[] {linkState.getNumberBrokenFiles(), linkState.getNumberBrokenLinks()});
- pattern = bundle.getString("broken_links_fixed");
- String linksFixed = MessageFormat.format(pattern,
- new Object[] {linkState.getNumberFixedLinks()});
- // get the action to update the current status
- UICommand updateStatusAction = aquireAction(context, "update_status_" + linkState.getStore());
-
- // render the summary area
- out.write("");
- out.write(bundle.getString("summary"));
- out.write("
");
- out.write("");
- out.write(bundle.getString("initial_check"));
- out.write(": | ");
+ out.write(" ");
out.write(initialCheckSummary);
out.write(" ;
out.write(context.getExternalContext().getRequestContextPath());
out.write("/images/icons/broken_link.gif) ");
out.write(initialBrokenSummary);
- out.write(" |
");
- out.write("");
- out.write(bundle.getString("current_status"));
- out.write(": | ;
- out.write(context.getExternalContext().getRequestContextPath());
- out.write("/images/icons/broken_link.gif) ");
- out.write(stillBroken);
- out.write(" ;
- out.write(context.getExternalContext().getRequestContextPath());
- out.write("/images/icons/fixed_link.gif) ");
- out.write(linksFixed);
- out.write(" ");
- Utils.encodeRecursive(context, updateStatusAction);
- out.write(" |
");
- out.write("
");
+ out.write("");
}
-
+
@SuppressWarnings("unchecked")
private UICommand aquireAction(FacesContext context, String actionId)
{
diff --git a/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java
index 225833ae06..da8ab72849 100644
--- a/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java
+++ b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java
@@ -36,6 +36,7 @@ import org.alfresco.web.ui.common.tag.HtmlComponentTag;
public class LinkValidationSummaryTag extends HtmlComponentTag
{
private String value;
+ private String initialCheckOnly;
/**
* @see javax.faces.webapp.UIComponentTag#getComponentType()
@@ -61,6 +62,7 @@ public class LinkValidationSummaryTag extends HtmlComponentTag
super.setProperties(component);
setStringProperty(component, "value", this.value);
+ setBooleanProperty(component, "initialCheckOnly", this.initialCheckOnly);
}
/**
@@ -70,6 +72,7 @@ public class LinkValidationSummaryTag extends HtmlComponentTag
{
super.release();
this.value = null;
+ this.initialCheckOnly = null;
}
/**
@@ -79,4 +82,12 @@ public class LinkValidationSummaryTag extends HtmlComponentTag
{
this.value = value;
}
+
+ /**
+ * @param initialCheckOnly true will make the component only show the initial check summary info
+ */
+ public void setInitialCheckOnly(String initialCheckOnly)
+ {
+ this.initialCheckOnly = initialCheckOnly;
+ }
}
diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml
index 05af4501fb..660f1ffc2e 100644
--- a/source/web/WEB-INF/faces-config-beans.xml
+++ b/source/web/WEB-INF/faces-config-beans.xml
@@ -2136,6 +2136,59 @@
#{AVMBrowseBean}
+
+
+
+ The bean that backs up the Verify Broken Links Task Dialog
+
+ ManageVerifyBrokenLinksTaskDialog
+ org.alfresco.web.bean.wcm.ManageVerifyBrokenLinksTaskDialog
+ session
+
+ nodeService
+ #{NodeService}
+
+
+ fileFolderService
+ #{FileFolderService}
+
+
+ searchService
+ #{SearchService}
+
+
+ navigator
+ #{NavigationBean}
+
+
+ browseBean
+ #{BrowseBean}
+
+
+ dictionaryService
+ #{DictionaryService}
+
+
+ namespaceService
+ #{NamespaceService}
+
+
+ workflowService
+ #{WorkflowService}
+
+
+ avmService
+ #{AVMService}
+
+
+ avmSyncService
+ #{AVMSyncService}
+
+
+ avmBrowseBean
+ #{AVMBrowseBean}
+
+
diff --git a/source/web/WEB-INF/wcm.tld b/source/web/WEB-INF/wcm.tld
index 2cc1f7e6aa..dea1412e87 100644
--- a/source/web/WEB-INF/wcm.tld
+++ b/source/web/WEB-INF/wcm.tld
@@ -302,6 +302,13 @@
The link validation state object holding the report data
+
+ initialCheckOnly
+ false
+ true
+ Only shows the initial check summary if set to true, false by default
+
+
id
false
diff --git a/source/web/jsp/wcm/manage-broken-links-task-dialog.jsp b/source/web/jsp/wcm/manage-broken-links-task-dialog.jsp
new file mode 100644
index 0000000000..3f51349b7b
--- /dev/null
+++ b/source/web/jsp/wcm/manage-broken-links-task-dialog.jsp
@@ -0,0 +1,185 @@
+<%--
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+--%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
+<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
+<%@ taglib uri="/WEB-INF/wcm.tld" prefix="w" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%-- Name column --%>
+
+
+
+
+
+
+
+
+
+
+
+ <%-- Description column --%>
+
+
+
+
+
+
+
+ <%-- Path column --%>
+
+
+
+
+
+
+
+ <%-- Created Date column --%>
+
+
+
+
+
+
+
+
+
+ <%-- Modified Date column --%>
+
+
+
+
+
+
+
+
+
+ <%-- Expiration Date column --%>
+
+
+
+
+
+
+
+
+
+ <%-- Actions column --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/web/jsp/wcm/submit-dialog.jsp b/source/web/jsp/wcm/submit-dialog.jsp
index 608fa3b733..1f7904a8dd 100644
--- a/source/web/jsp/wcm/submit-dialog.jsp
+++ b/source/web/jsp/wcm/submit-dialog.jsp
@@ -79,6 +79,15 @@
onkeyup="javascript:checkButtonState();" />
+<%--
+
+
+
+
+
+
+--%>
+