public final class OverviewUtil extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
presetsSetting
Name of setting to store saved presets.
|
private static Map<String,List<ValidationRuleAction>> |
staticRules |
Constructor and Description |
---|
OverviewUtil() |
Modifier and Type | Method and Description |
---|---|
static Map<String,List<ValidationRuleAction>> |
getAllRules(DbControl dc,
GenericOverview overview)
Get all static and extension validation rules grouped by relationship.
|
static Set<Annotatable> |
getAnnotatableParents(DbControl dc,
OverviewContext context,
Annotatable item)
Get all annotatable parent items for the given item.
|
static Node |
getCircularRef(Node node,
BasicItem item)
Find the first parent node that has a reference to the given item.
|
static GenericOverview |
getCurrentOverview(SessionControl sc)
Get the currently cached overview.
|
static Set<AnnotationType> |
getMiameAnnotationTypes(DbControl dc,
OverviewContext context,
Item itemType)
Get all annotation types that has been marked as "Required for MIAME".
|
static GenericOverview |
getNewOrCurrentOverview(DbControl dc,
BasicItem item,
Project project)
Get the current overview or create a new overview.
|
static GenericOverview |
getNewOverview(DbControl dc,
BasicItem item,
Project project)
Create a new overview for the given item and project.
|
static Map<String,List<ValidationRuleAction>> |
getStaticRules()
Get all static (built-in) validation rules grouped by relationship.
|
static Presets |
getValidationPresets(SessionControl sc)
Get the validation options presets for the currently logged in user.
|
static Map<String,List<ValidationRuleAction>> |
getValidators()
Deprecated.
In 3.2, use
getStaticRules() or getAllRules(DbControl, GenericOverview) instead |
static void |
restrictToPushAnnotationSubtypes(ItemQuery<? extends Subtypable> query)
Add a restriction to the query that limit the returned result to those items
that has a subtype with the
ItemSubtype.getPushAnnotations() flag set. |
static void |
saveValidationPresets(SessionControl sc)
Save the validation option presets for the logged in user.
|
private static Map<String,List<ValidationRuleAction>> staticRules
private static final String presetsSetting
@Deprecated public static Map<String,List<ValidationRuleAction>> getValidators()
getStaticRules()
public static Map<String,List<ValidationRuleAction>> getStaticRules()
public static Map<String,List<ValidationRuleAction>> getAllRules(DbControl dc, GenericOverview overview)
dc
- An open DbControloverview
- The overview treepublic static Presets getValidationPresets(SessionControl sc)
saveValidationPresets(SessionControl)
to make sure the changes are saved to the database.sc
- The session control for the logged in userpublic static void saveValidationPresets(SessionControl sc)
SessionControl.setUserDefaultSetting(String, String)
)
with the name experiment.overview.presets
sc
- The session control for the logged in userpublic static GenericOverview getNewOverview(DbControl dc, BasicItem item, Project project)
getCurrentOverview(SessionControl)
or getNewOrCurrentOverview(DbControl, BasicItem, Project)
.dc
- A DbControl to use for database accessitem
- The item to generate the overview forproject
- The project that should be used for validation
of default itemsgetNewOrCurrentOverview(DbControl, BasicItem, Project)
,
getCurrentOverview(SessionControl)
public static GenericOverview getNewOrCurrentOverview(DbControl dc, BasicItem item, Project project)
dc
- A DbControl to use for database accessitem
- The item to generate the overview forproject
- The project that should be used for validation
of default itemsgetNewOverview(DbControl, BasicItem, Project)
,
getCurrentOverview(SessionControl)
public static GenericOverview getCurrentOverview(SessionControl sc)
sc
- The session control that contains the cached overviewpublic static Node getCircularRef(Node node, BasicItem item)
node
- The node to start looking atitem
- The item to look forpublic static void restrictToPushAnnotationSubtypes(ItemQuery<? extends Subtypable> query)
ItemSubtype.getPushAnnotations()
flag set.public static Set<AnnotationType> getMiameAnnotationTypes(DbControl dc, OverviewContext context, Item itemType)
dc
- A DbControl to use for database accesscontext
- The current overview context (will be used to prepare
the query for annotation types; see OverviewContext.initQuery(ItemQuery, String)
itemType
- An optional item type that is used to limit what
annotation types to look forpublic static Set<Annotatable> getAnnotatableParents(DbControl dc, OverviewContext context, Annotatable item)
dc
- A DbControl to use for database accesscontext
- The current overview contextitem
- The annotatable item that we should find parents for