03-21-2006 08:34 AM
List<Node> listNode = browseBean.getContent() ;retrieve content of the current navigation but not necessarily the content of the space a just modify.03-22-2006 04:10 AM
03-22-2006 04:49 AM
public void updateDocumentProperties() {
Node currentSpace = this.browseBean.getActionSpace();
FacesContext context = FacesContext.getCurrentInstance();
List<Node> listNode = browseBean.getContent() ;
if(listNode != null)
{
for (Node node : listNode) {
UserTransaction tx = null;
try
{
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin();
Map<String, Object> props = currentSpace.getProperties() ;
Iterator<String> iterProps = props.keySet().iterator();
while (iterProps.hasNext())
{
String propName = iterProps.next();
QName qname = QName.createQName(propName);
// make sure the property is represented correctly
Serializable propValue = (Serializable)props.get(propName);
// check for empty strings when using number types, set to null in this case
if(qname.toPrefixString(this.namespaceService).indexOf("custom:") == 0)
this.nodeService.setProperty(node.getNodeRef(),QName.createQName(propName),propValue) ;
}
// give subclasses a chance to perform custom processing before committing
performCustomProcessing(context);
// commit the transaction
tx.commit();
}
catch (Throwable e)
{
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
}
}03-23-2006 06:59 AM
List<NodeRef> childNodes = new ArrayList<NodeRef>();
List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(currentSpace,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef ref: childRefs)
{
// create our Node representation from the NodeRef
NodeRef nodeRef = ref.getChildRef();
if (this.nodeService.exists(nodeRef))
{
<if node is content> (type checking omitted for brevity)
childNodes.add(nodeRef);
}
}
03-23-2006 07:33 AM
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.