mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Partial first cut of initial version of links management UI
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5917 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -41,6 +41,7 @@ import javax.faces.event.ActionEvent;
|
||||
import javax.faces.model.SelectItem;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.linkvalidation.HrefValidationProgress;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.avm.actions.AVMRevertStoreAction;
|
||||
@@ -147,6 +148,12 @@ public class AVMBrowseBean implements IContextListener
|
||||
/** List of expired paths to submit */
|
||||
private List<AVMNodeDescriptor> expiredNodes = Collections.<AVMNodeDescriptor>emptyList();
|
||||
|
||||
/** Object used by link validation service to monitor the status of a link check */
|
||||
private HrefValidationProgress linkValidationMonitor;
|
||||
|
||||
/** Link validation state instance used by link validation dialogs */
|
||||
private LinkValidationState linkValidationState;
|
||||
|
||||
/* component references */
|
||||
private UIRichList foldersRichList;
|
||||
private UIRichList filesRichList;
|
||||
@@ -456,6 +463,38 @@ public class AVMBrowseBean implements IContextListener
|
||||
{
|
||||
this.deploymentMonitorIds = deploymentMonitorIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the link validation monitor instance
|
||||
*/
|
||||
public HrefValidationProgress getLinkValidationMonitor()
|
||||
{
|
||||
return this.linkValidationMonitor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param monitor The link validation monitor instance to use
|
||||
*/
|
||||
public void setLinkValidationMonitor(HrefValidationProgress monitor)
|
||||
{
|
||||
this.linkValidationMonitor = monitor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the link validation state instance
|
||||
*/
|
||||
public LinkValidationState getLinkValidationState()
|
||||
{
|
||||
return this.linkValidationState;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param monitor The link validation state instance to use
|
||||
*/
|
||||
public void setLinkValidationState(LinkValidationState state)
|
||||
{
|
||||
this.linkValidationState = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of expired nodes. Used by the submit dialog to retrieve
|
||||
|
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.context.ResponseWriter;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Bean used by the AJAX callback from the RunLinkValidationDialog.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationProgressBean
|
||||
{
|
||||
private AVMBrowseBean avmBrowseBean;
|
||||
|
||||
private static Log logger = LogFactory.getLog(LinkValidationProgressBean.class);
|
||||
|
||||
public void getStatus() throws IOException
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
ResponseWriter out = context.getResponseWriter();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Retrieving progress status for link validation check...");
|
||||
|
||||
StringBuilder xml = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
|
||||
xml.append("<link-validation-progress finished=\"");
|
||||
xml.append(this.avmBrowseBean.getLinkValidationMonitor().isDone());
|
||||
xml.append("\" file-count=\"");
|
||||
xml.append(this.avmBrowseBean.getLinkValidationMonitor().getFileUpdateCount());
|
||||
xml.append("\" link-count=\"");
|
||||
xml.append(this.avmBrowseBean.getLinkValidationMonitor().getUrlUpdateCount());
|
||||
xml.append("\"></link-validation-progress>");
|
||||
|
||||
// send the generated XML back to the callee
|
||||
out.write(xml.toString());
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("returning XML: " + xml.toString());
|
||||
}
|
||||
|
||||
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
|
||||
{
|
||||
this.avmBrowseBean = avmBrowseBean;
|
||||
}
|
||||
}
|
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Implementation of the link validation report dialog.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationReportDialog extends BaseDialogBean
|
||||
{
|
||||
protected AVMBrowseBean avmBrowseBean;
|
||||
protected AVMService avmService;
|
||||
protected ActionService actionService;
|
||||
|
||||
private String store;
|
||||
|
||||
private static final Log logger = LogFactory.getLog(LinkValidationReportDialog.class);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dialog implementation
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
// setup context for dialog
|
||||
store = parameters.get("store");
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Showing link validation report for store '" + store + "'");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Re-running link validation report for store '" + store + "'");
|
||||
|
||||
Map<String, String> params = new HashMap<String, String>(1);
|
||||
params.put("store", this.store);
|
||||
params.put("rerun", "true");
|
||||
Application.getDialogManager().setupParameters(params);
|
||||
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
||||
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
||||
"dialog:runLinkValidation";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "rerun_report");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled()
|
||||
{
|
||||
return (this.avmBrowseBean.getLinkValidationState().getNumberBrokenLinks() == 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCancelButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "close");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultCancelOutcome()
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
||||
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
||||
"browseWebsite";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean getters and setters
|
||||
|
||||
/**
|
||||
* @param avmBrowseBean The AVM BrowseBean to set
|
||||
*/
|
||||
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
|
||||
{
|
||||
this.avmBrowseBean = avmBrowseBean;
|
||||
}
|
||||
|
||||
public void setAvmService(AVMService avmService)
|
||||
{
|
||||
this.avmService = avmService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param actionService The actionService to set.
|
||||
*/
|
||||
public void setActionService(ActionService actionService)
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
}
|
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.linkvalidation.HrefValidationProgress;
|
||||
import org.alfresco.linkvalidation.LinkValidationAction;
|
||||
import org.alfresco.linkvalidation.LinkValidationReport;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.sandbox.SandboxConstants;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Implementation of the run link validation dialog.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationRunDialog extends BaseDialogBean
|
||||
{
|
||||
protected AVMBrowseBean avmBrowseBean;
|
||||
protected AVMService avmService;
|
||||
protected ActionService actionService;
|
||||
|
||||
private String store;
|
||||
private NodeRef storeRef;
|
||||
private boolean rerun = false;
|
||||
|
||||
private static final Log logger = LogFactory.getLog(LinkValidationRunDialog.class);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dialog implementation
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
// TODO: determine whether the virtualisation server is running, if it's not
|
||||
// we need to throw an exception to reflect that
|
||||
|
||||
// setup context for dialog
|
||||
store = parameters.get("store");
|
||||
|
||||
String storePath = this.store + ":/";
|
||||
this.storeRef = AVMNodeConverter.ToNodeRef(-1, storePath);
|
||||
|
||||
this.rerun = false;
|
||||
String rerunParam = parameters.get("rerun");
|
||||
if (rerunParam != null && rerunParam.equals("true"))
|
||||
{
|
||||
this.rerun = true;
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
if (this.rerun)
|
||||
logger.debug("Starting re-run link validation check for store '" + store + "'");
|
||||
else
|
||||
logger.debug("Starting initial link validation check for store '" + store + "'");
|
||||
}
|
||||
|
||||
// create context required to run and monitor the link check
|
||||
HrefValidationProgress monitor = new HrefValidationProgress();
|
||||
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
|
||||
args.put(LinkValidationAction.PARAM_MONITOR, monitor);
|
||||
this.avmBrowseBean.setLinkValidationMonitor(monitor);
|
||||
|
||||
// create and execute the action in the background
|
||||
Action action = this.actionService.createAction(LinkValidationAction.NAME, args);
|
||||
this.actionService.executeAction(action, this.storeRef, false, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
return outcome;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Event handlers
|
||||
|
||||
public String linkCheckCompleted()
|
||||
{
|
||||
String outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
|
||||
// the link validation report should be stored as a store property
|
||||
// on the store the link check was run on, retrieve it and see if
|
||||
// the link check was successful.
|
||||
|
||||
PropertyValue val = this.avmService.getStoreProperty(this.store,
|
||||
SandboxConstants.PROP_LINK_VALIDATION_REPORT);
|
||||
if (val != null)
|
||||
{
|
||||
LinkValidationReport report = (LinkValidationReport)val.getSerializableValue();
|
||||
if (report != null)
|
||||
{
|
||||
if (report.wasSuccessful())
|
||||
{
|
||||
// setup the context required by the reporting components to display the results
|
||||
if (this.rerun)
|
||||
{
|
||||
this.avmBrowseBean.getLinkValidationState().updateState(report);
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkValidationState state = new LinkValidationState(this.store, report);
|
||||
this.avmBrowseBean.setLinkValidationState(state);
|
||||
}
|
||||
|
||||
Map<String, String> params = new HashMap<String, String>(1);
|
||||
params.put("store", this.store);
|
||||
Application.getDialogManager().setupParameters(params);
|
||||
|
||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
||||
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
||||
"dialog:linkValidationReport";
|
||||
}
|
||||
else
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
String errorMsg = Application.getMessage(context, "link_validation_unknown_error");
|
||||
Throwable cause = report.getError();
|
||||
if (cause != null)
|
||||
{
|
||||
errorMsg = Application.getMessage(context, "link_validation_error") + ": " +
|
||||
cause.getMessage();
|
||||
}
|
||||
|
||||
Utils.addErrorMessage(errorMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean getters and setters
|
||||
|
||||
/**
|
||||
* @param avmBrowseBean The AVM BrowseBean to set
|
||||
*/
|
||||
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
|
||||
{
|
||||
this.avmBrowseBean = avmBrowseBean;
|
||||
}
|
||||
|
||||
public void setAvmService(AVMService avmService)
|
||||
{
|
||||
this.avmService = avmService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param actionService The actionService to set.
|
||||
*/
|
||||
public void setActionService(ActionService actionService)
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
}
|
379
source/java/org/alfresco/web/bean/wcm/LinkValidationState.java
Normal file
379
source/java/org/alfresco/web/bean/wcm/LinkValidationState.java
Normal file
@@ -0,0 +1,379 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.linkvalidation.LinkValidationReport;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Object used to retrieve and store the state of a link validaton process.
|
||||
* The object is given an initial link validation report object (the result
|
||||
* of a LinkValidationService service call) which is used by components
|
||||
* to display the result of the links check.
|
||||
* <p>
|
||||
* Further reports can then subsequently be given to this object at which
|
||||
* point a difference is calculated i.e. which links (if any) have been
|
||||
* fixed. This allows components to display the progress of link fixing.
|
||||
* </p>
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationState
|
||||
{
|
||||
private String store;
|
||||
private boolean checkBeenReRun = false;
|
||||
|
||||
private int noFilesCheckedStart = 0;
|
||||
private int noFilesCheckedLast = 0;
|
||||
|
||||
private int noLinksCheckedStart = 0;
|
||||
private int noLinksCheckedLast = 0;
|
||||
|
||||
private int noBrokenFilesStart = 0;
|
||||
private int noBrokenFilesLast = 0;
|
||||
|
||||
private int noBrokenLinksStart = 0;
|
||||
private int noBrokenLinksLast = 0;
|
||||
|
||||
private int noFixedFiles = 0;
|
||||
private int noFixedLinks = 0;
|
||||
|
||||
private List<String> brokenStaticFilesStart;
|
||||
private List<String> brokenFormsStart;
|
||||
|
||||
private List<String> brokenStaticFilesLast;
|
||||
private List<String> brokenFormsLast;
|
||||
|
||||
private List<String> fixedStaticFiles;
|
||||
private List<String> fixedForms;
|
||||
|
||||
private List<String> fixedStaticFilesLast;
|
||||
private List<String> fixedFormsLast;
|
||||
|
||||
private Map<String, List<String>> brokenLinksByFile;
|
||||
private Map<String, List<String>> brokenLinksByForm;
|
||||
|
||||
private static Log logger = LogFactory.getLog(LinkValidationState.class);
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
public LinkValidationState(String store, LinkValidationReport initialReport)
|
||||
{
|
||||
this.store = store;
|
||||
|
||||
processReport(initialReport, false);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Getters
|
||||
|
||||
/**
|
||||
* @return The number of files checked by the initial link check
|
||||
*/
|
||||
public int getInitialNumberFilesChecked()
|
||||
{
|
||||
return this.noFilesCheckedStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of links checked by the initial link check
|
||||
*/
|
||||
public int getInitialNumberLinksChecked()
|
||||
{
|
||||
return this.noLinksCheckedStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of broken files found by the initial link check
|
||||
*/
|
||||
public int getInitialNumberBrokenFiles()
|
||||
{
|
||||
return this.noBrokenFilesStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of broken links found by the initial link check
|
||||
*/
|
||||
public int getInitialNumberBrokenLinks()
|
||||
{
|
||||
return this.noBrokenLinksStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of files checked by the latest link check
|
||||
*/
|
||||
public int getNumberFilesChecked()
|
||||
{
|
||||
return this.noFilesCheckedLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of links checked by the latest link check
|
||||
*/
|
||||
public int getNumberLinksChecked()
|
||||
{
|
||||
return this.noLinksCheckedLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of broken files found by the latest link check
|
||||
*/
|
||||
public int getNumberBrokenFiles()
|
||||
{
|
||||
return this.noBrokenFilesLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of broken links found by the latest link check
|
||||
*/
|
||||
public int getNumberBrokenLinks()
|
||||
{
|
||||
return this.noBrokenLinksLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of files fixed since the initial link check
|
||||
*/
|
||||
public int getNumberFixedFiles()
|
||||
{
|
||||
return this.noFixedFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of links fixed since the initial link check
|
||||
*/
|
||||
public int getNumberFixedLinks()
|
||||
{
|
||||
return this.noFixedLinks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A list of paths to non-generated files that contain broken links
|
||||
*/
|
||||
public List<String> getStaticFilesWithBrokenLinks()
|
||||
{
|
||||
return this.brokenStaticFilesLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A list of forms that have generated files containing broken links
|
||||
*/
|
||||
public List<String> getFormsWithBrokenLinks()
|
||||
{
|
||||
return this.brokenFormsLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A list of all files found (including those generated by forms) that
|
||||
* contain broken links
|
||||
*/
|
||||
public List<String> getAllFilesWithBrokenLinks()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param form The name of a form to find broken files for
|
||||
* @return The list of broken files generated by the given form
|
||||
*/
|
||||
public List<String> getFilesBrokenByForm(String form)
|
||||
{
|
||||
return this.brokenLinksByForm.get(form);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param file The path to a file with broken links
|
||||
* @return The list of broken links within the given file
|
||||
*/
|
||||
public List<String> getBrokenLinksForFile(String file)
|
||||
{
|
||||
return this.brokenLinksByFile.get(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The list of non-generated files that have been fixed since the
|
||||
* initial link check
|
||||
*/
|
||||
public List<String> getFixedStaticFiles()
|
||||
{
|
||||
return this.fixedStaticFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The list of forms that have been fixed since the initial link check
|
||||
*/
|
||||
public List<String> getFixedForms()
|
||||
{
|
||||
return this.fixedForms;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The list of non-generated files fixed in the last run of the link check
|
||||
*/
|
||||
public List<String> getStaticFilesFixedInLastRun()
|
||||
{
|
||||
return this.fixedStaticFilesLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The list of forms fixed in the last run of the link check
|
||||
*/
|
||||
public List<String> getFormsFixedInLastRun()
|
||||
{
|
||||
return this.fixedFormsLast;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
/**
|
||||
* Determines whether the link validation check has been re-run since
|
||||
* the intial check
|
||||
*
|
||||
* @return true if the link check has been re-run, false otherwise
|
||||
*/
|
||||
public boolean hasCheckBeenReRun()
|
||||
{
|
||||
return this.checkBeenReRun;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the link validation state with the result from a re-run of
|
||||
* the link check
|
||||
*
|
||||
* @param newReport The report to compare the intial report with
|
||||
*/
|
||||
public void updateState(LinkValidationReport newReport)
|
||||
{
|
||||
// process the new report
|
||||
processReport(newReport, true);
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder buffer = new StringBuilder(super.toString());
|
||||
buffer.append(" (store=").append(this.store).append(")");
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Private Helpers
|
||||
|
||||
public void processReport(LinkValidationReport report, boolean updatedReport)
|
||||
{
|
||||
this.checkBeenReRun = updatedReport;
|
||||
|
||||
if (updatedReport == false)
|
||||
{
|
||||
// setup initial counts
|
||||
this.noBrokenFilesStart = report.getNumberBrokenFiles();
|
||||
this.noBrokenLinksStart = report.getNumberBrokenLinks();
|
||||
this.noFilesCheckedStart = report.getNumberFilesChecked();
|
||||
this.noLinksCheckedStart = report.getNumberLinksChecked();
|
||||
this.noBrokenFilesLast = report.getNumberBrokenFiles();
|
||||
this.noBrokenLinksLast = report.getNumberBrokenLinks();
|
||||
this.noFilesCheckedLast = report.getNumberFilesChecked();
|
||||
this.noLinksCheckedLast = report.getNumberLinksChecked();
|
||||
|
||||
// setup initial lists
|
||||
this.brokenStaticFilesStart = report.getFilesWithBrokenLinks();
|
||||
this.brokenFormsStart = Collections.emptyList();
|
||||
this.brokenStaticFilesLast = report.getFilesWithBrokenLinks();
|
||||
this.brokenFormsLast = Collections.emptyList();
|
||||
|
||||
this.fixedStaticFiles = Collections.emptyList();
|
||||
this.fixedForms = Collections.emptyList();
|
||||
this.fixedFormsLast = Collections.emptyList();
|
||||
this.fixedStaticFiles = Collections.emptyList();
|
||||
this.fixedStaticFilesLast = Collections.emptyList();
|
||||
|
||||
// setup initial maps
|
||||
this.brokenLinksByFile = new HashMap<String, List<String>>();
|
||||
this.brokenLinksByForm = Collections.emptyMap();
|
||||
|
||||
// populate initial maps
|
||||
for (String file : this.brokenStaticFilesLast)
|
||||
{
|
||||
this.brokenLinksByFile.put(file, report.getBrokenLinksForFile(file));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// update the relevant counts
|
||||
this.noBrokenFilesLast = report.getNumberBrokenFiles();
|
||||
this.noBrokenLinksLast = report.getNumberBrokenLinks();
|
||||
this.noFilesCheckedLast = report.getNumberFilesChecked();
|
||||
this.noLinksCheckedLast = report.getNumberLinksChecked();
|
||||
|
||||
this.noFixedFiles = this.noBrokenFilesStart - this.noBrokenFilesLast;
|
||||
this.noFixedLinks = this.noBrokenLinksStart - this.noBrokenLinksLast;
|
||||
|
||||
if (this.noFixedFiles < 0)
|
||||
{
|
||||
this.noFixedFiles = 0;
|
||||
}
|
||||
if (this.noFixedLinks < 0)
|
||||
{
|
||||
this.noFixedLinks = 0;
|
||||
}
|
||||
|
||||
// go through the list of files still broken and find which ones
|
||||
// were fixed in the last re-run of the report
|
||||
this.brokenStaticFilesLast = report.getFilesWithBrokenLinks();
|
||||
this.fixedStaticFiles = new ArrayList<String>();
|
||||
this.fixedStaticFilesLast = new ArrayList<String>();
|
||||
for (String file : this.brokenStaticFilesStart)
|
||||
{
|
||||
if (this.brokenStaticFilesLast.contains(file) == false)
|
||||
{
|
||||
this.fixedStaticFilesLast.add(file);
|
||||
this.fixedStaticFiles.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
// update the broken files info
|
||||
this.brokenLinksByFile.clear();
|
||||
for (String file : this.brokenStaticFilesLast)
|
||||
{
|
||||
this.brokenLinksByFile.put(file, report.getBrokenLinksForFile(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.el.ValueBinding;
|
||||
|
||||
import org.alfresco.web.bean.wcm.LinkValidationState;
|
||||
import org.alfresco.web.ui.common.component.SelfRenderingComponent;
|
||||
|
||||
/**
|
||||
* Base class for all the link validation report JSF components.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public abstract class AbstractLinkValidationReportComponent extends SelfRenderingComponent
|
||||
{
|
||||
protected LinkValidationState state;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Component implementation
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void restoreState(FacesContext context, Object state)
|
||||
{
|
||||
Object values[] = (Object[])state;
|
||||
// standard component attributes are restored by the super class
|
||||
super.restoreState(context, values[0]);
|
||||
this.state = (LinkValidationState)values[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object saveState(FacesContext context)
|
||||
{
|
||||
Object values[] = new Object[2];
|
||||
// standard component attributes are saved by the super class
|
||||
values[0] = super.saveState(context);
|
||||
values[1] = this.state;
|
||||
return values;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Strongly typed component property accessors
|
||||
|
||||
/**
|
||||
* @return The LinkValidationState object holding the report information
|
||||
*/
|
||||
public LinkValidationState getValue()
|
||||
{
|
||||
ValueBinding vb = getValueBinding("value");
|
||||
if (vb != null)
|
||||
{
|
||||
this.state = (LinkValidationState)vb.getValue(getFacesContext());
|
||||
}
|
||||
|
||||
return this.state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value The LinkValidationState object to get the summary info from
|
||||
*/
|
||||
public void setValue(LinkValidationState value)
|
||||
{
|
||||
this.state = value;
|
||||
}
|
||||
}
|
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.context.ResponseWriter;
|
||||
|
||||
import org.alfresco.config.JNDIConstants;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wcm.LinkValidationState;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* JSF component that shows the broken file information for a link
|
||||
* validation report.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class UILinkValidationBrokenFiles extends AbstractLinkValidationReportComponent
|
||||
{
|
||||
private boolean oddRow = true;
|
||||
|
||||
private static Log logger = LogFactory.getLog(UILinkValidationBrokenFiles.class);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Component implementation
|
||||
|
||||
@Override
|
||||
public String getFamily()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationBrokenFiles";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void encodeBegin(FacesContext context) throws IOException
|
||||
{
|
||||
if (isRendered() == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// get the link validation state object to get the data from
|
||||
ResponseWriter out = context.getResponseWriter();
|
||||
LinkValidationState linkState = getValue();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Rendering broken files from state object: " + linkState);
|
||||
|
||||
// render the list of broken files and their contained links
|
||||
out.write("<div class='linkValidationBrokenFilesPanel'><div class='linkValidationReportTitle'>");
|
||||
out.write(Application.getMessage(context, "files_with_broken_links"));
|
||||
out.write("</div><div class='linkValidationList'><table width='100%' cellpadding='0' cellspacing='0'>");
|
||||
|
||||
List<String> brokenFiles = linkState.getStaticFilesWithBrokenLinks();
|
||||
for (String file : brokenFiles)
|
||||
{
|
||||
renderBrokenFile(context, out, file, linkState);
|
||||
}
|
||||
|
||||
out.write("</table></div></div>");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
||||
private void renderBrokenFile(FacesContext context, ResponseWriter out,
|
||||
String file, LinkValidationState linkState) throws IOException
|
||||
{
|
||||
// gather the data to show for the file
|
||||
String fileName = file;
|
||||
String filePath = file;
|
||||
|
||||
int idx = file.lastIndexOf("/");
|
||||
if (idx != -1)
|
||||
{
|
||||
fileName = file.substring(idx+1);
|
||||
|
||||
int appbaseIdx = file.indexOf(JNDIConstants.DIR_DEFAULT_APPBASE);
|
||||
if (appbaseIdx != -1)
|
||||
{
|
||||
filePath = file.substring(appbaseIdx+JNDIConstants.DIR_DEFAULT_APPBASE.length(), idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
filePath = file.substring(0, idx);
|
||||
}
|
||||
}
|
||||
|
||||
// build the list of broken links for the file
|
||||
List<String> brokenLinks = linkState.getBrokenLinksForFile(file);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
boolean first = true;
|
||||
for (String link : brokenLinks)
|
||||
{
|
||||
if (first == false)
|
||||
{
|
||||
builder.append(", ");
|
||||
}
|
||||
else
|
||||
{
|
||||
first = false;
|
||||
}
|
||||
|
||||
builder.append(parseBrokenLink(link));
|
||||
}
|
||||
String brokenLinksList = builder.toString();
|
||||
|
||||
// render the row with the appropriate background style
|
||||
out.write("<tr class='");
|
||||
|
||||
if (this.oddRow)
|
||||
{
|
||||
out.write("linkValidationListOddRow");
|
||||
}
|
||||
else
|
||||
{
|
||||
out.write("linkValidationListEvenRow");
|
||||
}
|
||||
|
||||
// toggle the type of row
|
||||
this.oddRow = !this.oddRow;
|
||||
|
||||
// render the data
|
||||
out.write("'><td valign='top'><img src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/images/filetypes32/html.gif' style='padding: 5px;' /></td>");
|
||||
out.write("<td width='100%'><div style='padding: 5px;'><div style='font-weight: bold;'>");
|
||||
out.write(fileName);
|
||||
out.write("</div><div style='padding-top: 2px;'>");
|
||||
out.write(filePath);
|
||||
out.write("</div><div style='padding-top: 4px; color: #aaa;'>");
|
||||
out.write(Application.getMessage(context, "broken_links"));
|
||||
out.write(":</div><div style='padding-top: 2px;'>");
|
||||
out.write(brokenLinksList);
|
||||
out.write("</div></div></td><td align='right' valign='top'>");
|
||||
out.write("<div style='white-space: nowrap; padding: 5px; padding-right: 10px;'>");
|
||||
out.write(" ");
|
||||
// out.write("<img src='/alfresco/images/icons/edit_icon.gif' /> ");
|
||||
// out.write("<img src='/alfresco/images/icons/update.gif' /> ");
|
||||
// out.write("<img src='/alfresco/images/icons/revert.gif' /> ");
|
||||
// out.write("<img src='/alfresco/images/icons/preview_website.gif' /> ");
|
||||
out.write("</div></td></tr>");
|
||||
}
|
||||
|
||||
private String parseBrokenLink(String linkUrl)
|
||||
{
|
||||
String link = linkUrl;
|
||||
|
||||
if (linkUrl.startsWith("http://") && linkUrl.indexOf("www--sandbox") != -1)
|
||||
{
|
||||
// remove the virtualisation server host name
|
||||
int idx = linkUrl.indexOf("/", 7);
|
||||
if (idx != -1)
|
||||
{
|
||||
link = linkUrl.substring(idx);
|
||||
}
|
||||
}
|
||||
|
||||
return link;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.context.ResponseWriter;
|
||||
|
||||
import org.alfresco.config.JNDIConstants;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wcm.LinkValidationState;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* JSF component that shows the fixed files for a link validation report.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class UILinkValidationFixedFiles extends AbstractLinkValidationReportComponent
|
||||
{
|
||||
private boolean oddRow = true;
|
||||
|
||||
private static Log logger = LogFactory.getLog(UILinkValidationFixedFiles.class);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Component implementation
|
||||
|
||||
@Override
|
||||
public String getFamily()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationFixedFiles";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void encodeBegin(FacesContext context) throws IOException
|
||||
{
|
||||
if (isRendered() == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// get the link validation state object to get the data from
|
||||
ResponseWriter out = context.getResponseWriter();
|
||||
LinkValidationState linkState = getValue();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Rendering fixed files from state object: " + linkState);
|
||||
|
||||
// render the list of broken files and their contained links
|
||||
out.write("<div class='linkValidationFixedFilesPanel'><div class='linkValidationReportTitle'>");
|
||||
out.write(Application.getMessage(context, "fixed_files"));
|
||||
out.write("</div><div class='linkValidationList'><table width='100%' cellpadding='0' cellspacing='0'>");
|
||||
|
||||
List<String> fixedFiles = linkState.getFixedStaticFiles();
|
||||
for (String file : fixedFiles)
|
||||
{
|
||||
renderFixedFile(context, out, file, linkState);
|
||||
}
|
||||
|
||||
out.write("</table></div></div>");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
||||
private void renderFixedFile(FacesContext context, ResponseWriter out,
|
||||
String file, LinkValidationState linkState) throws IOException
|
||||
{
|
||||
// gather the data to show for the file
|
||||
String fileName = file;
|
||||
String filePath = file;
|
||||
|
||||
int idx = file.lastIndexOf("/");
|
||||
if (idx != -1)
|
||||
{
|
||||
fileName = file.substring(idx+1);
|
||||
|
||||
int appbaseIdx = file.indexOf(JNDIConstants.DIR_DEFAULT_APPBASE);
|
||||
if (appbaseIdx != -1)
|
||||
{
|
||||
filePath = file.substring(appbaseIdx+JNDIConstants.DIR_DEFAULT_APPBASE.length(), idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
filePath = file.substring(0, idx);
|
||||
}
|
||||
}
|
||||
|
||||
// render the row with the appropriate background style
|
||||
out.write("<tr class='");
|
||||
|
||||
if (this.oddRow)
|
||||
{
|
||||
out.write("linkValidationListOddRow");
|
||||
}
|
||||
else
|
||||
{
|
||||
out.write("linkValidationListEvenRow");
|
||||
}
|
||||
|
||||
// toggle the type of row
|
||||
this.oddRow = !this.oddRow;
|
||||
|
||||
// render the data
|
||||
out.write("'><td valign='top'><img src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/images/filetypes32/html.gif' style='padding: 5px;' /></td>");
|
||||
out.write("<td width='100%'><div style='padding: 5px;'><div style='font-weight: bold;'>");
|
||||
out.write(fileName);
|
||||
out.write("</div><div style='padding-top: 2px;'>");
|
||||
out.write(filePath);
|
||||
out.write("</div></div></td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* 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"
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.context.ResponseWriter;
|
||||
import javax.faces.el.MethodBinding;
|
||||
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.SelfRenderingComponent;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
import org.alfresco.web.ui.repo.component.UIActions;
|
||||
|
||||
/**
|
||||
* JSF component that displays information about the workflows a node is involved in.
|
||||
* <p>
|
||||
* The node to show workflow information on.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class UILinkValidationProgress extends SelfRenderingComponent
|
||||
{
|
||||
// ------------------------------------------------------------------------------
|
||||
// Component Impl
|
||||
|
||||
@Override
|
||||
public String getFamily()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationProgress";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreState(FacesContext context, Object state)
|
||||
{
|
||||
Object values[] = (Object[])state;
|
||||
// standard component attributes are restored by the super class
|
||||
super.restoreState(context, values[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object saveState(FacesContext context)
|
||||
{
|
||||
Object values[] = new Object[1];
|
||||
// standard component attributes are saved by the super class
|
||||
values[0] = super.saveState(context);
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void encodeBegin(FacesContext context) throws IOException
|
||||
{
|
||||
if (!isRendered()) return;
|
||||
|
||||
ResponseWriter out = context.getResponseWriter();
|
||||
|
||||
// render the hidden action used to close the dialog
|
||||
UIActionLink action = findOrCreateHiddenAction(context);
|
||||
Utils.encodeRecursive(context, action);
|
||||
|
||||
// output the script
|
||||
out.write("<script type='text/javascript' src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/scripts/ajax/link-validation-progress.js'></script>\n");
|
||||
|
||||
// output the HTML
|
||||
out.write("<div class='linkValidationProgressPanel'><table border='0' cellspacing='4' cellpadding='2'>");
|
||||
out.write("<tr><td valign='top'><img src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/images/icons/ajax_anim.gif' /></td><td>");
|
||||
out.write("<div class='linkValidationProgressWait'>");
|
||||
out.write(Application.getMessage(context, "checking_links_progress"));
|
||||
out.write("</div><div class='linkValidationProgressStatus'>");
|
||||
out.write(Application.getMessage(context, "checking_links_status"));
|
||||
out.write("</div></td></tr></table></div>\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encodeEnd(FacesContext context) throws IOException
|
||||
{
|
||||
if (!isRendered()) return;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helper methods
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private UIActionLink findOrCreateHiddenAction(FacesContext fc)
|
||||
{
|
||||
UIActionLink action = null;
|
||||
String actionId = "validation-callback-link";
|
||||
|
||||
for (UIComponent component : (List<UIComponent>)getChildren())
|
||||
{
|
||||
if (actionId.equals(component.getId()))
|
||||
{
|
||||
action = (UIActionLink)component;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (action == null)
|
||||
{
|
||||
javax.faces.application.Application facesApp = fc.getApplication();
|
||||
action = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
|
||||
|
||||
action.setRendererType(UIActions.RENDERER_ACTIONLINK);
|
||||
action.setId(actionId);
|
||||
action.setValue("Callback");
|
||||
action.setShowLink(false);
|
||||
MethodBinding callback = facesApp.createMethodBinding(
|
||||
"#{DialogManager.bean.linkCheckCompleted}", new Class[] {});
|
||||
action.setAction(callback);
|
||||
action.getAttributes().put("style", "display:none;");
|
||||
|
||||
this.getChildren().add(action);
|
||||
}
|
||||
|
||||
return action;
|
||||
}
|
||||
}
|
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.context.ResponseWriter;
|
||||
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wcm.LinkValidationState;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* JSF component that shows the summary information for a link
|
||||
* validation report.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class UILinkValidationSummary extends AbstractLinkValidationReportComponent
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(UILinkValidationSummary.class);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Component implementation
|
||||
|
||||
@Override
|
||||
public String getFamily()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationSummary";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void encodeBegin(FacesContext context) throws IOException
|
||||
{
|
||||
if (isRendered() == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// get the link validation state object to get the data from
|
||||
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);
|
||||
String pattern = bundle.getString("files_links_checked");
|
||||
String initialCheckSummary = MessageFormat.format(pattern,
|
||||
new Object[] {linkState.getInitialNumberFilesChecked(), linkState.getInitialNumberLinksChecked()});
|
||||
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()});
|
||||
|
||||
// render the summary area
|
||||
out.write("<div class='linkValidationSummaryPanel'><div class='linkValidationReportTitle'>");
|
||||
out.write(bundle.getString("summary"));
|
||||
out.write("</div><table cellpadding='0' cellspacing='0'><tr>");
|
||||
out.write("<td valign='top' class='linkValidationReportSubTitle'>");
|
||||
out.write(bundle.getString("initial_check"));
|
||||
out.write(":</td><td><div style='margin-bottom: 6px;'>");
|
||||
out.write(initialCheckSummary);
|
||||
out.write("</div><div style='margin-bottom: 14px;'><img src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/images/icons/warning.gif'' style='vertical-align: -4px; padding-right: 4px;'/>");
|
||||
out.write(initialBrokenSummary);
|
||||
out.write("</div></td></tr>");
|
||||
out.write("<tr><td class='linkValidationReportSubTitle'>");
|
||||
out.write(bundle.getString("current_status"));
|
||||
out.write(":</td><td><div><img src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/images/icons/warning.gif' style='vertical-align: -4px; padding-right: 4px;' >");
|
||||
out.write(stillBroken);
|
||||
out.write("<img src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/images/icons/fixed_link.gif' style='vertical-align: -4px; padding-left: 6px; padding-right: 4px;' >");
|
||||
out.write(linksFixed);
|
||||
out.write("</div></td></tr>");
|
||||
out.write("</table></div>");
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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"
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.tag;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
|
||||
import org.alfresco.web.ui.common.tag.HtmlComponentTag;
|
||||
|
||||
/**
|
||||
* Tag class for adding the UILinkValidationBrokenFiles component to a JSP page.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationBrokenFilesTag extends HtmlComponentTag
|
||||
{
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getComponentType()
|
||||
*/
|
||||
public String getComponentType()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationBrokenFiles";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getRendererType()
|
||||
*/
|
||||
public String getRendererType()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
|
||||
*/
|
||||
protected void setProperties(UIComponent component)
|
||||
{
|
||||
super.setProperties(component);
|
||||
|
||||
setStringProperty(component, "value", this.value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release()
|
||||
*/
|
||||
public void release()
|
||||
{
|
||||
super.release();
|
||||
this.value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value the value (the list of servers to deploy to)
|
||||
*/
|
||||
public void setValue(String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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"
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.tag;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
|
||||
import org.alfresco.web.ui.common.tag.HtmlComponentTag;
|
||||
|
||||
/**
|
||||
* Tag class for adding the UILinkValidationFixedFiles component to a JSP page.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationFixedFilesTag extends HtmlComponentTag
|
||||
{
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getComponentType()
|
||||
*/
|
||||
public String getComponentType()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationFixedFiles";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getRendererType()
|
||||
*/
|
||||
public String getRendererType()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
|
||||
*/
|
||||
protected void setProperties(UIComponent component)
|
||||
{
|
||||
super.setProperties(component);
|
||||
|
||||
setStringProperty(component, "value", this.value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release()
|
||||
*/
|
||||
public void release()
|
||||
{
|
||||
super.release();
|
||||
this.value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value the value (the list of servers to deploy to)
|
||||
*/
|
||||
public void setValue(String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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"
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.tag;
|
||||
|
||||
import org.alfresco.web.ui.common.tag.HtmlComponentTag;
|
||||
|
||||
/**
|
||||
* Tag class for adding the UILinkValidationProgress component to a JSP page.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationProgressTag extends HtmlComponentTag
|
||||
{
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getComponentType()
|
||||
*/
|
||||
public String getComponentType()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationProgress";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getRendererType()
|
||||
*/
|
||||
public String getRendererType()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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"
|
||||
*/
|
||||
package org.alfresco.web.ui.wcm.tag;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
|
||||
import org.alfresco.web.ui.common.tag.HtmlComponentTag;
|
||||
|
||||
/**
|
||||
* Tag class for adding the UILinkValidationSummary component to a JSP page.
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public class LinkValidationSummaryTag extends HtmlComponentTag
|
||||
{
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getComponentType()
|
||||
*/
|
||||
public String getComponentType()
|
||||
{
|
||||
return "org.alfresco.faces.LinkValidationSummary";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getRendererType()
|
||||
*/
|
||||
public String getRendererType()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
|
||||
*/
|
||||
protected void setProperties(UIComponent component)
|
||||
{
|
||||
super.setProperties(component);
|
||||
|
||||
setStringProperty(component, "value", this.value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release()
|
||||
*/
|
||||
public void release()
|
||||
{
|
||||
super.release();
|
||||
this.value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value the value (the list of servers to deploy to)
|
||||
*/
|
||||
public void setValue(String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user