mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-12 12:33:18 +00:00
[DS-236] Authority control for metadata fields and Choice Authority plugin framework
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4365 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -79,6 +79,12 @@ public class MetadataValue
|
||||
/** The position of the record. */
|
||||
public int place = 1;
|
||||
|
||||
/** Authority key, if any */
|
||||
public String authority = null;
|
||||
|
||||
/** Authority confidence value -- see Choices class for values */
|
||||
public int confidence = 0;
|
||||
|
||||
/** log4j logger */
|
||||
private static Logger log = Logger.getLogger(MetadataValue.class);
|
||||
|
||||
@@ -100,6 +106,8 @@ public class MetadataValue
|
||||
value = row.getStringColumn("text_value");
|
||||
language = row.getStringColumn("text_lang");
|
||||
place = row.getIntColumn("place");
|
||||
authority = row.getStringColumn("authority");
|
||||
confidence = row.getIntColumn("confidence");
|
||||
this.row = row;
|
||||
}
|
||||
}
|
||||
@@ -231,6 +239,46 @@ public class MetadataValue
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the metadata authority
|
||||
*
|
||||
* @return metadata authority
|
||||
*/
|
||||
public String getAuthority ()
|
||||
{
|
||||
return authority ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the metadata authority
|
||||
*
|
||||
* @param value new metadata authority
|
||||
*/
|
||||
public void setAuthority (String value)
|
||||
{
|
||||
this.authority = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the metadata confidence
|
||||
*
|
||||
* @return metadata confidence
|
||||
*/
|
||||
public int getConfidence()
|
||||
{
|
||||
return confidence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the metadata confidence
|
||||
*
|
||||
* @param value new metadata confidence
|
||||
*/
|
||||
public void setConfidence(int value)
|
||||
{
|
||||
this.confidence = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new metadata value.
|
||||
*
|
||||
@@ -248,6 +296,8 @@ public class MetadataValue
|
||||
row.setColumn("text_value", value);
|
||||
row.setColumn("text_lang", language);
|
||||
row.setColumn("place", place);
|
||||
row.setColumn("authority", authority);
|
||||
row.setColumn("confidence", confidence);
|
||||
DatabaseManager.insert(context, row);
|
||||
|
||||
// Remember the new row number
|
||||
@@ -352,6 +402,8 @@ public class MetadataValue
|
||||
row.setColumn("text_value", value);
|
||||
row.setColumn("text_lang", language);
|
||||
row.setColumn("place", place);
|
||||
row.setColumn("authority", authority);
|
||||
row.setColumn("confidence", confidence);
|
||||
DatabaseManager.update(context, row);
|
||||
|
||||
log.info(LogManager.getHeader(context, "update_metadatavalue",
|
||||
|
Reference in New Issue
Block a user