this.addContentMixin(node);
}
Value[] values = new Value[readGroups.size()];
for (ListIterator it = readGroups.listIterator(); it.hasNext(); ) {
int index = it.nextIndex();
Group currentGroup = (Group) it.next();
Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
values[index] = valueFactory.createValue(groupNode);
}
node.setProperty(NodesTypes.PREFIX + READ_GROUPS_PROPERTY, values);
}
}
{
node.setProperty(NodesTypes.PREFIX + READ_USERS_PROPERTY, new Value[0]);
List readUsers = content.getReadUsers();
if (readUsers != null && !readUsers.isEmpty()) {
if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
this.addContentMixin(node);
}
Value[] values = new Value[readUsers.size()];
for (ListIterator it = readUsers.listIterator(); it.hasNext(); ) {
int index = it.nextIndex();
User currentUser = (User) it.next();
values[index] = valueFactory.createValue(currentUser.getUsername());
}
node.setProperty(NodesTypes.PREFIX + READ_USERS_PROPERTY, values);
}
}
{
node.setProperty(NodesTypes.PREFIX + WRITE_GROUPS_PROPERTY, new Value[0]);
List writeGroups = content.getWriteGroups();
if (writeGroups != null && !writeGroups.isEmpty()) {
if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
this.addContentMixin(node);
}
Value[] values = new Value[writeGroups.size()];
for (ListIterator it = writeGroups.listIterator(); it.hasNext(); ) {
int index = it.nextIndex();
Group currentGroup = (Group) it.next();
Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
values[index] = valueFactory.createValue(groupNode);
}
node.setProperty(NodesTypes.PREFIX + WRITE_GROUPS_PROPERTY, values);
}
}
{
node.setProperty(NodesTypes.PREFIX + WRITE_USERS_PROPERTY, new Value[0]);
List writeUsers = content.getWriteUsers();
if (writeUsers != null && !writeUsers.isEmpty()) {
if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
this.addContentMixin(node);
}
Value[] values = new Value[writeUsers.size()];
for (ListIterator it = writeUsers.listIterator(); it.hasNext(); ) {
int index = it.nextIndex();
User currentUser = (User) it.next();
values[index] = valueFactory.createValue(currentUser.getUsername());
}
node.setProperty(NodesTypes.PREFIX + WRITE_USERS_PROPERTY, values);
}
}
{
node.setProperty(NodesTypes.PREFIX + REMOVE_GROUPS_PROPERTY, new Value[0]);
List removeGroups = content.getRemoveGroups();
if (removeGroups != null && !removeGroups.isEmpty()) {
if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
this.addContentMixin(node);
}
Value[] values = new Value[removeGroups.size()];
for (ListIterator it = removeGroups.listIterator(); it.hasNext(); ) {
int index = it.nextIndex();
Group currentGroup = (Group) it.next();
Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
values[index] = valueFactory.createValue(groupNode);
}
node.setProperty(NodesTypes.PREFIX + REMOVE_GROUPS_PROPERTY, values);
}
}
{
node.setProperty(NodesTypes.PREFIX + REMOVE_USERS_PROPERTY, new Value[0]);
List removeUsers = content.getRemoveUsers();
if (removeUsers != null && !removeUsers.isEmpty()) {
if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
this.addContentMixin(node);
}
Value[] values = new Value[removeUsers.size()];
for (ListIterator it = removeUsers.listIterator(); it.hasNext(); ) {
int index = it.nextIndex();
User currentUser = (User) it.next();
values[index] = valueFactory.createValue(currentUser.getUsername());
}
node.setProperty(NodesTypes.PREFIX + REMOVE_USERS_PROPERTY, values);
}
}
{
node.setProperty(NodesTypes.PREFIX + OWNER_GROUPS_PROPERTY, new Value[0]);
List ownerGroups = content.getOwnerGroups();
if (ownerGroups != null && !ownerGroups.isEmpty()) {
if (!node.isNodeType(NodesTypes.PREFIX + ContentDao.NAME)) {
this.addContentMixin(node);
}
Value[] values = new Value[ownerGroups.size()];
for (ListIterator it = ownerGroups.listIterator(); it.hasNext(); ) {
int index = it.nextIndex();
Group currentGroup = (Group) it.next();
Node groupNode = node.getSession().getNodeByUUID(currentGroup.getId());
values[index] = valueFactory.createValue(groupNode);
}
node.setProperty(NodesTypes.PREFIX + OWNER_GROUPS_PROPERTY, values);
}
}