1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package org.apache.chemistry.opencmis.client.api; 20 21 import java.util.List; 22 23 /** 24 * Fileable CMIS object. 25 * 26 * A fileable object is an object that can reside in a folder. 27 */ 28 public interface FileableCmisObject extends CmisObject { 29 30 // object service 31 32 /** 33 * Moves this object. 34 * 35 * @param sourceFolderId 36 * the object ID of the source folder 37 * @param targetFolderId 38 * the object ID of the target folder 39 * 40 * @return the moved object 41 * 42 * @cmis 1.0 43 */ 44 FileableCmisObject move(ObjectId sourceFolderId, ObjectId targetFolderId); 45 46 /** 47 * Moves this object. 48 * 49 * @param sourceFolderId 50 * the object ID of the source folder 51 * @param targetFolderId 52 * the object ID of the target folder 53 * @param context 54 * the {@link OperationContext} to use to fetch the moved object 55 * 56 * @return the moved object 57 * 58 * @cmis 1.0 59 */ 60 FileableCmisObject move(ObjectId sourceFolderId, ObjectId targetFolderId, OperationContext context); 61 62 // navigation service 63 64 /** 65 * Returns the parents of this object. 66 * 67 * @return the list of parent folders of this object or an empty list if 68 * this object is unfiled or if this object is the root folder 69 * 70 * @cmis 1.0 71 */ 72 List<Folder> getParents(); 73 74 /** 75 * Returns the parents of this object. 76 * 77 * @param context 78 * the {@link OperationContext} to use to fetch the parent folder 79 * objects 80 * 81 * @return the list of parent folders of this object or an empty list if 82 * this object is unfiled or if this object is the root folder 83 * 84 * @cmis 1.0 85 */ 86 List<Folder> getParents(OperationContext context); 87 88 /** 89 * Returns the paths of this object. 90 * 91 * @return the list of paths of this object or an empty list if this object 92 * is unfiled or if this object is the root folder 93 * 94 * @cmis 1.0 95 */ 96 List<String> getPaths(); 97 98 // multifiling service 99 100 /** 101 * Adds this object to a folder. 102 * 103 * @param folderId 104 * the object ID of the folder to which this object should be 105 * added 106 * @param allVersions 107 * if this parameter is {@code true} and this object is a 108 * document, all versions of the version series are added to the 109 * folder 110 * 111 * @cmis 1.0 112 */ 113 void addToFolder(ObjectId folderId, boolean allVersions); 114 115 /** 116 * Removes this object from a folder. 117 * 118 * @param folderId 119 * the object ID of the folder from which this object should be 120 * removed 121 * 122 * @cmis 1.0 123 */ 124 void removeFromFolder(ObjectId folderId); 125 }