Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1778 → Rev 1779

/branches/v3/impl/conf/WEB-INF/tags/vfs/vfsview.tag
45,7 → 45,7
 
 
JSONArray rootsArray = new JSONArray();
JSONObject jsonObject = vfsAbstractPageContentDto.getJsonObject();
JSONObject jsonObject = vfsAbstractPageContentDto.toJsonObject();
rootsArray.put(jsonObject);
request.setAttribute("rootsArray",rootsArray);
%>
/branches/v3/impl/src/java/pt/estgp/estgweb/services/courses/CoursesService.java
639,7 → 639,7
 
generateCourseJson(course);
 
//if(course.getJson() == null)
//if(course.toJson() == null)
//{
// logger.info("status JSON NOT EXIST FOR STUDIES PLAN IN THIS COURSE, will generate");
// new CoursesService().generateCourseJson(course);
/branches/v3/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportSumariesJson.java
246,7 → 246,7
s.setcEstado(""+aula.getSum_cdEstado().intValue());
s.setNumeroHoras("" + aula.getNumeroCelulas().intValue());
s.setCdTurma(aula.getAula_codigoTurma());
summaries.put(s.getJson());
summaries.put(s.toJson());
courseUnitSummaries.add(s);
if(s.getNumeroAula() > 0)
summariesValid++;
/branches/v3/impl/src/java/pt/estgp/estgweb/services/pageContent/dto/VfsAbstractPageContentDto.java
116,11 → 116,11
return pageContent.getDescription();
}
 
