mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Links management UI
- Made AJAX polling frequency configurable - Made connection and read timeout values configurable - Added panel around summary area - Removed use of shadowed panels for staging area and user sandboxes git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6061 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -335,11 +335,11 @@ public final class AVMUtil
|
||||
* </p>
|
||||
*
|
||||
* @return Number of seconds between each call to the server (in seconds).
|
||||
* The default is 5.
|
||||
* The default is 2.
|
||||
*/
|
||||
public static int getRemoteDeploymentPollingFrequency()
|
||||
{
|
||||
int pollFreq = 5;
|
||||
int pollFreq = 2;
|
||||
|
||||
ConfigElement deploymentConfig = getDeploymentConfig();
|
||||
if (deploymentConfig != null)
|
||||
@@ -443,6 +443,45 @@ public final class AVMUtil
|
||||
return delay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of seconds between each call back to the server to
|
||||
* obtain the latest status of a link validation check.
|
||||
* <p>
|
||||
* This value is read from the <wcm> config section in
|
||||
* web-client-config-wcm.xml
|
||||
* </p>
|
||||
*
|
||||
* @return Number of seconds between each call to the server (in seconds).
|
||||
* The default is 2.
|
||||
*/
|
||||
public static int getLinkValidationPollingFrequency()
|
||||
{
|
||||
int pollFreq = 2;
|
||||
|
||||
ConfigElement linkMngmtConfig = getLinksManagementConfig();
|
||||
if (linkMngmtConfig != null)
|
||||
{
|
||||
ConfigElement elem = linkMngmtConfig.getChild("progress-polling-frequency");
|
||||
if (elem != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
int value = Integer.parseInt(elem.getValue());
|
||||
if (value > 0)
|
||||
{
|
||||
pollFreq = value;
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
// do nothing, just use the default
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pollFreq;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the main staging store name for the specified store id.
|
||||
*
|
||||
@@ -969,6 +1008,21 @@ public final class AVMUtil
|
||||
return deploymentConfig;
|
||||
}
|
||||
|
||||
private static ConfigElement getLinksManagementConfig()
|
||||
{
|
||||
if (linksManagementConfig == null)
|
||||
{
|
||||
ConfigService cfgService = Application.getConfigService(FacesContext.getCurrentInstance());
|
||||
ConfigElement wcmCfg = cfgService.getGlobalConfig().getConfigElement("wcm");
|
||||
if (wcmCfg != null)
|
||||
{
|
||||
linksManagementConfig = wcmCfg.getChild("links-management");
|
||||
}
|
||||
}
|
||||
|
||||
return linksManagementConfig;
|
||||
}
|
||||
|
||||
// Component Separator.
|
||||
private static final String STORE_SEPARATOR = "--";
|
||||
|
||||
@@ -999,5 +1053,6 @@ public final class AVMUtil
|
||||
Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW +
|
||||
"/" + JNDIConstants.DIR_DEFAULT_APPBASE + ")(.*)");
|
||||
|
||||
private static ConfigElement deploymentConfig = null;
|
||||
private static ConfigElement deploymentConfig = null;
|
||||
private static ConfigElement linksManagementConfig = null;
|
||||
}
|
||||
|
@@ -33,6 +33,7 @@ import javax.faces.context.ResponseWriter;
|
||||
import javax.faces.el.MethodBinding;
|
||||
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.SelfRenderingComponent;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
@@ -85,7 +86,14 @@ public class UILinkValidationProgress extends SelfRenderingComponent
|
||||
UIActionLink action = findOrCreateHiddenAction(context);
|
||||
Utils.encodeRecursive(context, action);
|
||||
|
||||
// determine the polling frequency value
|
||||
int pollFreq = AVMUtil.getLinkValidationPollingFrequency();
|
||||
|
||||
// output the script
|
||||
out.write("<script type='text/javascript'>");
|
||||
out.write("Alfresco.linkMonitorPollFreq = ");
|
||||
out.write(Integer.toString(pollFreq));
|
||||
out.write(";</script>\n");
|
||||
out.write("<script type='text/javascript' src='");
|
||||
out.write(context.getExternalContext().getRequestContextPath());
|
||||
out.write("/scripts/ajax/link-validation-progress.js'></script>\n");
|
||||
|
@@ -38,6 +38,7 @@ import javax.faces.el.MethodBinding;
|
||||
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.wcm.LinkValidationState;
|
||||
import org.alfresco.web.ui.common.PanelGenerator;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -101,10 +102,16 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
|
||||
// get the action to update the current status
|
||||
UICommand updateStatusAction = aquireAction(context, "update_status_" + linkState.getStore());
|
||||
|
||||
// render the summary area
|
||||
out.write("<div class='linkValidationSummaryPanel'><div class='linkValidationReportTitle'>");
|
||||
|
||||
out.write("<div class='linkValidationSummaryPanel'>");
|
||||
|
||||
// render the summary area with a surrounding panel
|
||||
PanelGenerator.generatePanelStart(out, context.getExternalContext().getRequestContextPath(),
|
||||
"innerwhite", "white");
|
||||
|
||||
out.write("<div class='linkValidationReportTitle'>");
|
||||
out.write(bundle.getString("summary"));
|
||||
out.write("</div><table cellpadding='0' cellspacing='0'><tr>");
|
||||
out.write("</div><table cellpadding='0' cellspacing='0' style='margin-bottom: 6px;'><tr>");
|
||||
out.write("<td valign='top' class='linkValidationReportSubTitle'>");
|
||||
out.write(bundle.getString("initial_check"));
|
||||
out.write(":</td><td>");
|
||||
@@ -122,7 +129,13 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
|
||||
out.write(" ");
|
||||
Utils.encodeRecursive(context, updateStatusAction);
|
||||
out.write("</div></td></tr>");
|
||||
out.write("</table></div>");
|
||||
out.write("</table>");
|
||||
|
||||
// finish the surrounding panel
|
||||
PanelGenerator.generatePanelEnd(out, context.getExternalContext().getRequestContextPath(),
|
||||
"innerwhite");
|
||||
|
||||
out.write("</div>");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -344,7 +344,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
// for each user sandbox, generate an outer panel table
|
||||
PanelGenerator.generatePanelStart(out,
|
||||
context.getExternalContext().getRequestContextPath(),
|
||||
"white",
|
||||
"innerwhite",
|
||||
"white");
|
||||
|
||||
// components for the current username, preview, browse and modified items inner list
|
||||
@@ -481,7 +481,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
||||
// end the outer panel for this sandbox
|
||||
PanelGenerator.generatePanelEnd(out,
|
||||
context.getExternalContext().getRequestContextPath(),
|
||||
"white");
|
||||
"innerwhite");
|
||||
|
||||
// spacer row
|
||||
if (index++ < userInfoRefs.size() - 1)
|
||||
|
Reference in New Issue
Block a user