09-15-2010 05:39 AM
<action id="add_tags">
<permissions>
<permission allow="true">Contributor</permission>
</permissions>
<label-id>add-tags</label-id>
<image>/custom/images/icons/pencil.png</image>
<action>dialog:addTags</action>
<action-listener>#{BrowseBean.setupContentAction}</action-listener>
<params>
<param name="ref">#{actionContext.id}</param>
</params>
</action>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td colspan="2" class="mainSubTitle"><h:outputText value="Enter some Tags" /></td>
</tr>
<tr>
<td colspan="2" class="paddingRow"></td>
</tr>
<tr>
<td>
<h:outputText value="Tags :"/>
</td>
<td width="95%">
<h:inputText id="tags" value="" size="50" maxlength="1024" />
</td>
</tr>
<tr><td class="paddingRow"></td></tr>
</table>
protected String finishImpl(FacesContext context, String outcome) throws Throwable {
// get the space the action will apply to
NodeRef nodeRef = this.browseBean.getDocument().getNodeRef();
// add the aspect if it is not already present on the node
QName tagAspect = QName.createQName("extension.tags", "taggable");
if (getNodeService().hasAspect(nodeRef, tagAspect) == false)
{
getNodeService().addAspect(nodeRef, tagAspect, null);
}
// create the tags as a list
List<String> tagsList = new ArrayList<String>();
if (this.tags != null && this.tags.length() > 0)
{
StringTokenizer tokenizer = new StringTokenizer(this.tags, ",");
while (tokenizer.hasMoreTokens())
{
tagsList.add(tokenizer.nextToken().trim());
}
}
// set the tags property
QName tagsProp = QName.createQName("extension.tags", "tags");
getNodeService().setProperty(nodeRef, tagsProp, (Serializable)tagsList);
// return the default outcome
return outcome;
}
public boolean getFinishButtonDisabled(){
return false;
}
public void setTags(String tags){
this.tags = tags;
}
public String getTags(){
return tags;
}
<managed-bean>
<managed-bean-name>AddTagsDialog</managed-bean-name>
<managed-bean-class>my.custom.web.ui.dialogs.AddTagsDialog</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>
09-15-2010 09:29 AM
09-15-2010 10:34 AM
<h:inputText value="#{DialogManager.bean.tags}" />
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.