public String getJson() throws JSONException
public String toJson() throws JSONException
{
return getJsonObject().toString();
return toJsonObject().toString();
}
public JSONObject getJsonObject() throws JSONException
public JSONObject toJsonObject() throws JSONException
{
PageContentImpl pageContent = (PageContentImpl) this.pageContent;
JSONObject pageContentJson = new JSONObject();
166,7 → 166,7
List<VfsAbstractPageContentDto> childs = pageSectionDto.getChilds();
for(VfsAbstractPageContentDto child: childs)
{
JSONObject childJson = child.getJsonObject();
JSONObject childJson = child.toJsonObject();
childsJsonArray.put(childJson);
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/pageContent/dto/VfsClient.java
150,7 → 150,7
List<VfsPageSectionDto> rootsDtos = getRoots();
for(VfsPageSectionDto dto: rootsDtos)
{
jsonArray.put(dto.getJsonObject());
jsonArray.put(dto.toJsonObject());
}
 
return jsonArray;
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/ConfigurationSeparatorImpl.java
69,6 → 69,7
.include(Integer.class)
.include(Float.class)
.include(Double.class)
.include(String.class)
.include("name", ConfigurationSeparatorImpl.class)
.include("nameEn",ConfigurationSeparatorImpl.class)
.include("nameEs",ConfigurationSeparatorImpl.class)
83,12 → 84,12
.include("slug", PageSectionImpl.class)
.create();
 
public String getJson() throws IOException
public String toJson() throws IOException
{
return confGenson.serialize(this);
}
 
public static String getJson(ArrayList<ConfigurationSeparator> seps) throws IOException
public static String toJson(ArrayList<ConfigurationSeparator> seps) throws IOException
{
return confGenson.serialize(seps);
}
97,11 → 98,13
return confGenson.deserialize(json, ConfigurationSeparatorImpl.class);
}
 
public JSONObject getJsonObject() throws IOException, JSONException {
return new JSONObject(getJson());
public JSONObject toJsonObject() throws IOException, JSONException {
return new JSONObject(toJson());
}
 
public static void main(String[] args) throws IOException {
System.out.println(new ConfigurationSeparatorImpl().getJson());
System.out.println(new ConfigurationSeparatorImpl().toJson());
 
 
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/BpmnFlowComponentImpl.java
16,12 → 16,12
//exclude connector
.create();
 
public JSONObject getJsonObject() throws IOException, JSONException
public JSONObject toJsonObject() throws IOException, JSONException
{
return new JSONObject(genson.serialize(this));
}
 
public String getJson() throws IOException
public String toJson() throws IOException
{
return genson.serialize(this);
}
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/CourseUnitSummaryImpl.java
76,7 → 76,7
}
 
 
public JSONObject getJson() throws JSONException {
public JSONObject toJson() throws JSONException {
 
JSONObject jsonObject = new JSONObject();
 
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/RepositoryDocumentCollectionImpl.java
71,6 → 71,13
gensonSimpleFields = gensonBuilderSimpleFields.create();
 
}
 
 
 
 
 
 
public String toJson() throws IOException
{
return genson.serialize(this);
128,7 → 135,7
{}
 
 
public boolean isManager(UserSession userSession)
public boolean checkManager(UserSession userSession)
{
if(userSession.getUser() == null)
return false;
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/BpmnProcessImpl.java
29,8 → 29,7
.include(String.class)
 
 
.exclude("getJson", BpmnProcessImpl.class)
.exclude("getJsonObject", BpmnProcessImpl.class)
 
//.include(BpmnProcessStep.class)
.create();
 
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/CourseUnitImpl.java
1209,7 → 1209,7
if(docenteTurmas.size() == 0)
{
//NAO Há sumários vamos associar todos os docentes a todas as turmas
getTipologiasSimplesParaEstesTeachersParaTodasAsTurmas(courseUnit,new HashSet<Teacher>(courseUnit.getTeachers()), merge);
obtainTipologiasSimplesParaEstesTeachersParaTodasAsTurmas(courseUnit, new HashSet<Teacher>(courseUnit.getTeachers()), merge);
}
else
{
1238,7 → 1238,7
{
professoresEsperados.remove(tMerge.getCdDocente());
}
getTipologiasSimplesParaEstesTeachersParaTodasAsTurmas(courseUnit,professoresEsperados.values(), merge);
obtainTipologiasSimplesParaEstesTeachersParaTodasAsTurmas(courseUnit, professoresEsperados.values(), merge);
//FRAGMENTO EM FALTA PARA INTRODUZIR PROFS SEM SUMARIO
 
 
1249,7 → 1249,7
return merge;
}
 
private void getTipologiasSimplesParaEstesTeachersParaTodasAsTurmas(CourseUnit courseUnit,Collection<Teacher> teachers, ArrayList<Tipologia> merge) {
private void obtainTipologiasSimplesParaEstesTeachersParaTodasAsTurmas(CourseUnit courseUnit, Collection<Teacher> teachers, ArrayList<Tipologia> merge) {
if(courseUnit.getTurmas() != null && courseUnit.getTeachers() != null)
{
for(CourseUnitTurma turma: courseUnit.getTurmas())
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/CourseSchoolImpl.java
47,12 → 47,12
.include("teacherRole",CourseSchoolImpl.class)
.create();
 
public String getJson() throws IOException
public String toJson() throws IOException
{
return courseSchoolGenson.serialize(this);
}
 
public static String getJson(ArrayList<CourseSchool> schools) throws IOException
public static String toJson(ArrayList<CourseSchool> schools) throws IOException
{
return courseSchoolGenson.serialize(schools);
}
61,7 → 61,7
return courseSchoolGenson.deserialize(json, CourseSchoolImpl.class);
}
 
public JSONObject getJsonObject() throws IOException, JSONException {
return new JSONObject(getJson());
public JSONObject toJsonObject() throws IOException, JSONException {
return new JSONObject(toJson());
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/CourseDepartmentImpl.java
38,16 → 38,16
.include("id",CourseSchoolImpl.class)
.create();
 
public String getJson() throws IOException
public String toJson() throws IOException
{
return courseDepartmentGenson.serialize(this);
}
public JSONObject getJsonObject() throws IOException, JSONException
public JSONObject toJsonObject() throws IOException, JSONException
{
return new JSONObject(courseDepartmentGenson.serialize(this));
}
 
public static String getJson(ArrayList<CourseDepartment> departments) throws IOException
public static String toJson(ArrayList<CourseDepartment> departments) throws IOException
{
return courseDepartmentGenson.serialize(departments);
}
58,6 → 58,6
}
 
public static void main(String[] args) throws IOException {
System.out.println(new CourseDepartmentImpl().getJson());
System.out.println(new CourseDepartmentImpl().toJson());
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/filters/filters/CheckRepositoryCollectionManager.java
77,7 → 77,7
RepositoryDocument persistentDoc = DaoFactory.getRepositoryDocumentDaoImpl().get(id);
if(persistentDoc.getCollection() != null)
{
boolean isManager = persistentDoc.getCollection().isManager(sess);
boolean isManager = persistentDoc.getCollection().checkManager(sess);
if(!isManager)
throw new NotAuthorizedException("O seu perfil não lhe permite atualizar documentos da colecção " + persistentDoc.getCollection().getName());
}
87,7 → 87,7
}
}
RepositoryDocumentCollectionImpl targetCollection = (RepositoryDocumentCollectionImpl) DaoFactory.getRepositoryDocumentCollectionDaoImpl().get(targetColId);
boolean isManager = targetCollection.isManager(sess);
boolean isManager = targetCollection.checkManager(sess);
if(!isManager)
throw new NotAuthorizedException("O seu perfil não lhe permite atualizar documentos da colecção " + targetCollection.getName());
}
/branches/v3/impl/src/java/pt/estgp/estgweb/web/controllers/courses/CourseDepartmentController.java
24,7 → 24,7
String[] names = new String[]{};
Object[] args = new Object[]{courseDepartmentJson};
CourseDepartmentImpl d = (CourseDepartmentImpl) sm.execute(RequestUtils.getRequester(request, response), "UpdateCourseDepartment", args, names);
JSONObject tJson = d.getJsonObject();
JSONObject tJson = d.toJsonObject();
addMessage(request,"course.update.department.success",d.getName());
return tJson;
}
37,7 → 37,7
String[] names = new String[]{};
Object[] args = new Object[]{courseDepartmentJson};
CourseDepartmentImpl d = (CourseDepartmentImpl) sm.execute(RequestUtils.getRequester(request, response), "RemoveCourseDepartment", args, names);
JSONObject tJson = d.getJsonObject();
JSONObject tJson = d.toJsonObject();
addMessage(request, "course.removed.department.success", d.getName());
return tJson;
}
48,7 → 48,7
String[] names = new String[]{};
Object[] args = new Object[]{};
CourseDepartmentImpl d = (CourseDepartmentImpl) sm.execute(RequestUtils.getRequester(request, response), "NewCourseDepartment", args, names);
JSONObject tJson = d.getJsonObject();
JSONObject tJson = d.toJsonObject();
addMessage(request,"course.new.department.success",d.getName());
return tJson;
}
/branches/v3/impl/src/java/pt/estgp/estgweb/web/controllers/courses/CourseSchoolController.java
24,7 → 24,7
String[] names = new String[]{};
Object[] args = new Object[]{courseSchoolJson};
CourseSchoolImpl s = (CourseSchoolImpl) sm.execute(RequestUtils.getRequester(request, response), "UpdateCourseSchool", args, names);
JSONObject tJson = s.getJsonObject();
JSONObject tJson = s.toJsonObject();
addMessage(request,"course.update.school.success",s.getName());
return tJson;
}
37,7 → 37,7
String[] names = new String[]{};
Object[] args = new Object[]{courseSchoolJson};
CourseSchoolImpl s = (CourseSchoolImpl) sm.execute(RequestUtils.getRequester(request, response), "RemoveCourseSchool", args, names);
JSONObject tJson = s.getJsonObject();
JSONObject tJson = s.toJsonObject();
addMessage(request, "course.removed.school.success", s.getName());
return tJson;
}
48,7 → 48,7
String[] names = new String[]{};
Object[] args = new Object[]{};
CourseSchoolImpl s = (CourseSchoolImpl) sm.execute(RequestUtils.getRequester(request, response), "NewCourseSchool", args, names);
JSONObject tJson = s.getJsonObject();
JSONObject tJson = s.toJsonObject();
addMessage(request,"course.new.school.success",s.getName());
return tJson;
}
/branches/v3/impl/src/java/pt/estgp/estgweb/web/controllers/utils/FilesUploadResult.java
37,11 → 37,6
public static Genson getGenson()
{
return new Genson.Builder()
.include(Boolean.class)
.include(Integer.class)
.include(Long.class)
.include(Double.class)
.include(Float.class)
.include(FilesUploadResult.class)
.include(FileUploaded.class)
.create();
/branches/v3/impl/src/java/pt/estgp/estgweb/web/controllers/configuration/ConfigurationsController.java
187,7 → 187,7
String[] names = new String[]{};
Object[] args = new Object[]{};
ConfigurationSeparatorImpl c = (ConfigurationSeparatorImpl) sm.execute(RequestUtils.getRequester(request, response), "NewConfigurationSeparator", args, names);
JSONObject tJson = c.getJsonObject();
JSONObject tJson = c.toJsonObject();
addMessage(request,"config.new.configuration.separator.success");
return tJson;
}
198,7 → 198,7
String[] names = new String[]{};
Object[] args = new Object[]{configSeparatorJson};
ConfigurationSeparatorImpl s = (ConfigurationSeparatorImpl) sm.execute(RequestUtils.getRequester(request, response), "UpdateConfigurationSeparator", args, names);
JSONObject tJson = s.getJsonObject();
JSONObject tJson = s.toJsonObject();
addMessage(request,"config.update.configuration.separator.success",s.getName());
return tJson;
}
209,7 → 209,7
String[] names = new String[]{};
Object[] args = new Object[]{configSeparatorJson};
ConfigurationSeparatorImpl s = (ConfigurationSeparatorImpl) sm.execute(RequestUtils.getRequester(request, response), "RemoveConfigurationSeparator", args, names);
JSONObject tJson = s.getJsonObject();
JSONObject tJson = s.toJsonObject();
addMessage(request, "config.removed.configuration.separator.success", s.getName());
return tJson;
}
/branches/v3/impl/src/web/admin/courses/departments.jsp
20,10 → 20,10
AbstractDao.getCurrentSession().beginTransaction();
 
