)getChildren())
+ {
+ if (componentId.equals(component.getId()))
+ {
+ uiActions = (UIActions)component;
+ break;
+ }
+ }
+
+ if (uiActions == null)
+ {
+ javax.faces.application.Application facesApp = FacesContext.getCurrentInstance().getApplication();
+ uiActions = (UIActions)facesApp.createComponent("org.alfresco.faces.Actions");
+ uiActions.setShowLink(false);
+ uiActions.getAttributes().put("styleClass", "inlineAction");
+ uiActions.setId(componentId);
+ uiActions.setParent(this);
+ uiActions.setValue(id);
+
+ this.getChildren().add(uiActions);
+ }
+
+ return uiActions;
+ }
+
// ------------------------------------------------------------------------------
// Strongly typed component property accessors
diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java
index a4df3afa6e..1b1fff8201 100644
--- a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java
+++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java
@@ -30,8 +30,16 @@ import java.util.List;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
+import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.web.app.Application;
+import org.alfresco.web.bean.repository.Repository;
+import org.alfresco.web.bean.wcm.AVMNode;
+import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.LinkValidationState;
+import org.alfresco.web.config.ClientConfigElement;
+import org.alfresco.web.ui.common.Utils;
+import org.alfresco.web.ui.repo.component.UIActions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -84,9 +92,19 @@ public class UILinkValidationBrokenFiles extends AbstractLinkValidationReportCom
}
else
{
+ UIActions actions = aquireUIActions("broken_file_actions", getValue().getStore());
+ AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
+ int rootPathIndex = AVMUtil.buildSandboxRootPath(linkState.getStore()).length();
+ String dns = AVMUtil.lookupStoreDNS(linkState.getStore());
+ ClientConfigElement config = Application.getClientConfig(context);
+ String wcmDomain = config.getWCMDomain();
+ String wcmPort = config.getWCMPort();
+
+ // render each broken file
for (String file : brokenFiles)
{
- renderBrokenFile(context, out, file, linkState);
+ renderBrokenFile(context, out, file, linkState, actions, avmService,
+ rootPathIndex, wcmDomain, wcmPort, dns);
}
}
@@ -97,7 +115,10 @@ public class UILinkValidationBrokenFiles extends AbstractLinkValidationReportCom
// Helpers
private void renderBrokenFile(FacesContext context, ResponseWriter out,
- String file, LinkValidationState linkState) throws IOException
+ String file, LinkValidationState linkState, UIActions actions,
+ AVMService avmService, int rootPathIndex, String wcmDomain,
+ String wcmPort, String dns)
+ throws IOException
{
// gather the data to show for the file
String[] nameAndPath = this.getFileNameAndPath(file);
@@ -126,11 +147,19 @@ public class UILinkValidationBrokenFiles extends AbstractLinkValidationReportCom
out.write("'>");
renderFile(out, context, fileName, filePath, brokenLinks);
out.write(" | ");
- out.write(" ");
-// out.write("  ");
-// out.write("  ");
-// out.write("  ");
-// out.write("  ");
+
+ // setup the context for the actions
+ AVMNodeDescriptor desc = avmService.lookup(-1, file);
+ AVMNode node = new AVMNode(desc);
+
+ String assetPath = file.substring(rootPathIndex);
+ String previewUrl = AVMUtil.buildAssetUrl(assetPath, wcmDomain, wcmPort, dns);
+ node.getProperties().put("previewUrl", previewUrl);
+ actions.setContext(node);
+
+ // render the actions
+ Utils.encodeRecursive(context, actions);
+
out.write(" | ");
}
}
diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenForms.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenForms.java
index fe189380a4..30c72a5eb3 100644
--- a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenForms.java
+++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenForms.java
@@ -30,8 +30,15 @@ import java.util.List;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
+import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.web.app.Application;
+import org.alfresco.web.bean.repository.Repository;
+import org.alfresco.web.bean.wcm.AVMNode;
+import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.LinkValidationState;
+import org.alfresco.web.ui.common.Utils;
+import org.alfresco.web.ui.repo.component.UIActions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -84,9 +91,12 @@ public class UILinkValidationBrokenForms extends AbstractLinkValidationReportCom
}
else
{
+ UIActions actions = aquireUIActions("broken_form_actions", getValue().getStore());
+ AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
+
for (String form : brokenForms)
{
- renderBrokenForm(context, out, form, linkState);
+ renderBrokenForm(context, out, form, linkState, actions, avmService);
}
}
@@ -97,7 +107,8 @@ public class UILinkValidationBrokenForms extends AbstractLinkValidationReportCom
// Helpers
private void renderBrokenForm(FacesContext context, ResponseWriter out,
- String file, LinkValidationState linkState) throws IOException
+ String file, LinkValidationState linkState, UIActions actions,
+ AVMService avmService) throws IOException
{
// get the web form name and path
String[] formNamePath = this.getFileNameAndPath(file);
@@ -146,7 +157,15 @@ public class UILinkValidationBrokenForms extends AbstractLinkValidationReportCom
out.write("");
out.write(" ");
-// out.write("  ");
+
+ // setup the context for the actions
+ AVMNodeDescriptor desc = avmService.lookup(-1, file);
+ AVMNode node = new AVMNode(desc);
+ actions.setContext(node);
+
+ // render the actions
+ Utils.encodeRecursive(context, actions);
+
out.write(" | ");
}
}