Skip to content
Snippets Groups Projects
Commit 1dc24adb authored by pkupczyk's avatar pkupczyk
Browse files

BIS-222 - Make STORAGE_CONFIRMED available in dataset search for admins:

- improve javadoc
- make ISearchFieldAvailability and ISearchFieldCriterionFactory interfaces more consistent

SVN: 26991
parent 5a1fc91e
No related branches found
No related tags found
No related merge requests found
...@@ -235,7 +235,7 @@ public final class DetailedSearchFieldsSelectionWidget extends ...@@ -235,7 +235,7 @@ public final class DetailedSearchFieldsSelectionWidget extends
field.getKind() != null ? field.getKind().getAvailability() : null; field.getKind() != null ? field.getKind().getAvailability() : null;
if (availability != null if (availability != null
&& availability.isAvailable(getPerson(), getPersonRoles()) == false) && availability.isAvailable(field.getField(), getPerson(), getPersonRoles()) == false)
{ {
iterator.remove(); iterator.remove();
} }
......
...@@ -17,11 +17,16 @@ ...@@ -17,11 +17,16 @@
package ch.systemsx.cisd.openbis.generic.shared.basic.dto; package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
/** /**
* Controls availability of a search field.
*
* @author pkupczyk * @author pkupczyk
*/ */
public interface ISearchFieldAvailability public interface ISearchFieldAvailability
{ {
public boolean isAvailable(Person person, PersonRoles personRoles); /**
* Returns true if the search field should be available for the specified person and roles.
*/
public boolean isAvailable(DetailedSearchField field, Person person, PersonRoles personRoles);
} }
...@@ -16,13 +16,17 @@ ...@@ -16,13 +16,17 @@
package ch.systemsx.cisd.openbis.generic.shared.basic.dto; package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
/** /**
* Creates a criterion for a search field.
*
* @author pkupczyk * @author pkupczyk
*/ */
public interface ISearchFieldCriterionFactory public interface ISearchFieldCriterionFactory
{ {
/**
* Creates a criterion for the search field and value.
*/
public DetailedSearchCriterion createCriterion(DetailedSearchField field, String value); public DetailedSearchCriterion createCriterion(DetailedSearchField field, String value);
} }
...@@ -16,15 +16,22 @@ ...@@ -16,15 +16,22 @@
package ch.systemsx.cisd.openbis.generic.shared.basic.dto; package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
/** /**
* Kind of field that can be used in detailed text queries.
*
* @author pkupczyk * @author pkupczyk
*/ */
public interface ISearchFieldKind public interface ISearchFieldKind
{ {
/**
* Returns availability of the search field.
*/
ISearchFieldAvailability getAvailability(); ISearchFieldAvailability getAvailability();
/**
* Returns criterion factory of the search field.
*/
ISearchFieldCriterionFactory getCriterionFactory(); ISearchFieldCriterionFactory getCriterionFactory();
} }
...@@ -17,13 +17,15 @@ ...@@ -17,13 +17,15 @@
package ch.systemsx.cisd.openbis.generic.shared.basic.dto; package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
/** /**
* Makes a search field available for an admin used.
*
* @author pkupczyk * @author pkupczyk
*/ */
public class SearchFieldAvailableForAdmins implements ISearchFieldAvailability public class SearchFieldAvailableForAdmins implements ISearchFieldAvailability
{ {
@Override @Override
public boolean isAvailable(Person person, PersonRoles personRoles) public boolean isAvailable(DetailedSearchField field, Person person, PersonRoles personRoles)
{ {
return personRoles.isAdmin(); return personRoles.isAdmin();
} }
......
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
package ch.systemsx.cisd.openbis.generic.shared.basic.dto; package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
/** /**
* Creates a criterion for a boolean field. Accepts following values: "true", "yes", "false", "no".
* For other values is returns null.
*
* @author pkupczyk * @author pkupczyk
*/ */
public class SearchFieldBooleanCriterionFactory implements ISearchFieldCriterionFactory public class SearchFieldBooleanCriterionFactory implements ISearchFieldCriterionFactory
......
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
package ch.systemsx.cisd.openbis.generic.shared.basic.dto; package ch.systemsx.cisd.openbis.generic.shared.basic.dto;
/** /**
* Creates a criterion for a date field. Supports registration and modification dates with equals,
* from and until versions.
*
* @author pkupczyk * @author pkupczyk
*/ */
public class SearchFieldDateCriterionFactory implements ISearchFieldCriterionFactory public class SearchFieldDateCriterionFactory implements ISearchFieldCriterionFactory
......
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