Package fr.igred.omero.repository
Class FolderWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.AnnotatableWrapper<T>
-
- fr.igred.omero.repository.GenericRepositoryObjectWrapper<FolderData>
-
- fr.igred.omero.repository.FolderWrapper
-
public class FolderWrapper extends GenericRepositoryObjectWrapper<FolderData>
Class containing a FolderData object.Wraps function calls to the FolderData contained.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
GenericRepositoryObjectWrapper.ReplacePolicy
-
-
Field Summary
Fields Modifier and Type Field Description static String
ANNOTATION_LINK
Annotation link name for this type of object-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Constructor Description FolderWrapper(Client client, String name)
Constructor of the FolderWrapper class.FolderWrapper(FolderData folder)
Constructor of the FolderWrapper class.FolderWrapper(Folder folder)
Constructor of the FolderWrapper class.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addChild(FolderWrapper folder)
Adds a child folder to this folder.void
addChildren(Collection<? extends FolderWrapper> folders)
Adds children folders to this folder.void
addImages(Client client, ImageWrapper... images)
Links images to the folder in OMERO.void
addROI(Client client, ROIWrapper roi)
Deprecated.Adds an ROI to the folder and associate it to the image id set(an image need to be associated)void
addROIs(Client client, long imageId, ROIWrapper... rois)
Adds ROIs to the folder and associate them to the provided image ID.void
addROIs(Client client, ImageWrapper image, ROIWrapper... rois)
Adds ROIs to the folder and associate them to the provided image.protected String
annotationLinkType()
Returns the type of annotation link for this object.FolderData
asFolderData()
Deprecated.Gets the folder contained in the FolderWrapper.List<FolderWrapper>
getChildren()
Retrieves the children folders for this folder.String
getDescription()
Gets the folder descriptionList<ImageWrapper>
getImages()
Retrieves the images contained in this folder.List<ImageWrapper>
getImages(Client client)
Retrieves the images contained in this folder.String
getName()
Gets the name of the folderFolderWrapper
getParent()
Retrieves the parent folders for this folder.List<ROIWrapper>
getROIs(Client client)
Deprecated.Gets the ROI contained in the folder associated with the image id set (an image need to be associated)List<ROIWrapper>
getROIs(Client client, long imageId)
Gets the ROIs contained in the folder associated with the provided image ID.List<ROIWrapper>
getROIs(Client client, ImageWrapper image)
Gets the ROIs contained in the folder associated with the provided image.protected <A extends AnnotationData>
voidlink(Client client, A annotation)
Adds an annotation to the object in OMERO, if possible.void
reload(Client client)
Reloads the folder from OMERO, to update all links.void
setDescription(String description)
Sets the description of the folder.void
setImage(long id)
Deprecated.Sets the image associated to the foldervoid
setImage(ImageWrapper image)
Deprecated.Sets the image associated to the foldervoid
setName(String name)
Sets the name of the folder.void
setParent(FolderWrapper folder)
Sets the parent folder for this folder.void
unlinkAllROI(Client client)
Deprecated.Unlink all ROI, associated to the image set, in the folder.void
unlinkAllROIs(Client client)
Unlink all ROIs associated to this folder.void
unlinkAllROIs(Client client, long imageId)
Unlink all ROIs associated to the provided image ID from the folder.void
unlinkAllROIs(Client client, ImageWrapper image)
Unlink all ROIs associated to the provided image from the folder.void
unlinkROI(Client client, ROIWrapper roi)
Deprecated.Unlink an ROI, associated to the image set, in the folder.void
unlinkROIs(Client client, ROIWrapper... rois)
Unlink ROIs from the folder.-
Methods inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
copyAnnotationLinks, importImage, importImages
-
Methods inherited from class fr.igred.omero.AnnotatableWrapper
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addFileAnnotation, addKeyValuePair, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTags, addTags, copyAnnotationLinks, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getTable, getTables, getTags, getValue, isLinked, link, link, linkIfNotLinked, rate, removeLink, unlink
-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, flatten, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
-
-
-
-
Field Detail
-
ANNOTATION_LINK
public static final String ANNOTATION_LINK
Annotation link name for this type of object- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FolderWrapper
public FolderWrapper(FolderData folder)
Constructor of the FolderWrapper class.- Parameters:
folder
- The FolderData to wrap.
-
FolderWrapper
public FolderWrapper(Folder folder)
Constructor of the FolderWrapper class.- Parameters:
folder
- Folder to contain.
-
FolderWrapper
public FolderWrapper(Client client, String name) throws ServiceException, OMEROServerError
Constructor of the FolderWrapper class. Save the folder in OMERO- Parameters:
client
- The client handling the connection.name
- Name of the folder.- Throws:
ServiceException
- Cannot connect to OMERO.OMEROServerError
- Server error.
-
-
Method Detail
-
annotationLinkType
protected String annotationLinkType()
Returns the type of annotation link for this object.- Specified by:
annotationLinkType
in classAnnotatableWrapper<FolderData>
- Returns:
- See above.
-
link
protected <A extends AnnotationData> void link(Client client, A annotation) throws ServiceException, AccessException, ExecutionException
Adds an annotation to the object in OMERO, if possible.- Overrides:
link
in classAnnotatableWrapper<FolderData>
- Type Parameters:
A
- The type of the annotation.- Parameters:
client
- The client handling the connection.annotation
- Annotation to be added.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getName
public String getName()
Gets the name of the folder- Specified by:
getName
in classGenericRepositoryObjectWrapper<FolderData>
- Returns:
- name.
-
setName
public void setName(String name)
Sets the name of the folder.- Parameters:
name
- The name of the folder. Mustn't benull
.- Throws:
IllegalArgumentException
- If the name isnull
.
-
asFolderData
@Deprecated public FolderData asFolderData()
Deprecated.Gets the folder contained in the FolderWrapper. UseGenericObjectWrapper.asDataObject()
instead.- Returns:
- the FolderData.
-
getDescription
public String getDescription()
Gets the folder description- Specified by:
getDescription
in classGenericRepositoryObjectWrapper<FolderData>
- Returns:
- The folder description.
-
setDescription
public void setDescription(String description)
Sets the description of the folder.- Parameters:
description
- The folder description.
-
reload
public void reload(Client client) throws AccessException, ServiceException, ExecutionException
Reloads the folder from OMERO, to update all links.- Parameters:
client
- The client handling the connection.- Throws:
AccessException
- Cannot access data.ServiceException
- Cannot connect to OMERO.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getParent
public FolderWrapper getParent()
Retrieves the parent folders for this folder.- Returns:
- See above
-
setParent
public void setParent(FolderWrapper folder)
Sets the parent folder for this folder.- Parameters:
folder
- The new parent folder.
-
addChild
public void addChild(FolderWrapper folder)
Adds a child folder to this folder.- Parameters:
folder
- The new child folder.
-
addChildren
public void addChildren(Collection<? extends FolderWrapper> folders)
Adds children folders to this folder.- Parameters:
folders
- The new children folders.
-
getChildren
public List<FolderWrapper> getChildren()
Retrieves the children folders for this folder.- Returns:
- See above
-
addImages
public void addImages(Client client, ImageWrapper... images) throws ServiceException, AccessException, ExecutionException
Links images to the folder in OMERO.- Parameters:
client
- The client handling the connection.images
- Images to add.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages()
Retrieves the images contained in this folder.- Returns:
- See above
-
getImages
public List<ImageWrapper> getImages(Client client) throws AccessException, ServiceException, ExecutionException
Retrieves the images contained in this folder.- Parameters:
client
- The client handling the connection.- Returns:
- See above
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
setImage
@Deprecated public void setImage(long id)
Deprecated.Sets the image associated to the folder- Parameters:
id
- ID of the image to associate.
-
setImage
@Deprecated public void setImage(ImageWrapper image)
Deprecated.Sets the image associated to the folder- Parameters:
image
- Image to associate.
-
addROI
@Deprecated public void addROI(Client client, ROIWrapper roi) throws ServiceException, AccessException, ExecutionException
Deprecated.Adds an ROI to the folder and associate it to the image id set(an image need to be associated)- Parameters:
client
- The client handling the connection.roi
- ROI to add.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- If the ROIFacility can't be retrieved or instantiated.
-
addROIs
public void addROIs(Client client, long imageId, ROIWrapper... rois) throws ServiceException, AccessException, ExecutionException
Adds ROIs to the folder and associate them to the provided image ID.- Parameters:
client
- The client handling the connection.imageId
- The image ID.rois
- ROIs to add.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- If the ROIFacility can't be retrieved or instantiated.
-
addROIs
public void addROIs(Client client, ImageWrapper image, ROIWrapper... rois) throws ServiceException, AccessException, ExecutionException
Adds ROIs to the folder and associate them to the provided image.- Parameters:
client
- The client handling the connection.image
- The image.rois
- ROIs to add.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- If the ROIFacility can't be retrieved or instantiated.
-
getROIs
@Deprecated public List<ROIWrapper> getROIs(Client client) throws ServiceException, AccessException, ExecutionException
Deprecated.Gets the ROI contained in the folder associated with the image id set (an image need to be associated)- Parameters:
client
- The client handling the connection.- Returns:
- List of ROIWrapper containing the ROI.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getROIs
public List<ROIWrapper> getROIs(Client client, long imageId) throws ServiceException, AccessException, ExecutionException
Gets the ROIs contained in the folder associated with the provided image ID.- Parameters:
client
- The client handling the connection.imageId
- The image.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getROIs
public List<ROIWrapper> getROIs(Client client, ImageWrapper image) throws ServiceException, AccessException, ExecutionException
Gets the ROIs contained in the folder associated with the provided image.- Parameters:
client
- The client handling the connection.image
- The image.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
unlinkAllROI
@Deprecated public void unlinkAllROI(Client client) throws ServiceException, AccessException, ExecutionException
Deprecated.Unlink all ROI, associated to the image set, in the folder. ROIs are now linked to the image directly- Parameters:
client
- The client handling the connection.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
unlinkAllROIs
public void unlinkAllROIs(Client client, long imageId) throws ServiceException, AccessException, ExecutionException
Unlink all ROIs associated to the provided image ID from the folder.ROIs are now linked to the image directly.
- Parameters:
client
- The client handling the connection.imageId
- The image ID.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
unlinkAllROIs
public void unlinkAllROIs(Client client, ImageWrapper image) throws ServiceException, AccessException, ExecutionException
Unlink all ROIs associated to the provided image from the folder.ROIs are now linked to the image directly.
- Parameters:
client
- The client handling the connection.image
- The image.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
unlinkAllROIs
public void unlinkAllROIs(Client client) throws ServiceException, AccessException, ExecutionException
Unlink all ROIs associated to this folder.The folder must be loaded beforehand.
ROIs are now linked to their images directly.
- Parameters:
client
- The client handling the connection.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
unlinkROI
@Deprecated public void unlinkROI(Client client, ROIWrapper roi) throws ServiceException, AccessException, ExecutionException
Deprecated.Unlink an ROI, associated to the image set, in the folder. The ROI is now linked to the image directly.- Parameters:
client
- The client handling the connection.roi
- ROI to unlink.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
unlinkROIs
public void unlinkROIs(Client client, ROIWrapper... rois) throws ServiceException, AccessException, ExecutionException
Unlink ROIs from the folder.The ROIs are now linked to the image directly.
- Parameters:
client
- The data manager.rois
- ROI to unlink.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
-