jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danisevsky <danisev...@gmail.com>
Subject combining data from relational db and jcr
Date Sat, 27 Nov 2010 11:01:29 GMT
Hello, I have users stored in relational db. Each user has its own
jacrabbit folder in which are photos, comments, etc. Folder is created
after user registration. I do not know how to best create path to this
folder. I am thinking about this algorithm:

	public static String createFolderPathForUser(User user) {
		StringBuilder path = new StringBuilder();
		String uuid = UUID.randomUUID().toString();
		String shorterUUID = uuid.substring(0, 10);
		char[] chars = new char[shorterUUID.length()];
		shorterUUID.getChars(0, shorterUUID.length(), chars, 0);
		for (int i = 0; i < chars.length; i++) {
			path.append(chars[i] + "/");
		}
		path.append(user.getId());
		return path.toString();
	}

which get for user with id=123 e.g. this path:

1/4/c/9/6/7/b/c/-/e/123

and this path save to user field in relational db.

Is it good solutions? A have not much experiences with jackrabbit.

Thanks.

Mime
View raw message