Rev 1732 | Rev 1736 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1732 | Rev 1735 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | import pt.utl.ist.berserk.logic.serviceManager.IService; |
24 | import pt.utl.ist.berserk.logic.serviceManager.IService; |
25 | 25 | ||
26 | import java.io.FileInputStream; |
26 | import java.io.FileInputStream; |
27 | import java.io.FileNotFoundException; |
27 | import java.io.FileNotFoundException; |
28 | import java.io.IOException; |
28 | import java.io.IOException; |
29 | import java.util.ArrayList; |
- | |
30 | import java.util.HashSet; |
- | |
31 | import java.util.List; |
- | |
32 | import java.util.Set; |
29 | import java.util.*; |
33 | 30 | ||
34 | /** |
31 | /** |
35 | * Created by jorgemachado on 23/02/17. |
32 | * Created by jorgemachado on 23/02/17. |
36 | */ |
33 | */ |
37 | public class RepositoryDocumentService implements IService |
34 | public class RepositoryDocumentService implements IService |
Line 201... | Line 198... | ||
201 | { |
198 | { |
202 | throw new NotAuthorizedException("Já existe um documento com o mesmo titulo na colecção"); |
199 | throw new NotAuthorizedException("Já existe um documento com o mesmo titulo na colecção"); |
203 | } |
200 | } |
204 | persistent = DomainObjectFactory.createRepositoryDocumentImpl(); |
201 | persistent = DomainObjectFactory.createRepositoryDocumentImpl(); |
205 | DaoFactory.getRepositoryDocumentDaoImpl().save(persistent); |
202 | DaoFactory.getRepositoryDocumentDaoImpl().save(persistent); |
- | 203 | persistent.setOwner(userSession.getUser()); |
|
206 | } |
204 | } |
207 | else |
205 | else |
208 | { |
206 | { |
209 | persistent = (RepositoryDocumentImpl) DaoFactory.getRepositoryDocumentDaoImpl().get(view.getId()); |
207 | persistent = (RepositoryDocumentImpl) DaoFactory.getRepositoryDocumentDaoImpl().get(view.getId()); |
- | 208 | 1.5.0/docs/api/java/lang/String.html">String history = persistent.getHistoryEdit(); |
|
- | 209 | if(history == null) |
|
- | 210 | history = ""; |
|
- | 211 | else |
|
- | 212 | history = history + ";\n"; |
|
- | 213 | history = history + "Edited by " + userSession.getUser().getUsername() + " : " + userSession.getUser().getName() + " : " + userSession.getUser().getId() + " - at " + new 5+0%2Fdocs%2Fapi+Date">Date().toString(); |
|
- | 214 | persistent.setHistoryEdit(history); |
|
210 | } |
215 | } |
211 | 216 | ||
212 | persistent.setContributorsJson(view.getContributorsJson()); |
217 | persistent.setContributorsJson(view.getContributorsJson()); |
213 | persistent.setAuthorsJson(view.getAuthorsJson()); |
218 | persistent.setAuthorsJson(view.getAuthorsJson()); |
214 | persistent.setTitle(view.getTitle()); |
219 | persistent.setTitle(view.getTitle()); |