001/* 002 * (C) Copyright 2006-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: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $ 020 */ 021 022package org.nuxeo.ecm.platform.picture.web; 023 024import java.io.IOException; 025import java.util.ArrayList; 026 027import org.nuxeo.ecm.core.api.Blob; 028import org.nuxeo.ecm.platform.url.api.DocumentView; 029 030/** 031 * Provides picture-related actions. 032 * 033 * @author <a href="mailto:ldoguin@nuxeo.com">Laurent Doguin</a> 034 */ 035public interface PictureManager { 036 037 /** 038 * Creates and saves a picture document. 039 * 040 * @deprecated since 5.5 041 */ 042 @Deprecated 043 String addPicture(); 044 045 String crop() throws IOException; 046 047 /** 048 * Turns every view of a picture 90 degrees to the left. 049 */ 050 String rotate90left() throws IOException; 051 052 /** 053 * Turns every view of a picture 90 degrees to the right. 054 */ 055 String rotate90right() throws IOException; 056 057 void download(DocumentView docView); 058 059 /** 060 * Gets the content of the Picture. It's the uploaded file. 061 * 062 * @return a Blob holding the uploaded file 063 */ 064 Blob getFileContent(); 065 066 /** 067 * Sets the content of the Picture. It's the uploaded file. 068 * 069 * @param fileContent a Blob holding the uploaded file 070 */ 071 void setFileContent(Blob fileContent); 072 073 /** 074 * Gets the filename of the uploaded file. 075 * 076 * @return a String holding the filename. 077 */ 078 String getFilename(); 079 080 /** 081 * Sets the filename of the uploaded file. 082 * 083 * @param filename a String holding the filename. 084 */ 085 void setFilename(String filename); 086 087 /** 088 * Gets the fileurl. FileUrl is used to create valid link expression for the download function from the index of the 089 * picture's views. 090 * 091 * @return a String holding the fileurl. 092 */ 093 String getFileurlPicture(); 094 095 /** 096 * Sets the fileurl. FileUrl is used to create valid link expression for the download function from the index of the 097 * picture's views. 098 * 099 * @param fileurlPicture a String holding the fileurl. 100 */ 101 void setFileurlPicture(String fileurlPicture); 102 103 /** 104 * Gets the index. This index is used to display the selected picture in view_picture. 105 * 106 * @return an Integer holding the index. 107 */ 108 Integer getIndex(); 109 110 /** 111 * Sets the index. This index is used to display the selected picture in view_picture. 112 * 113 * @param index an Integer holding the index. 114 */ 115 void setIndex(Integer index); 116 117 /** 118 * Sets the selectedItems. This array contains an index and the title of each picture's view. It's used to 119 * dynamically the selected view. 120 * 121 * @param selectItems an Array holding the selectItems. 122 */ 123 void setSelectItems(ArrayList selectItems); 124 125 /** 126 * Gets the selectedItems. This array contains an index and the title of each picture's view. It's used to 127 * dynamically the selected view. 128 * 129 * @return an Array holding the selectItems. 130 */ 131 ArrayList getSelectItems(); 132 133 String getCropCoords(); 134 135 void setCropCoords(String cropCoords); 136 137 /** 138 * Listener reinitializing values at every Document changes. 139 */ 140 void resetFields(); 141 142 void initialize(); 143 144 void destroy(); 145 146}