05-26-2010 01:10 PM
05-27-2010 04:08 AM
<%@ 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" %>
<html>
<body>
<f:view>
<h:form>
<r:template template="alfresco/templates/userhome_docs.ftl" />
</h:form>
</f:view>
</body>
</html>
05-27-2010 08:01 AM
05-27-2010 08:59 AM
05-27-2010 09:25 AM
05-28-2010 09:43 AM
<r:template template="alfresco/templates/example.ftl" model="#{MyBean.templateModel}" />
Example Bean code to return a model:
/**
* Returns a model for use by a template on the Document Details page.
*
* @return model containing current document and current space info.
*/
public Map getTemplateModel()
{
Map<String, Object> model = new HashMap<String, Object>(4, 1.0f);
model.put("document", getDocument().getNodeRef());
model.put("space", this.navigator.getCurrentNode().getNodeRef()); //define space that you need hire.
model.put(TemplateService.KEY_IMAGE_RESOLVER, imageResolver);
return model;
}
06-03-2010 06:03 AM
<%@ 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" %>
<html>
<body>
<f:view>
<h:form>
<r:template template="alfresco/templates/simple.ftl" />
</h:form>
</f:view>
</body>
</html>
<h1>hello how are you</h1>
06-03-2010 07:02 AM
<%@ 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/simple.ftl" />
06-03-2010 09:04 AM
This works great, check how to define custom model. and specify space and document nodes. this would fix it .
<r:template template="alfresco/templates/example.ftl" model="#{MyBean.templateModel}" />
Example Bean code to return a model:
/**
* Returns a model for use by a template on the Document Details page.
*
* @return model containing current document and current space info.
*/
public Map getTemplateModel()
{
Map<String, Object> model = new HashMap<String, Object>(4, 1.0f);
model.put("document", getDocument().getNodeRef());
model.put("space", this.navigator.getCurrentNode().getNodeRef()); //define space that you need hire.
model.put(TemplateService.KEY_IMAGE_RESOLVER, imageResolver);
return model;
}
06-03-2010 09:15 AM
protected TemplateImageResolver 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);
}
};
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.