} catch (Exception e) {
// we use this workaround to be sure to get the stack trace
// to identify the sink of the bug.
- log.warn("trying to create an already existing userHome. Stack trace : ");
+ log.warn("trying to create an already existing userHome at path:"
+ + homePath + ". Stack trace : ");
e.printStackTrace();
}
}
Node userHome = JcrUtils.mkdirs(session, homePath);
Node userProfile;
if (userHome.hasNode(ArgeoNames.ARGEO_PROFILE)) {
- log.warn("User profile node already exists. We do not add a new one");
-
+ log.warn("userProfile node already exists for userHome path: "
+ + homePath + ". We do not add a new one");
} else {
userProfile = userHome.addNode(ArgeoNames.ARGEO_PROFILE);
userProfile.addMixin(ArgeoTypes.ARGEO_USER_PROFILE);
throw new ArgeoException("Cannot update last modified", e);
}
}
+
+ /**
+ * Returns a String representing the short version (see <a
+ * href="http://jackrabbit.apache.org/node-type-notation.html"> Node type
+ * Notation </a> attributes grammar) of the main business attributes of this
+ * property definition
+ *
+ * @param prop
+ */
+ public static String getPropertyDefinitionAsString(Property prop) {
+ StringBuffer sbuf = new StringBuffer();
+ try {
+ if (prop.getDefinition().isAutoCreated())
+ sbuf.append("a");
+ if (prop.getDefinition().isMandatory())
+ sbuf.append("m");
+ if (prop.getDefinition().isProtected())
+ sbuf.append("p");
+ if (prop.getDefinition().isMultiple())
+ sbuf.append("*");
+ } catch (RepositoryException re) {
+ throw new ArgeoException(
+ "unexpected error while getting property definition as String",
+ re);
+ }
+ return sbuf.toString();
+ }
}