Issue Type: Bug Bug
Affects Versions: 4.5.7
Assignee: Jaroslav Simak
Attachments: data.travelAgency.Koeln.ATLASREISEN_13009.employees.Ann-Kathrin-Wiesinger-22498.countries-1.xml, error_log.txt
Created: 20/Mar/13 10:36 AM
Description:

We have another problem on activating our content. The problem is that nodes which where created by the "NodeUtil.createPath" of the magnolia-core, don't have the MixinType "lockable". This will cause a output in the error log.
And we think it will also cause problems, if the Node can't be locked for activation.
So we created our own methode:

	public static Node getOrCreateNode(Node parent, String relPath, String primaryNodeTypeName) throws RepositoryException, PathNotFoundException, AccessDeniedException {
		return createPath(parent, relPath, primaryNodeTypeName, false);
	}

	public static Node createPath(Node parent, String relPath, String primaryNodeTypeName, boolean save) throws PathNotFoundException, ItemExistsException, VersionException, ConstraintViolationException, LockException, RepositoryException {
		// remove leading /
		String currentPath = StringUtils.removeStart(relPath, "/");

		if (StringUtils.isEmpty(currentPath)) {
			// Here we add the MixinType lockable
			parent.addMixin(JcrConstants.MIX_LOCKABLE);

			return parent;
		}

		Node root = parent;
		String[] names = currentPath.split("/");

		for (int i = 0; i < names.length; i++) {
			String name = names[i];
			if (root.hasNode(name)) {
				root = root.getNode(name);

				// Here we add the MixinType lockable
				root.addMixin(JcrConstants.MIX_LOCKABLE);
			} else {
				final Node newNode = root.addNode(name, primaryNodeTypeName);

				// Here we add the MixinType lockable
				root.addMixin(JcrConstants.MIX_LOCKABLE);

				if (save) {
					root.getSession().save();
				}
				root = newNode;
			}
		}
		return root;
	}

But the problem isn't solved. The MixinType is set to the Nodes (as you can see in the exported xml file) but the error still appear. The strange thing is, that it only appears at Nodes of the type "dataItemNode".
The affected Nodes are not activated.
I added a exported Node to this issue on which the activation problem happen.

Maybe it's a sub of http://jira.magnolia-cms.com/browse/MAGNOLIA-4872.

Thanks in advance.

Best regards

Fix Versions: 4.5.9, 5.0
Project: Magnolia
Priority: Critical Critical
Reporter: Jaroslav Simak
Security Level: Public
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to