use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class CourseIdentifierEntityController method createCourseIdentifierEntity.
public CourseIdentifierEntity createCourseIdentifierEntity(String dataSource, String identifier) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(dataSource);
if (dataSource == null) {
logger.severe("Could not find datasource " + dataSource);
return null;
}
CourseIdentifierEntity courseIdentifierEntity = courseIdentifierEntityDAO.create(Boolean.FALSE);
courseIdentifierSchoolDataIdentifierDAO.create(schoolDataSource, identifier, courseIdentifierEntity);
return courseIdentifierEntity;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class SchoolDataPyramusPluginDescriptor method init.
@Override
public void init() {
/**
* Ensure that SchoolDataSource is defined
*/
SchoolDataSource schoolDataSource = schoolDataController.findSchoolDataSource(SCHOOL_DATA_SOURCE);
if (schoolDataSource == null) {
schoolDataController.createSchoolDataSource(SCHOOL_DATA_SOURCE);
}
systemOauthController.deleteSystemAccessTokens();
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class UserSchoolDataController method updateUserAddress.
public void updateUserAddress(SchoolDataIdentifier studentIdentifier, SchoolDataIdentifier addressIdentifier, String street, String postalCode, String city, String country) throws SchoolDataBridgeUnauthorizedException {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(addressIdentifier.getDataSource());
if (schoolDataSource == null) {
throw new SchoolDataBridgeInternalException(String.format("Invalid data source %s", addressIdentifier.getDataSource()));
}
getUserBridge(schoolDataSource).updateUserAddress(studentIdentifier, addressIdentifier, street, postalCode, city, country);
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class UserSchoolDataController method updateUser.
public void updateUser(User user) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(user.getSchoolDataSource());
if (schoolDataSource == null) {
throw new SchoolDataBridgeInternalException(String.format("Invalid data source %s", user.getSchoolDataSource()));
}
getUserBridge(schoolDataSource).updateUser(user);
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class WorkspaceController method findWorkspaceRoleEntityByDataSourceAndIdentifier.
/* WorkspaceRoleEntity */
public WorkspaceRoleEntity findWorkspaceRoleEntityByDataSourceAndIdentifier(String schoolDataSource, String roleIdentifier) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
if (dataSource == null) {
logger.log(Level.SEVERE, "Could not find school data source '" + schoolDataSource + "'");
return null;
}
RoleSchoolDataIdentifier roleSchoolDataIdentifier = roleSchoolDataIdentifierDAO.findByDataSourceAndIdentifier(dataSource, roleIdentifier);
if (roleSchoolDataIdentifier != null) {
RoleEntity roleEntity = roleSchoolDataIdentifier.getRoleEntity();
if (roleEntity.getType() == UserRoleType.WORKSPACE) {
return (WorkspaceRoleEntity) roleEntity;
}
}
return null;
}
Aggregations