mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 19:43:10 +00:00
Fix dspace-api module per new code style
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
*/
|
||||
package org.dspace.content;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
@@ -19,11 +24,6 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service implementation for the MetadataValue object.
|
||||
* This class is responsible for all business logic calls for the MetadataValue object and is autowired by spring.
|
||||
@@ -66,7 +66,8 @@ public class MetadataValueServiceImpl implements MetadataValueService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MetadataValue> findByField(Context context, MetadataField metadataField) throws IOException, SQLException {
|
||||
public List<MetadataValue> findByField(Context context, MetadataField metadataField)
|
||||
throws IOException, SQLException {
|
||||
return metadataValueDAO.findByField(context, metadataField);
|
||||
}
|
||||
|
||||
@@ -74,16 +75,18 @@ public class MetadataValueServiceImpl implements MetadataValueService {
|
||||
public void update(Context context, MetadataValue metadataValue) throws SQLException {
|
||||
metadataValueDAO.save(context, metadataValue);
|
||||
log.info(LogManager.getHeader(context, "update_metadatavalue",
|
||||
"metadata_value_id=" + metadataValue.getID()));
|
||||
"metadata_value_id=" + metadataValue.getID()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Context context, MetadataValue metadataValue, boolean updateLastModified) throws SQLException, AuthorizeException {
|
||||
if(updateLastModified){
|
||||
public void update(Context context, MetadataValue metadataValue, boolean updateLastModified)
|
||||
throws SQLException, AuthorizeException {
|
||||
if (updateLastModified) {
|
||||
authorizeService.authorizeAction(context, metadataValue.getDSpaceObject(), Constants.WRITE);
|
||||
DSpaceObjectService<DSpaceObject> dSpaceObjectService = contentServiceFactory.getDSpaceObjectService(metadataValue.getDSpaceObject());
|
||||
// get the right class for our dspaceobject not the DSpaceObject lazy proxy
|
||||
DSpaceObjectService<DSpaceObject> dSpaceObjectService = contentServiceFactory
|
||||
.getDSpaceObjectService(metadataValue.getDSpaceObject());
|
||||
// get the right class for our dspaceobject not the DSpaceObject lazy proxy
|
||||
DSpaceObject dso = dSpaceObjectService.find(context, metadataValue.getDSpaceObject().getID());
|
||||
dSpaceObjectService.updateLastModified(context, dso);
|
||||
}
|
||||
@@ -94,7 +97,7 @@ public class MetadataValueServiceImpl implements MetadataValueService {
|
||||
@Override
|
||||
public void delete(Context context, MetadataValue metadataValue) throws SQLException {
|
||||
log.info(LogManager.getHeader(context, "delete_metadata_value",
|
||||
" metadata_value_id=" + metadataValue.getID()));
|
||||
" metadata_value_id=" + metadataValue.getID()));
|
||||
metadataValueDAO.delete(context, metadataValue);
|
||||
}
|
||||
|
||||
@@ -110,10 +113,9 @@ public class MetadataValueServiceImpl implements MetadataValueService {
|
||||
|
||||
@Override
|
||||
public MetadataValue getMinimum(Context context, int metadataFieldId)
|
||||
throws SQLException
|
||||
{
|
||||
throws SQLException {
|
||||
return metadataValueDAO.getMinimum(context,
|
||||
metadataFieldId);
|
||||
metadataFieldId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user