forked from DSpace/DSpace
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMetadataValueService.java
More file actions
127 lines (111 loc) · 4.38 KB
/
MetadataValueService.java
File metadata and controls
127 lines (111 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content.service;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.List;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.DSpaceObject;
import org.dspace.content.MetadataField;
import org.dspace.content.MetadataValue;
import org.dspace.core.Context;
/**
* Service interface class for the MetadataValue object.
* The implementation of this class is responsible for all business logic calls for the MetadataValue object and is
* autowired by spring
*
* @author kevinvandevelde at atmire.com
*/
public interface MetadataValueService {
/**
* Creates a new metadata value.
*
* @param context DSpace context object
* @param dso DSpaceObject
* @param metadataField metadata field
* @return new MetadataValue
* @throws SQLException if database error
*/
public MetadataValue create(Context context, DSpaceObject dso, MetadataField metadataField) throws SQLException;
/**
* Retrieves the metadata value from the database.
*
* @param context dspace context
* @param valueId database key id of value
* @return recalled metadata value
* @throws IOException if IO error
* @throws SQLException if database error
*/
public MetadataValue find(Context context, int valueId)
throws IOException, SQLException;
/**
* Retrieves the metadata values for a given field from the database.
*
* @param context dspace context
* @param metadataField metadata field whose values to look for
* @return a collection of metadata values
* @throws IOException if IO error
* @throws SQLException if database error
*/
public List<MetadataValue> findByField(Context context, MetadataField metadataField)
throws IOException, SQLException;
/**
* Retrieves matching MetadataValues for a given field and value.
*
* @param context dspace context
* @param metadataField The field that must match
* @param value The value that must match
* @return the matching MetadataValues
* @throws SQLException if database error
*/
public Iterator<MetadataValue> findByFieldAndValue(Context context, MetadataField metadataField, String value)
throws SQLException;
/**
* Update the metadata value in the database.
*
* @param context dspace context
* @param metadataValue metadata value
* @throws SQLException if database error
*/
public void update(Context context, MetadataValue metadataValue) throws SQLException;
public void update(Context context, MetadataValue metadataValue, boolean modifyParentObject)
throws SQLException, AuthorizeException;
/**
* Delete the metadata field.
*
* @param context dspace context
* @param metadataValue metadata value
* @throws SQLException if database error
*/
public void delete(Context context, MetadataValue metadataValue) throws SQLException;
public Iterator<MetadataValue> findByValueLike(Context context, String value) throws SQLException;
/**
* Retrieves matching MetadataValues for a given authority and language.
*
* @param context dspace context
* @param authority The authority value that must match
* @param language The language that must match (can be null)
* @return the matching MetadataValues
* @throws SQLException if database error
*/
public List<MetadataValue> findByAuthorityAndLanguage(Context context, String authority, String language)
throws SQLException;
public void deleteByMetadataField(Context context, MetadataField metadataField) throws SQLException;
/**
* Get the minimum value of a given metadata field across all objects.
*
* @param context dspace context
* @param metadataFieldId unique identifier of the interesting field.
* @return the minimum value of the metadata field
* @throws SQLException if database error
*/
public MetadataValue getMinimum(Context context, int metadataFieldId)
throws SQLException;
int countTotal(Context context) throws SQLException;
}