ArrayList<CourseDepartment> departments = (ArrayList<CourseDepartment>) DaoFactory.getCourseDepartmentDaoImpl().findAll();
String jsonArrayDepartments = CourseDepartmentImpl.getJson(departments);
String jsonArrayDepartments = CourseDepartmentImpl.toJson(departments);
 
ArrayList<CourseSchool> schools = (ArrayList<CourseSchool>) DaoFactory.getCourseSchoolDaoImpl().findAll();
String jsonArraySchools = CourseSchoolImpl.getJson(schools);
String jsonArraySchools = CourseSchoolImpl.toJson(schools);
 
 
request.setAttribute("jsonArrayDepartments",jsonArrayDepartments);
/branches/v3/impl/src/web/admin/courses/schools.jsp
18,7 → 18,7
AbstractDao.getCurrentSession().beginTransaction();
 
ArrayList<CourseSchool> schools = (ArrayList<CourseSchool>) DaoFactory.getCourseSchoolDaoImpl().findAll();
String jsonArraySchools = CourseSchoolImpl.getJson(schools);
String jsonArraySchools = CourseSchoolImpl.toJson(schools);
 
 
request.setAttribute("jsonArraySchools",jsonArraySchools);
/branches/v3/impl/src/web/admin/configuration/configSeparators.jsp
21,10 → 21,10
AbstractDao.getCurrentSession().beginTransaction();
 
ArrayList<CourseSchool> schools = (ArrayList<CourseSchool>) DaoFactory.getCourseSchoolDaoImpl().findAll();
String jsonArraySchools = CourseSchoolImpl.getJson(schools);
String jsonArraySchools = CourseSchoolImpl.toJson(schools);
 
ArrayList<ConfigurationSeparator> seps = (ArrayList<ConfigurationSeparator>) DaoFactory.getConfigurationSeparatorDaoImpl().findAll();
String jsonArraySeps = ConfigurationSeparatorImpl.getJson(seps);
String jsonArraySeps = ConfigurationSeparatorImpl.toJson(seps);
 
 
request.setAttribute("jsonArraySchools",jsonArraySchools);