Skip to content
Snippets Groups Projects
Commit 77cc0086 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

some unnecessary functions removed

parent 2d2d6124
No related branches found
No related tags found
No related merge requests found
package lcsb.mapviewer.services.interfaces; package lcsb.mapviewer.services.interfaces;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.List; import java.util.List;
import lcsb.mapviewer.model.map.Comment; import lcsb.mapviewer.model.map.Comment;
import lcsb.mapviewer.model.map.model.Model; import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelData; import lcsb.mapviewer.model.map.model.ModelData;
import lcsb.mapviewer.model.user.User; import lcsb.mapviewer.model.user.User;
import lcsb.mapviewer.services.search.ElementIdentifierDetails; import lcsb.mapviewer.services.search.ElementIdentifierDetails;
import lcsb.mapviewer.services.search.comment.FullCommentView; import lcsb.mapviewer.services.search.comment.FullCommentView;
import lcsb.mapviewer.services.search.data.ElementIdentifier; import lcsb.mapviewer.services.search.data.ElementIdentifier;
import lcsb.mapviewer.services.view.CommentView; import lcsb.mapviewer.services.view.CommentView;
/** /**
* Service responsible for comments functionality. * Service responsible for comments functionality.
* *
* @author Piotr Gawron * @author Piotr Gawron
* *
*/ */
public interface ICommentService { public interface ICommentService {
/** /**
* Adds comment to the map. * Adds comment to the map.
* *
* @param pinned * @param pinned
* parameter that defines if comment should be visible on the map. * parameter that defines if comment should be visible on the map.
* @param object * @param object
* determines which object is commented - it could be null; in this * determines which object is commented - it could be null; in this
* case it means that a comment is general one. * case it means that a comment is general one.
* @param name * @param name
* name of person that comments * name of person that comments
* @param email * @param email
* email of the person that comments * email of the person that comments
* @param content * @param content
* content of the comment * content of the comment
* @param model * @param model
* which map we comment on * which map we comment on
* @param submodel * @param submodel
* on which submodel we comment on * on which submodel we comment on
* @param coordinates * @param coordinates
* where exactly the comment should be placed on * where exactly the comment should be placed on
* *
* @return comment object created based on the data provided as parameters * @return comment object created based on the data provided as parameters
*/ */
Comment addComment(String name, String email, String content, Model model, Point2D coordinates, Object object, boolean pinned, Model submodel); Comment addComment(String name, String email, String content, Model model, Point2D coordinates, Object object, boolean pinned, Model submodel);
/** /**
* This method remove comment. Comment is not removed from the system, only * This method remove comment. Comment is not removed from the system, only
* 'deleted' flag is set. * 'deleted' flag is set.
* *
* @param loggedUser * @param loggedUser
* user that wants to remove the comment * user that wants to remove the comment
* @param commentId * @param commentId
* identifier of the comment that user wants to remove * identifier of the comment that user wants to remove
* @param reason * @param reason
* why user wants to remove the comment * why user wants to remove the comment
*/ */
void deleteComment(User loggedUser, String commentId, String reason); void deleteComment(User loggedUser, String commentId, String reason);
/** /**
* Method returns all comments for a given map. * Method returns all comments for a given map.
* *
* @param model * @param model
* given map * given map
* @return list of the comments to the map * @return list of the comments to the map
*/ */
List<CommentView> getCommentsByMap(Model model); List<CommentView> getCommentsByMap(Model model);
/** /**
* Returns number of comments in the system. * Returns number of comments in the system.
* *
* @return number of comments in the system * @return number of comments in the system
*/ */
long getCommentCount(); long getCommentCount();
/** /**
* *
* Sometimes we have to dump all coments from the model without information * Sometimes we have to dump all coments from the model without information
* about primary keys in the database. This method is responsible for this * about primary keys in the database. This method is responsible for this
* task (it changes all PK into identifiers used by external source). * task (it changes all PK into identifiers used by external source).
* *
* @param comment * @param comment
* comment to serialize * comment to serialize
* @return serialized string of the comment * @return serialized string of the comment
*/ */
String createCustomSerializationOfComment(Comment comment); String createCustomSerializationOfComment(Comment comment);
/** /**
* Method used for deserialization of comment. Serialized object doesn't have * Method used for deserialization of comment. Serialized object doesn't have
* information about primary/foreign keys (only identifiers from external * information about primary/foreign keys (only identifiers from external
* sources) - this information must be restored from DB. * sources) - this information must be restored from DB.
* *
* @param serializedComment * @param serializedComment
* serialized comment * serialized comment
* @return Comment after deserialization * @return Comment after deserialization
*/ */
Comment deserializeCustomSerializationOfComment(String serializedComment); Comment deserializeCustomSerializationOfComment(String serializedComment);
/** /**
* Removes comments from the model. * Removes comments from the model.
* *
* @param model * @param model
* from which model we want to remove comments * from which model we want to remove comments
*/ */
void removeCommentsForModel(Model model); void removeCommentsForModel(Model model);
/** /**
* Creates file with backup of comments. * This method returns marker for all comments in a model.
* *
* @param filename * @param model
* where save backup file * object to which we are looking for comments
* @param model * @return list of markers for comments
* model for which we are interested in comments */
*/ List<FullCommentView> getCommentMarkers(Model model);
void prepareCommentBackup(String filename, Model model);
/**
/** * Removes comments from the model.
* Restore comments from backup. *
* * @param model
* @param filename * from which model we want to remove comments
* where is the backup file */
* @param model void removeCommentsForModel(ModelData model);
* model for which we are interested in comments
*/ /**
void restoreCommentsFromBackup(String filename, Model model); * Returns detailed comment information about element.
*
/** * @param element
* This method returns marker for all comments in a model. * element for which we are looking for comments
* * @param model
* @param model * model where we are looking for comments
* object to which we are looking for comments * @return detailed comment information about element
* @return list of markers for comments */
*/ List<ElementIdentifierDetails> getElementInformationForResult(ElementIdentifier element, Model model);
List<FullCommentView> getCommentMarkers(Model model);
}
/**
* Removes comments from the model.
*
* @param model
* from which model we want to remove comments
*/
void removeCommentsForModel(ModelData model);
/**
* Returns detailed comment information about element.
*
* @param element
* element for which we are looking for comments
* @param model
* model where we are looking for comments
* @return detailed comment information about element
*/
List<ElementIdentifierDetails> getElementInformationForResult(ElementIdentifier element, Model model);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment