Class ImageRepository
- java.lang.Object
-
- de.narimo.georepo.server.repository.ImageRepository
-
public class ImageRepository extends Object
-
-
Constructor Summary
Constructors Constructor Description ImageRepository()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StringacceptNewImageOrDocument(String imagesTable, String diffImagesTable, int gfid, String diffDocumentFilename, DocumentType documentType)Accept an image from an images diff table.static booleancheckImageDiffTableExists(int layerId)Checks, if a image diff table exist for a given layer id.static booleancheckImageTableExists(int layerId)Checks, whether an image table exists for a given layer id.static voidcreateImageDiffTable(int layerId)Creates an image diff table from the structure of an image table.static voidcreateImageTable(int layerId)Creates a table that stores images related to a POI of the layer that this table is related to.static StringdeclineNewImageOrDocument(String imagesTable, String diffImagesTable, int gfid, String diffDocumentFilename, DocumentType documentType)static List<FeatureDocument>getDiffFeatureImagesOrDocuments(de.narimo.commons.dto.User requestingUser, String workspace, int layerId, DocumentType documentType)static List<String>getFeatureImages(int layerId, int gfid)Deprecated.does not return image description.static List<FeatureDocument>getFeatureImagesOrDocuemnts(de.narimo.commons.dto.User requestingUser, String workspace, int layerId, int gfid, DocumentType documentType)Retrieves a list of documents with related information for each feature.static intinsertUnreviewedImage(int layerId, Integer userId, int gfid, String generatedFilename, DocumentType documentType, String description)Inserts a new image and returns its id.static booleanisImageFromFeature(int layerId, int gfid, String filename, boolean diffFeature)Check, if there is an image with the given name for the given layer and feature.
-
-
-
Method Detail
-
createImageTable
public static void createImageTable(int layerId) throws SQLException, IOExceptionCreates a table that stores images related to a POI of the layer that this table is related to.- Parameters:
layerId-- Throws:
SQLExceptionIOException
-
createImageDiffTable
public static void createImageDiffTable(int layerId) throws SQLException, IOExceptionCreates an image diff table from the structure of an image table. And adds a grpstatus column.- Parameters:
dataTable-- Throws:
SQLExceptionIOException
-
checkImageTableExists
public static boolean checkImageTableExists(int layerId) throws SQLException, IOExceptionChecks, whether an image table exists for a given layer id.- Parameters:
layerId-- Returns:
- Throws:
SQLExceptionIOException
-
checkImageDiffTableExists
public static boolean checkImageDiffTableExists(int layerId) throws SQLException, IOExceptionChecks, if a image diff table exist for a given layer id.- Parameters:
layerId-- Returns:
- Throws:
SQLExceptionIOException
-
insertUnreviewedImage
public static int insertUnreviewedImage(int layerId, Integer userId, int gfid, String generatedFilename, DocumentType documentType, String description) throws SQLException, IOExceptionInserts a new image and returns its id.- Parameters:
layerId-userId-gfid-generatedFilename-- Returns:
- Throws:
SQLExceptionIOException
-
getFeatureImages
public static List<String> getFeatureImages(int layerId, int gfid) throws SQLException, IOException
Deprecated.does not return image description. Use getFeatureImagesOrDocuemnts instead. Retrieves a list of image names for a feature.- Parameters:
layerId-gfid-- Returns:
- Throws:
SQLExceptionIOException
-
getFeatureImagesOrDocuemnts
public static List<FeatureDocument> getFeatureImagesOrDocuemnts(de.narimo.commons.dto.User requestingUser, String workspace, int layerId, int gfid, DocumentType documentType) throws SQLException
Retrieves a list of documents with related information for each feature.- Parameters:
layerId-gfid-documentType-- Returns:
- Throws:
SQLExceptionIOException
-
acceptNewImageOrDocument
public static String acceptNewImageOrDocument(String imagesTable, String diffImagesTable, int gfid, String diffDocumentFilename, DocumentType documentType) throws IOException
Accept an image from an images diff table.- Parameters:
imagesTable-diffImagesTable-gfid-diffImageId-- Throws:
IOException
-
declineNewImageOrDocument
public static String declineNewImageOrDocument(String imagesTable, String diffImagesTable, int gfid, String diffDocumentFilename, DocumentType documentType) throws IOException
- Throws:
IOException
-
isImageFromFeature
public static boolean isImageFromFeature(int layerId, int gfid, String filename, boolean diffFeature) throws SQLException, IOExceptionCheck, if there is an image with the given name for the given layer and feature.- Parameters:
layerId-gfid-filename-- Returns:
- Throws:
SQLExceptionIOException
-
getDiffFeatureImagesOrDocuments
public static List<FeatureDocument> getDiffFeatureImagesOrDocuments(de.narimo.commons.dto.User requestingUser, String workspace, int layerId, DocumentType documentType) throws SQLException
- Throws:
SQLException
-
-