public static SGroup constructSGroup(final ExportedGroup exportedGroup) { final long now = System.currentTimeMillis(); final SGroupBuilder groupBuilder = BuilderFactory.get(SGroupBuilderFactory.class).createNewInstance(); groupBuilder.setCreatedBy(SessionInfos.getUserIdFromSession()); groupBuilder.setCreationDate(now).setLastUpdate(now); groupBuilder.setName(exportedGroup.getName()); groupBuilder.setParentPath(exportedGroup.getParentPath()); groupBuilder.setDisplayName(exportedGroup.getDisplayName()); groupBuilder.setDescription(exportedGroup.getDescription()); return groupBuilder.done(); }
public static SGroup constructSGroup(final ExportedGroup exportedGroup) { final long now = System.currentTimeMillis(); final SGroupBuilder groupBuilder = BuilderFactory.get(SGroupBuilderFactory.class).createNewInstance(); groupBuilder.setCreatedBy(SessionInfos.getUserIdFromSession()); groupBuilder.setCreationDate(now).setLastUpdate(now); groupBuilder.setName(exportedGroup.getName()); groupBuilder.setParentPath(exportedGroup.getParentPath()); groupBuilder.setDisplayName(exportedGroup.getDisplayName()); groupBuilder.setDescription(exportedGroup.getDescription()); return groupBuilder.done(); }
public static SGroup constructSGroup(final GroupCreator creator) { final long now = System.currentTimeMillis(); final SGroupBuilder groupBuilder = BuilderFactory.get(SGroupBuilderFactory.class).createNewInstance(); groupBuilder.setCreatedBy(SessionInfos.getUserIdFromSession()); groupBuilder.setCreationDate(now).setLastUpdate(now); final Map<GroupField, Serializable> fields = creator.getFields(); groupBuilder.setName((String) fields.get(GroupField.NAME)); final String parentPath = (String) fields.get(GroupField.PARENT_PATH); if (parentPath != null && !parentPath.isEmpty()) { groupBuilder.setParentPath(parentPath); } final String displayName = (String) fields.get(GroupField.DISPLAY_NAME); if (displayName != null) { groupBuilder.setDisplayName(displayName); } final String description = (String) fields.get(GroupField.DESCRIPTION); if (description != null) { groupBuilder.setDescription(description); } return groupBuilder.done(); }
public static SGroup constructSGroup(final GroupCreator creator) { final long now = System.currentTimeMillis(); final SGroupBuilder groupBuilder = BuilderFactory.get(SGroupBuilderFactory.class).createNewInstance(); groupBuilder.setCreatedBy(SessionInfos.getUserIdFromSession()); groupBuilder.setCreationDate(now).setLastUpdate(now); final Map<GroupField, Serializable> fields = creator.getFields(); groupBuilder.setName((String) fields.get(GroupField.NAME)); final String parentPath = (String) fields.get(GroupField.PARENT_PATH); if (parentPath != null && !parentPath.isEmpty()) { groupBuilder.setParentPath(parentPath); } final String displayName = (String) fields.get(GroupField.DISPLAY_NAME); if (displayName != null) { groupBuilder.setDisplayName(displayName); } final String description = (String) fields.get(GroupField.DESCRIPTION); if (description != null) { groupBuilder.setDescription(description); } return groupBuilder.done(); }