+ public void syncPath(TreeSRegistry registry,\r
+ StructureRegistry<TreeSPath> localRegistry, TreeSPath path) {\r
+ if (path.getParent() != null) {\r
+ TreeSPath parent = treeSPathDao.getOrCreate(path.getParent());\r
+ syncPath(registry, localRegistry, parent);\r
+ }\r
+\r
+ if (log.isDebugEnabled())\r
+ log.debug("Synchronize path " + path);\r
+ \r
+ if (registry.getElement(path) == null) {\r
+ if (localRegistry != null) {\r
+ registry.register(path, getElement(registry, localRegistry, path));\r
+ } else {\r
+ registry.register(path, new SimpleSElement(path.getName()));\r
+ }\r
+ update(registry);\r
+ } else {\r
+ if (localRegistry != null) {\r
+ StructureElement sElement = getElement(registry, localRegistry, path);\r
+ if (sElement != null) {\r
+ registry.register(path, sElement);\r
+ update(registry);\r
+ }\r
+ }\r
+ }\r
+\r
+ }\r
+\r
+ public void setTreeSPathDao(TreeSPathDao treeSPathDao) {\r
+ this.treeSPathDao = treeSPathDao;\r
+ }\r
+\r
+ protected StructureElement getElement(TreeSRegistry registry,\r
+ StructureRegistry<TreeSPath> localRegistry, TreeSPath path){\r
+ return localRegistry.getElement(path);\r
+ }\r