I made a new widget, which is to show my specified documents. The functionality is the same as Popular Document Widget in
your product Clearspace Community 2.5.3.
Here are some codes in protected Map<String, Object> loadProperties(WidgetContext widgetContext, ContainerSize size)
JiveIterator<Document> documents1 = documentManager.getDocuments(community);
for(Document document: documents1){
Log.error("document.getID:" + document.getDocumentID());
Log.error("document.getID:" + document.getPlainSubject());
}
properties.put("documents", documents1);
properties.put("container", community);
properties.put("numResults", getNumUsersToDisplay());
Here is the FTL file.
<#include "/template/docs/include/doc-macros.ftl">
<#if containerSize == enums['com.jivesoftware.community.widget.Widget$ContainerSize'].SMALL>
<#if (documents?exists && documents.hasNext())>
${"FreeMarker 1"}
<@jive.jiveContentListSidebar content=documents limit=numResults />
<#else>
${"FreeMarker 2"}
<@jive.jiveEmptyContentListSidebar container=container showThreadLink=false showBlogPostLink=false/>
</#if>
<#else>
<#if (documents?exists && documents.hasNext())>
${"FreeMarker 3"}
<@jive.jiveContentList content=documents showContainer=isRoot limit=numResults />
<#else>
${"FreeMarker 4"}
<@jive.jiveEmptyContentList container=container showThreadLink=false showBlogPostLink=false/>
</#if>
</#if>
Here is what I get from the Widget.
Here is the log from the widget
17:25:42,729 [http-8080-3] ERROR com.jivesoftware - document.getID:DOC-1502
17:25:42,729 [http-8080-3] ERROR com.jivesoftware - document.getID:The ldgetservicepermormanceinfo crashes on XP workstation with no paging file
I think I have already found the documents, but it can't be rendered to the FTL file.
Thanks & Regards,
Aaron
Hi Aaron,
Are any of your other variables (container, numResults) making it across correctly?
-Todd
Hey Todd,
New code in widget
for(Document document: documents1){
Log.error("document.getID:" + document.getDocumentID());
Log.error("document.getPlainSubject:" + document.getPlainSubject());
}
Log.error("community ID:" + community.getID());
Log.error("community getDisplayName:" + community.getDisplayName());
Log.error("numResults:" + getNumUsersToDisplay());
properties.put("documents", documents1);
properties.put("container", community);
properties.put("numResults", getNumUsersToDisplay());
New log information
com.jivesoftware - document.getID:DOC-1502
com.jivesoftware - document.getPlainSubject:The ldgetservicepermormanceinfo crashes on XP workstation with no paging file
com.jivesoftware - community ID:2002
com.jivesoftware - community getDisplayName:service
com.jivesoftware - numResults:10
So I think there are no problem with all the parameters.
This issure is very emergency.
Now please help me to find the cause or give me a walkaround.
Thanks & Regards,
Aaron
Hi Todd,
After comment all the codes for debugging(such as Log.infor(), Log.error()), everything is fine.
That is really really strange.
Thanks & Regards,
Aaron