Subversion Repositories bacoAlunos

Rev

Rev 1711 | Rev 1725 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1711 Rev 1719
Line 128... Line 128...
128
 
128
 
129
        return persistent.toJsonObject();
129
        return persistent.toJsonObject();
130
    }
130
    }
131
 
131
 
132
 
132
 
-
 
133
    public JSONArray checkRepositoryDocumentExistence(1.5.0/docs/api/java/lang/String.html">String docJson, UserSession userSession) throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException, JSONException, AccessDeniedException, NotAuthorizedException
-
 
134
    {
-
 
135
        JSONArray found = new JSONArray();
-
 
136
        RepositoryDocumentImpl view = RepositoryDocumentImpl.loadFromJson(docJson);
-
 
137
        List<RepositoryDocumentImpl> documents = DaoFactory.getRepositoryDocumentDaoImpl().findDocumentsByTitle(view.getTitle());
-
 
138
        if(documents.size() > 0)
-
 
139
        {
-
 
140
            for(RepositoryDocumentImpl doc: documents)
-
 
141
            {
-
 
142
                found.put(doc.toJsonObject());
-
 
143
            }
-
 
144
        }
-
 
145
        return found;
-
 
146
    }
-
 
147
 
133
    public JSONObject saveRepositoryDocument(1.5.0/docs/api/java/lang/String.html">String docJson, FilesUploadResult uploadedFiles, UserSession userSession) throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException, JSONException, AccessDeniedException, NotAuthorizedException {
148
    public JSONObject saveRepositoryDocument(1.5.0/docs/api/java/lang/String.html">String docJson, FilesUploadResult uploadedFiles, UserSession userSession) throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException, JSONException, AccessDeniedException, NotAuthorizedException {
134
 
149
 
135
        RepositoryDocumentImpl view = RepositoryDocumentImpl.loadFromJson(docJson);
150
        RepositoryDocumentImpl view = RepositoryDocumentImpl.loadFromJson(docJson);
136
 
151
 
137
        if(view.getCollection() == null || view.getCollection().getId() <= 0)
152
        if(view.getCollection() == null || view.getCollection().getId() <= 0)