Retrieve archived node
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2016 05:19 PM
Alfresco node browser admin tool use DbNodeServiceImpl to find archived node. Here is the code fragment
But node browser always return true and found
In my customized code, I passed exact nodeRef and use DbNodeServiceImpl as well
My code always return false, not found
The same class, same method class and exact same parameter which is node reference. How could exists(nodeRef) returns different results. What is wrong or do I miss something?
Thank you in advance
if (queryLanguage.equals("noderef")) { // ensure node exists NodeRef nodeRef = new NodeRef(query); boolean exists = getNodeService().exists(nodeRef); if (!exists) { throw new AlfrescoRuntimeException("Node " + nodeRef + " does not exist."); } setNodeRef(nodeRef); return "node"; }
But node browser always return true and found
In my customized code, I passed exact nodeRef and use DbNodeServiceImpl as well
NodeRef archivedNodeRef = new NodeRef(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE, nodeRef.getId()); boolean exists = this.dbNodeService.exists(archivedNodeRef); return exists;
My code always return false, not found
The same class, same method class and exact same parameter which is node reference. How could exists(nodeRef) returns different results. What is wrong or do I miss something?
Thank you in advance
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2016 05:36 PM
If you deeply look into, it is about nodesCache in AbstractNodeDAOImpl:
Since nodeRef is same, node browser tool gets different Pair from mine. The only possible way to have different Pair is that I have different nodeCache from admintool. How could this happen from the same instance? Any work around?
Thanks
public boolean exists(NodeRef nodeRef) { NodeEntity node = new NodeEntity(nodeRef); Pair<Long, Node> pair = nodesCache.getByValue(node); return pair != null && !pair.getSecond().getDeleted(qnameDAO); }
Since nodeRef is same, node browser tool gets different Pair from mine. The only possible way to have different Pair is that I have different nodeCache from admintool. How could this happen from the same instance? Any work around?
Thanks
