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 Modifier and Type Method Description static StringacceptNewImageOrDocument(String imagesTable, String diffImagesTable, int gfid, int diffImageId)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 List<String>getFeatureImages(int layerId, int gfid)Retrieves a list of image names for a feature.static List<FeatureDocument>getFeatureImagesOrDocuemnts(de.narimo.commons.dto.geometa.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)Inserts a new image and returns its id.static booleanisImageFromFeature(int layerId, int gfid, String filename)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) 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
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.geometa.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, int diffImageId) throws IOException
Accept an image from an images diff table.- Parameters:
imagesTable-diffImagesTable-gfid-diffImageId-- Throws:
IOException
-
isImageFromFeature
public static boolean isImageFromFeature(int layerId, int gfid, String filename) 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
-
-