001/* 002 * (C) Copyright 2007 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Nuxeo - initial API and implementation 018 * 019 * $Id$ 020 */ 021 022package org.nuxeo.ecm.platform.api.ws; 023 024 025/** 026 * Nuxeo EP remoting API. 027 * 028 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a> 029 */ 030public interface NuxeoRemoting extends BaseNuxeoWebService { 031 032 /** 033 * Gets the current repository name. 034 * 035 * @param sid the session id 036 * @return the repository name 037 */ 038 String getRepositoryName(String sid); 039 040 /** 041 * Gets the root document descriptor. 042 * 043 * @return the root document 044 */ 045 DocumentDescriptor getRootDocument(String sessionId); 046 047 /** 048 * Gets the doc descriptor given the doc UUID. 049 * 050 * @param sessionId the session id 051 * @param uuid the doc uuid 052 * @return the descriptor 053 */ 054 DocumentDescriptor getDocument(String sessionId, String uuid); 055 056 /** 057 * Gets the children of the given document. 058 * 059 * @param sessionId the session id 060 * @param uuid the doc uuid 061 * @return the children descriptors 062 */ 063 DocumentDescriptor[] getChildren(String sessionId, String uuid); 064 065 /** 066 * Returns the relative path as a displayable path with parent titles. 067 * <p> 068 * Example: <i>/Workspaces/My Workspaces/Nice Document</i> 069 * 070 * @param sessionId : the session id 071 * @param uuid : the document uuid 072 * @return a relative path 073 */ 074 String getRelativePathAsString(String sessionId, String uuid); 075 076 /** 077 * Gets the versions of the given document. 078 * 079 * @param sid 080 * @param uid 081 * @return 082 */ 083 DocumentDescriptor[] getVersions(String sid, String uid); 084 085 /** 086 * Gets the current version of the given document. 087 * 088 * @param sid 089 * @return 090 */ 091 DocumentDescriptor getCurrentVersion(String sid, String uid); 092 093 /** 094 * Gets the document that created the version specified by the given uid. 095 * 096 * @param sid 097 * @param uid 098 * @return 099 */ 100 DocumentDescriptor getSourceDocument(String sid, String uid); 101 102 /** 103 * Returns the document properties. 104 * <p> 105 * All property are returned even blobs. All values are converted to strings. 106 * <p> 107 * It includes the perm link of the document. 108 * <p> 109 * No need to includes blobs here. See the dedicated API. 110 * 111 * @param uuid uuid of the document. 112 * @return a map from name of the property to its value 113 */ 114 DocumentProperty[] getDocumentProperties(String sid, String uuid); 115 116 /** 117 * Same as {@link #getDocumentProperties(String, String)} but skips blobs. 118 * 119 * @param sid 120 * @param uuid 121 * @return 122 */ 123 DocumentProperty[] getDocumentNoBlobProperties(String sid, String uuid); 124 125 /** 126 * Returns the document blobs only using byte[] format 127 * 128 * @param uuid the uuid of the document. 129 * @return an array of document blob instances. 130 */ 131 DocumentBlob[] getDocumentBlobs(String sid, String uuid); 132 133 /** 134 * Returns the document blobs only. 135 * 136 * @param uuid the uuid of the document. 137 * @param useDownloadUrl defines if blob are exported as download url or as byte|[] 138 * @return an array of document blob instances. 139 */ 140 DocumentBlob[] getDocumentBlobsExt(String sid, String uuid, boolean useDownloadUrl); 141 142 /** 143 * Returns the merged ACL of the document (contains all ACEs defined on the document and its parents). 144 * <p> 145 * It includes all ACLs for each ACP. 146 * 147 * @param uuid the uuid of the document 148 * @return the ordered list of ACLs 149 */ 150 WsACE[] getDocumentACL(String sid, String uuid); 151 152 /** 153 * Returns the merged ACL of the document (contains all ACEs defined on the document, filtering the inherited ones). 154 * <p> 155 * It includes all ACLs for each ACP. 156 * 157 * @param uuid the uuid of the document 158 * @return the ordered list of ACLs 159 */ 160 WsACE[] getDocumentLocalACL(String sid, String uuid); 161 162 /** 163 * Checks the given permission for the current user on the given document. 164 * 165 * @param sid 166 * @param uuid 167 * @param permission 168 * @return 169 */ 170 boolean hasPermission(String sid, String uuid, String permission); 171 172 /** 173 * Returns the list of all users. 174 * <p> 175 * This method supports pagination in case of large user dbs. 176 * <p> 177 * <b>Pagination is not yet working!</b> 178 * 179 * @param from pagination start 180 * @param to pagination stop 181 * @return an array of principal names 182 */ 183 String[] listUsers(String sid, int from, int to); 184 185 /** 186 * Return the list of all groups. 187 * <p> 188 * This method supports pagination in case of large user dbs 189 * <p> 190 * <b>Pagination is not yet working!</b> 191 * 192 * @param from pagination start 193 * @param to pagination stop 194 * @return an array of group names 195 */ 196 String[] listGroups(String sid, int from, int to); 197 198 /** 199 * Get all users inside the given group. If the group is null then return all users in the system. 200 * 201 * @param sid the session id 202 * @param parentGroup the parent group 203 */ 204 String[] getUsers(String sid, String parentGroup); 205 206 /** 207 * Gets all sub-groups inside the given group. If the parent group is null returns all top level groups. 208 * 209 * @param sid the session id 210 * @param parentGroup the parent group 211 * @return 212 */ 213 String[] getGroups(String sid, String parentGroup); 214 215 String uploadDocument(String sid, String path, String type, String[] properties); 216 217 /** 218 * Gets all properties and ACLs from a document uses byte[] format to export blob 219 * 220 * @param sid the session id 221 * @param uuid the doc uuid 222 * @return 223 */ 224 DocumentSnapshot getDocumentSnapshot(String sid, String uuid); 225 226 /** 227 * Gets all properties and ACLs from a document 228 * 229 * @param sid the session id 230 * @param uuid the doc uuid 231 * @param useDownloadUrl define blob export format 232 * @return 233 */ 234 DocumentSnapshot getDocumentSnapshotExt(String sid, String uuid, boolean useDownloadUrl); 235}