just formatted the code

This commit is contained in:
Francesco Mangiacrapa 2021-03-02 14:40:38 +01:00
parent 20b1a373b3
commit 5862cdc016
1 changed files with 51 additions and 55 deletions

View File

@ -11,13 +11,12 @@ import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanGroup;
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanLicense; import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanLicense;
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanOrganization; import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanOrganization;
/** /**
* The Interface DataCatalogue. * The Interface DataCatalogue.
* *
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* *
* Feb 12, 2021 * Feb 12, 2021
*/ */
public interface DataCatalogue { public interface DataCatalogue {
@ -110,7 +109,7 @@ public interface DataCatalogue {
* Retrieve a ckan dataset given its id. * Retrieve a ckan dataset given its id.
* *
* @param datasetIdOrName the dataset id or name * @param datasetIdOrName the dataset id or name
* @param username the username * @param username the username
* @return the dataset * @return the dataset
*/ */
CkanDataset getDataset(String datasetIdOrName, String username); CkanDataset getDataset(String datasetIdOrName, String username);
@ -201,8 +200,8 @@ public interface DataCatalogue {
* Check if this role is present for this user in the organization. If he/she is * Check if this role is present for this user in the organization. If he/she is
* not present we need to add it with the given role. * not present we need to add it with the given role.
* *
* @param username the username * @param username the username
* @param organizationName the organization name * @param organizationName the organization name
* @param correspondentRoleToCheck the correspondent role to check * @param correspondentRoleToCheck the correspondent role to check
* @return true if the role can be set, false if it cannot * @return true if the role can be set, false if it cannot
*/ */
@ -213,8 +212,8 @@ public interface DataCatalogue {
* Check if this role is present for this user in the group. If he/she is not * Check if this role is present for this user in the group. If he/she is not
* present we need to add it with the given role. * present we need to add it with the given role.
* *
* @param username the username * @param username the username
* @param groupName the group name * @param groupName the group name
* @param correspondentRoleToCheck the correspondent role to check * @param correspondentRoleToCheck the correspondent role to check
* @return true if the role can be set, false if it cannot * @return true if the role can be set, false if it cannot
*/ */
@ -242,7 +241,7 @@ public interface DataCatalogue {
* Get the parent groups of this group. * Get the parent groups of this group.
* *
* @param groupName the group name * @param groupName the group name
* @param apiKey the api key * @param apiKey the api key
* @return the group parent, if any * @return the group parent, if any
*/ */
List<CkanGroup> getParentGroups(String groupName, String apiKey); List<CkanGroup> getParentGroups(String groupName, String apiKey);
@ -263,7 +262,6 @@ public interface DataCatalogue {
*/ */
boolean isNotificationToUsersEnabled(); boolean isNotificationToUsersEnabled();
/** /**
* *************************************************************************** * ***************************************************************************
* *
@ -273,23 +271,23 @@ public interface DataCatalogue {
* *
* ***************************************************************************. * ***************************************************************************.
* *
* @param username the username * @param username the username
* @param title the title * @param title the title
* @param name the name * @param name the name
* @param organizationName the organization name * @param organizationName the organization name
* @param author the author * @param author the author
* @param authorMail the author mail * @param authorMail the author mail
* @param maintainer the maintainer * @param maintainer the maintainer
* @param maintainerMail the maintainer mail * @param maintainerMail the maintainer mail
* @param version the version * @param version the version
* @param description the description * @param description the description
* @param licenseId the license id * @param licenseId the license id
* @param tags the tags * @param tags the tags
* @param customFieldsMultiple the custom fields multiple * @param customFieldsMultiple the custom fields multiple
* @param resources the resources * @param resources the resources
* @param setPublic the set public * @param setPublic the set public
* @param setSearchable the set searchable * @param setSearchable the set searchable
* @param socialPost the social post * @param socialPost the social post
* @return the string * @return the string
* @throws Exception the exception * @throws Exception the exception
*/ */
@ -326,28 +324,13 @@ public interface DataCatalogue {
List<ResourceBean> resources, boolean setPublic, boolean setSearchable, boolean socialPost) List<ResourceBean> resources, boolean setPublic, boolean setSearchable, boolean socialPost)
throws Exception; throws Exception;
// /**
// * Patch a product with product id productId by using the couples in
// * customFieldsToChange. NOTE: only the specified custom fields will be changed.
// * If a custom field with a given key already exists, and removeOld is set to
// * false, the new values are added at the end of the list. Otherwise they are
// * lost.
// *
// * @param productId the product id
// * @param customFieldsToChange the custom fields to change
// * @param removeOld the remove old
// * @return true, if successful
// */
// boolean patchProductCustomFields(String productId, Map<String, List<String>> customFieldsToChange,
// boolean removeOld);
/** /**
* Add a resource described by the bean to the dataset id into * Add a resource described by the bean to the dataset id into
* resource.datasetId * resource.datasetId
* *
* @param resourceBean the resource bean * @param resourceBean the resource bean
* @param organizationName the organization name * @param organizationName the organization name
* @param username the username * @param username the username
* @return String the id of the resource on success, null otherwise * @return String the id of the resource on success, null otherwise
*/ */
String addResourceToDataset(ResourceBean resourceBean, String organizationName, String username) throws Exception; String addResourceToDataset(ResourceBean resourceBean, String organizationName, String username) throws Exception;
@ -400,23 +383,38 @@ public interface DataCatalogue {
* @return true, if successful * @return true, if successful
*/ */
boolean assignDatasetToGroup(String groupNameOrId, String datasetNameOrId); boolean assignDatasetToGroup(String groupNameOrId, String datasetNameOrId);
/** /**
* Patch a product with product id productId by using the couples in customFieldsToChange. * Patch a product with product id productId by using the couples in
* NOTE: only the specified custom fields will be changed. If a custom field with a given key * customFieldsToChange. NOTE: only the specified custom fields will be changed.
* already exists, and removeOld is set to false, the new values are added at the end of the list. Otherwise they are lost. * If a custom field with a given key already exists, and removeOld is set to
* false, the new values are added at the end of the list. Otherwise they are
* lost.
* *
* @param productId the product id * @param productId the product id
* @param username the username * @param username the username
* @param customFieldsToChange the custom fields to change * @param customFieldsToChange the custom fields to change
* @param removeOld the remove old * @param removeOld the remove old
* @return true, if successful * @return true, if successful
*/ */
boolean patchProductCustomFields(String productId, String username, Map<String, List<String>> customFieldsToChange, boolean patchProductCustomFields(String productId, String username, Map<String, List<String>> customFieldsToChange,
boolean removeOld); boolean removeOld);
/**
* Patch a product with product id productId by using the couples in
* customFieldsToChange. NOTE: only the specified custom fields will be changed.
* If a custom field with a given key already exists, and removeOld is set to
* false, the new values are added at the end of the list. Otherwise they are
* lost.
*
* @param productId the product id
* @param customFieldsToChange the custom fields to change
* @param removeOld the remove old
* @return true, if successful
*/
// boolean patchProductCustomFields(String productId, Map<String, List<String>> customFieldsToChange,
// boolean removeOld);
/** /**
* ******************************************************************************** * ********************************************************************************
* *
@ -426,9 +424,9 @@ public interface DataCatalogue {
* *
* ********************************************************************************. * ********************************************************************************.
* *
* @param username the username * @param username the username
* @param sourceOrganization the source organization * @param sourceOrganization the source organization
* @param currentRole the current role * @param currentRole the current role
*/ */
/** /**
@ -441,6 +439,4 @@ public interface DataCatalogue {
*/ */
void assignRolesOtherOrganization(String username, String sourceOrganization, RolesCkanGroupOrOrg currentRole); void assignRolesOtherOrganization(String username, String sourceOrganization, RolesCkanGroupOrOrg currentRole);
} }