After move: The node's content is missing
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2010 06:11 AM
Hi All,
I am writing a class that extends BaseWizardBean. I have the following code to move the node (which represents a file) to a different folder.
My problem is that the node (or at least the metadata) does indeed appear under the new node, but the content has gone. When I click on it I get:
No exceptions occurred. Any help would be most appreciated!
Rob
I am writing a class that extends BaseWizardBean. I have the following code to move the node (which represents a file) to a different folder.
NodeService ns = getNodeService();// get the Space to apply changes tooNodeRef nodeRef = this.getNode().getNodeRef();// Folder this doc belongs to.NodeRef docFolder = ns.getPrimaryParent(nodeRef).getParentRef();// Get ebns - parent folder to docFolder.NodeRef ebns = ns.getPrimaryParent(docFolder).getParentRef();// Find destination folder within ebns.NodeRef destNodeRef = this.getFileFolderService().searchSimple(ebns, "nextFolderName");// Move the node.try { getFileFolderService().move(nodeRef, destNodeRef, "some new name");} catch (FileExistsException e) { e.printStackTrace();} catch (FileNotFoundException e) { e.printStackTrace();}
My problem is that the node (or at least the metadata) does indeed appear under the new node, but the content has gone. When I click on it I get:
The node's content is missing: node: workspace://SpacesStore/e16ed62d-36b7-45ef-93c2-b19eafffc1e6 reader: null Please contact your system administrator.
No exceptions occurred. Any help would be most appreciated!
Rob

Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2010 11:21 PM
Found the problem.. was doing this
instead of this:
I.e. blowing away all the other properties by creating a new map of properties rather than editing the existing map of properties.
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();this.getNodeService().setProperties(this.getNode().getNodeRef(), properties);
instead of this:
Map<QName, Serializable> properties = getNodeService().getProperties(nodeRef);this.getNodeService().setProperties(this.getNode().getNodeRef(), properties);
I.e. blowing away all the other properties by creating a new map of properties rather than editing the existing map of properties.
