Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1735 → Rev 1736

/branches/v3/impl/src/java/pt/estgp/estgweb/services/data/repositorydocuments/RepositoryDocumentService.java
53,7 → 53,11
{
long documentId = documentIds.getLong(i);
RepositoryDocument document = DaoFactory.getRepositoryDocumentDaoImpl().get(documentId);
long old = -1;
if(document.getCollection() != null)
old = document.getCollection().getId();
document.setCollection((RepositoryDocumentCollectionImpl) newCollection);
addHistoryLine(userSession, document,"Change collection by " + userSession.getUser().getUsername() + " : " + userSession.getUser().getName() + " : " + userSession.getUser().getId() + " - at " + new Date().toString() + " from collection: " + old + " to " + newCollectionId);
}
}
 
205,13 → 209,7
else
{
persistent = (RepositoryDocumentImpl) DaoFactory.getRepositoryDocumentDaoImpl().get(view.getId());
String history = persistent.getHistoryEdit();
if(history == null)
history = "";
else
history = history + ";\n";
history = history + "Edited by " + userSession.getUser().getUsername() + " : " + userSession.getUser().getName() + " : " + userSession.getUser().getId() + " - at " + new Date().toString();
persistent.setHistoryEdit(history);
addHistoryLine(userSession, persistent,"Edited by " + userSession.getUser().getUsername() + " : " + userSession.getUser().getName() + " : " + userSession.getUser().getId() + " - at " + new Date().toString());
}
 
persistent.setContributorsJson(view.getContributorsJson());
357,7 → 355,17
return persistent.toJsonObject();
}
 
private void addHistoryLine(UserSession userSession, RepositoryDocument persistent, String line) {
String history = persistent.getHistoryEdit();
if(history == null)
history = "";
else
history = history + ";\n";
history = history + line;
persistent.setHistoryEdit(history);
}
 
 
public JSONArray loadCollectionsOrderedAsTree() throws JSONException, TransformationException, IOException {
ArrayList<RepositoryDocumentCollectionImpl> collections = new ArrayList<RepositoryDocumentCollectionImpl>();
List<RepositoryDocumentCollection> collectionsRoots = DaoFactory.getRepositoryDocumentCollectionDaoImpl().findRoots();