1 /********************************************** 2 * Copyright (C) 2009 Lukas Laag 3 * This file is part of Vectomatic. 4 * 5 * Vectomatic is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * Vectomatic is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with Vectomatic. If not, see http://www.gnu.org/licenses/ 17 **********************************************/ 18 package org.vectomatic.common.rpc; 19 20 21 import com.google.gwt.user.client.rpc.RemoteService; 22 23 /** 24 * Service interface to manage drawings 25 * @author Lukas Laag 26 */ 27 public interface IDrawingService extends RemoteService { 28 /** 29 * Returns all the drawings owned by the session 30 * @param jsessionid 31 * The session id 32 * @return 33 * All the drawings owned by the session 34 * @throws AccountServiceException 35 * If a session related error occurs 36 * @throws InternalServerException 37 * If the server code fails 38 */ 39 Drawing[] getDrawings(String jsessionid) throws AccountServiceException; 40 41 /** 42 * Creates a new drawing 43 * @param jsessionid 44 * The session id 45 * @param name 46 * The drawing name (usually: "Untitled") 47 * @return 48 * A new drawing 49 * @throws AccountServiceException 50 * If a session related error occurs 51 * @throws InternalServerException 52 * If the server code fails 53 * @throws DrawingServiceException 54 * If the server quota is exceeded 55 */ 56 Drawing newDrawing(String jsessionid, String name) throws AccountServiceException, DrawingServiceException; 57 58 /** 59 * Renames a drawing 60 * @param jsessionid 61 * The session id 62 * @param drawingid 63 * The drawing id 64 * @param newName 65 * The drawing new name 66 * @throws AccountServiceException 67 * If a session related error occurs 68 * @throws InternalServerException 69 * If the server code fails 70 * @throws DrawingServiceException 71 * If the drawing no longer exists 72 */ 73 void renameDrawing(String jsessionid, String drawingid, String newName) throws AccountServiceException, DrawingServiceException; 74 75 /** 76 * Deletes drawings 77 * @param jsessionid 78 * The session id 79 * @param drawingids 80 * An array of drawing ids. Invalid drawing ids are ignored 81 * @throws AccountServiceException 82 * If a session related error occurs 83 * @throws InternalServerException 84 * If the server code fails 85 */ 86 void deleteDrawings(String jsessionid, String[] drawingids) throws AccountServiceException; 87 88 /** 89 * Duplicates a drawing 90 * @param jsessionid 91 * The session id 92 * @param drawingid 93 * The drawing id 94 * @param newName 95 * The duplicate name (usually: "Copy of") 96 * @return 97 * The drawing duplicate. 98 * @throws AccountServiceException 99 * If a session related error occurs 100 * @throws InternalServerException 101 * If the server code fails 102 * @throws DrawingServiceException 103 * If the drawing no longer exists or the server quota has been exceeded 104 */ 105 Drawing duplicateDrawing(String jsessionid, String drawingid, String newName) throws AccountServiceException, DrawingServiceException; 106 107 /** 108 * Publishes / unpublishes a drawing 109 * @param jsessionid 110 * The session id 111 * @param drawingid 112 * The drawing id 113 * @param boolean 114 * true to publish the drawing, false to unpublish it 115 * @throws AccountServiceException 116 * If a session related error occurs 117 * @throws InternalServerException 118 * If the server code fails 119 * @throws DrawingServiceException 120 * If the drawing no longer exists 121 */ 122 void publishDrawing(String jsessionid, String drawingid, boolean published) throws AccountServiceException, DrawingServiceException; 123 }