05-26-2010 01:10 PM
06-04-2010 10:57 AM
model.put("nodeList", this.browseBean.getContent());
06-04-2010 10:10 PM
06-06-2010 01:08 PM
<td style="padding-right:4px" align=right>
<%– custom button –%>
<nobr><a:actionLink value="CustomButton" image="/custom/images/icons/customButton.png" style="white-space:nowrap" actionListener="#{CustomDialog.myMethod}" id="mylink1" /></nobr>
</td>
public class CustomDialog extends BaseDialogBean {
Map<String, Object> templateModel;
protected TemplateImageResolver imageResolver;
public void myMethod(ActionEvent event) {
imageResolver = new TemplateImageResolver() {
public String resolveImagePathForName(String filename,
FileTypeImageSize size) {
FacesContext context = FacesContext.getCurrentInstance();
ServletContext servletContext = ((HttpServletRequest) context
.getExternalContext().getRequest()).getSession()
.getServletContext();
return FileTypeImageUtils.getFileTypeImage(servletContext,
filename, size);
}
};
// go to custom dialog
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:custom");
}
public Map getTemplateModel()
{
Map<String, Object> model = new HashMap<String, Object>(4, 1.0f);
model.put("nodeList", this.browseBean.getContent());
model.put(TemplateService.KEY_IMAGE_RESOLVER, imageResolver);
return model;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception {
// return the default outcome
return outcome;
}
public TemplateImageResolver getImageResolver() {
return imageResolver;
}
public void setImageResolver(TemplateImageResolver imageResolver) {
this.imageResolver = imageResolver;
}
public void setTemplateModel(Map<String, Object> templateModel) {
this.templateModel = templateModel;
}
}
<dialog name="custom" page="/jsp/extension/dialogs/custom.jsp" managed-bean="CustomDialog"
icon="/custom/images/icons/custom_1.gif" title="Custom"
description="Displays custom list" />
<managed-bean>
<managed-bean-name>CustomDialog</managed-bean-name>
<managed-bean-class>co.esource.web.bean.CustomDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
</managed-bean>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<r:template template="alfresco/templates/custom.ftl" model="#{CustomDialog.templateModel}" />
06-06-2010 01:48 PM
model.put("nodeList", this.browseBean.getContent());
model.put("hello","hello, how are you");
public Map getTemplateModel()
{
nameList = new java.util.ArrayList<String>();
customList = new java.util.ArrayList<customNode>();
List<Node> searchResults = this.browseBean.getContent();
Integer searchResultsCount = searchResults.size();
for(ListIterator<Node>li=searchResults.listIterator(); li.hasNext(); )
{
Node resultNode = li.next();
String Name = resultNode.getName();
nameList.add(Name);
customList.add(new customNode(resultNode));
}
Map<String, Object> model = new HashMap<String, Object>(4, 1.0f);
model.put("names", nameList);
model.put("custom", customList);
//model.put("nodeList", this.browseBean.getContent());
model.put(TemplateService.KEY_IMAGE_RESOLVER, imageResolver);
return model;
}
06-06-2010 01:50 PM
06-06-2010 01:55 PM
childrenByLuceneSearch
Returns a map capable of executing a search against the entire repository based on a Lucene search string. It returns a sequence of nodes which represent the objects from the results of the search, such as companyhome.childrenByLuceneSearch["TEXT:alfresco* AND TEXT:tutorial*"]. The value can be any valid Lucene search string supported by Alfresco. Note that you may need to escape Lucene specific characters. Note that the entire repository is searched: the current node is only used as an access point to retrieve the search object.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.