fix typos and comments

This commit is contained in:
Ivan Masár
2015-01-14 08:17:55 +01:00
parent f71b9c5424
commit 0571386370
7 changed files with 179 additions and 177 deletions

View File

@@ -58,23 +58,23 @@ public class BitstreamResource extends Resource
private static Logger log = Logger.getLogger(BitstreamResource.class);
/**
* Return bitstream properties without file data. It can throws
* Return bitstream properties without file data. It can throw
* WebApplicationException with three response codes. Response code
* NOT_FOUND(404) or UNAUTHORIZED(401) or INTERNAL_SERVER_ERROR(500). Bad
* request is when id of bitstream does not exist. UNAUTHORIZED is if logged
* user into DSpace context have not permission to access bitstream. Server
* error when something went wrong.
* request is when the bitstream id does not exist. UNAUTHORIZED if the user
* logged into the DSpace context does not have the permission to access the
* bitstream. Server error when something went wrong.
*
* @param bitstreamId
* Id of bitstream in DSpace.
* @param expand
* This string defined, which additional options will be added
* into bitstream. Single options are separated by commas without
* space. Options are: "all", "parent".
* This string defines which additional optional fields will be added
* to bitstream response. Individual options are separated by commas without
* spaces. The options are: "all", "parent".
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return If user is allowed to read bitstream, it returns instance of
* bitstream. Otherwise, it throws WebApplicationException with
* response code UNAUTHORIZED.
@@ -128,15 +128,15 @@ public class BitstreamResource extends Resource
/**
* Return all bitstream resource policies from all bundles, in which
* bitstream is.
* the bitstream is present.
*
* @param bitstreamId
* Id of bitstream in DSpace.
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* @return It returns array of ResourcePolicy.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return Returns an array of ResourcePolicy objects.
*/
@GET
@Path("/{bitstream_id}/policy")
@@ -166,7 +166,7 @@ public class BitstreamResource extends Resource
}
}
context.complete();
log.trace("Policies for bitsream(id=" + bitstreamId + ") was successfully read.");
log.trace("Policies for bitstream(id=" + bitstreamId + ") was successfully read.");
}
catch (SQLException e)
@@ -193,18 +193,18 @@ public class BitstreamResource extends Resource
* bitstreams from database.
*
* @param limit
* How much bitstreams in list will be. Default value is 100.
* How many bitstreams will be in the list. Default value is 100.
* @param offset
* On which index will list starts. Default values is 0.
* On which offset (item) the list starts. Default value is 0.
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* @return It returns array of bistreams. In array are not bitstreams on
* which user has not permission to read.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return Returns an array of bistreams. Array doesn't contain bitstreams for
* which the user doesn't have read permission.
* @throws WebApplicationException
* It is thrown when was problem with database reading or with
* creating context.
* Thrown in case of a problem with reading the database or with
* creating a context.
*/
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@@ -231,7 +231,7 @@ public class BitstreamResource extends Resource
offset = 0;
}
// TODO If bitsream doesnt not exist it throw exception.
// TODO If bitstream doesn't exist, throws exception.
for (int i = offset; (i < (offset + limit)) && (i < dspaceBitstreams.length); i++)
{
if (AuthorizeManager.authorizeActionBoolean(context, dspaceBitstreams[i], org.dspace.core.Constants.READ))
@@ -252,11 +252,11 @@ public class BitstreamResource extends Resource
}
catch (SQLException e)
{
processException("Something get wrong while reading bitstreams from database!. Message: " + e, context);
processException("Something went wrong while reading bitstreams from database!. Message: " + e, context);
}
catch (ContextException e)
{
processException("Something get wrong while reading bitstreams, ContextException. Message: " + e.getMessage(),
processException("Something went wrong while reading bitstreams, ContextException. Message: " + e.getMessage(),
context);
}
finally
@@ -268,26 +268,25 @@ public class BitstreamResource extends Resource
}
/**
* Read bitstream data. It can throw WebApplicationException with code
* INTERNAL_SERVER_ERROR(500). Caused by three exceptions: IOException if
* there was problem with reading bitstream file. SQLException if there was
* problem while reading from database. And AuthorizeException if there was
* problem with authorization of user logged to DSpace context.
* Read bitstream data. May throw WebApplicationException with the
* INTERNAL_SERVER_ERROR(500) code. Caused by three exceptions: IOException if
* there was a problem with reading bitstream file. SQLException if there was
* a problem while reading from database. And AuthorizeException if there was
* a problem with authorization of user logged to DSpace context.
*
* @param bitstreamId
* Id of bitstream, of which will be read data.
* Id of the bitstream, whose data will be read.
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* @return Returns response with data with content type of file. It can
* return response code NOT_FOUND(404) if there was bad id of
* bitstream. Or response code UNAUTHORIZED(401) if user is not
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return Returns response with data with file content type. It can
* return the NOT_FOUND(404) response code in case of wrong bitstream
* id. Or response code UNAUTHORIZED(401) if user is not
* allowed to read bitstream.
* @throws WebApplicationException
* It is throw in this cases: When was problem with reading file
* data. Or was problem with database reading. Or was problem
* with creating context. Or problem with authorization.
* Thrown if there was a problem: reading the file data; or reading
* the database; or creating the context; or with authorization.
*/
@GET
@Path("/{bitstream_id}/retrieve")
@@ -322,7 +321,7 @@ public class BitstreamResource extends Resource
}
catch (SQLException e)
{
processException("Something get wrong while reading bitsream(id=" + bitstreamId + ") from database! Message: " + e,
processException("Something went wrong while reading bitstream(id=" + bitstreamId + ") from database! Message: " + e,
context);
}
catch (AuthorizeException e)
@@ -345,18 +344,18 @@ public class BitstreamResource extends Resource
}
/**
* Add bitstream policy to all bundles in which bitstream is.
* Add bitstream policy to all bundles containing the bitstream.
*
* @param bitstreamId
* Id of bitstream in DSpace.
* @param policy
* Policy which will be added. But this atributes does not be
* Policy to be added. The following attributes are not
* applied: epersonId,
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* @return Returns ok, if was all ok. Otherwise status code 500.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return Returns ok, if all was ok. Otherwise status code 500.
*/
@POST
@Path("/{bitstream_id}/policy")
@@ -398,7 +397,7 @@ public class BitstreamResource extends Resource
}
context.complete();
log.trace("Policy for bitsream(id=" + bitstreamId + ") was successfully added.");
log.trace("Policy for bitstream(id=" + bitstreamId + ") was successfully added.");
}
catch (SQLException e)
@@ -424,26 +423,26 @@ public class BitstreamResource extends Resource
}
/**
* Update bitstream metadata. It replace everything on targeted bitstream.
* It can throws WebApplicationException caused by two exceptions:
* SQLException, if there was problem with database. AuthorizeException if
* there was problem with authorization to edit bitstream metadata.
* Update bitstream metadata. Replaces everything on targeted bitstream.
* May throw WebApplicationException caused by two exceptions:
* SQLException, if there was a problem with the database. AuthorizeException if
* there was a problem with the authorization to edit bitstream metadata.
*
* @param bitstreamId
* Id of bistream, wich will be updated.
* Id of bistream to be updated.
* @param bitstream
* Bitstream with will be placed. It muset have filled user
* creditials.
* Bitstream with will be placed. It must have filled user
* credentials.
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return Return response codes: OK(200), NOT_FOUND(404) if bitstream does
* not exist and UNAUTHORIZED(401) if user is not allowed to write
* to bitstream.
* @throws WebApplicationException
* It can be thrown by: Error in reading from database. Or
* creating context or with authorization to bitstream.
* Thrown when: Error reading from database; or error
* creating context; or error regarding bitstream authorization.
*/
@PUT
@Path("/{bitstream_id}")
@@ -554,27 +553,27 @@ public class BitstreamResource extends Resource
}
/**
* Update bitstream data. It change bitstream data by editing database rows.
* It can throw WebApplicationException caused by: SQLException if there was
* problem with database editing or reading, IOException if there was
* problem with reading from inputstream, Exception if there was another
* Update bitstream data. Changes bitstream data by editing database rows.
* May throw WebApplicationException caused by: SQLException if there was
* a problem editing or reading the database, IOException if there was
* a problem with reading from InputStream, Exception if there was another
* problem.
*
* @param bitstreamId
* Id of bistream, which will be updated.
* Id of bistream to be updated.
* @param is
* Inputstream filled with new data.
* InputStream filled with new data.
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return Return response if bitstream was updated. Response codes:
* OK(200), NOT_FOUND(404) if id of bitstream was bad. And
* UNAUTHORIZED(401) if user is not allowed to update bitstream.
* @throws WebApplicationException
* This exception can be thrown in this cases: Problem with
* reading or writing to database. Or problem with reading from
* inputstream.
* InputStream.
*/
// TODO Change to better logic, without editing database.
@PUT
@@ -641,24 +640,24 @@ public class BitstreamResource extends Resource
}
/**
* Delete bitstream from all bundles in dspace. It can throw
* Delete bitstream from all bundles in DSpace. May throw
* WebApplicationException, which can be caused by three exceptions.
* SQLException if there was problem with reading from database or removing
* from database. AuthorizeException, if user has not permission to delete
* bitstream or file. IOException, if there was problem with file deleting.
* SQLException if there was a problem reading from database or removing
* from database. AuthorizeException, if user doesn't have permission to delete
* the bitstream or file. IOException, if there was a problem deleting the file.
*
* @param bitstreamId
* Id of bitsream, which will be deleted.
* Id of bitstream to be deleted.
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return Return response codes: OK(200), NOT_FOUND(404) if bitstream of
* that id does not exist and UNAUTHORIZED(401) if user is not
* allowed to delete bitstream.
* @throws WebApplicationException
* It can be throw when was problem with reading or editting
* database. Or problem with file deleting. Or problem with
* Can be thron if there was a problem reading or editting
* the database. Or problem deleting the file. Or problem with
* authorization to bitstream and bundles. Or problem with
* creating context.
*/
@@ -719,13 +718,13 @@ public class BitstreamResource extends Resource
* Delete policy.
*
* @param bitstreamId
* Id of bitstream in dspace, which policy will be deleted.
* Id of the DSpace bitstream whose policy will be deleted.
* @param policyId
* Id of policy which will be deleted.
* Id of the policy to delete.
* @param headers
* If you want to access to item under logged user into context.
* In headers must be set header "rest-dspace-token" with passed
* token from login method.
* If you want to access the item as the user logged into the context.
* The header "rest-dspace-token" with the token passed
* from the login method must be set.
* @return It returns Ok, if was all ok. Otherwise status code 500.
*/
@DELETE
@@ -762,7 +761,7 @@ public class BitstreamResource extends Resource
}
context.complete();
log.trace("Policy for bitsream(id=" + bitstreamId + ") was successfully added.");
log.trace("Policy for bitstream(id=" + bitstreamId + ") was successfully added.");
}
catch (SQLException e)
@@ -789,7 +788,7 @@ public class BitstreamResource extends Resource
}
/**
* Return type of file in MIME, by file extension.
* Return the MIME type of the file, by file extension.
*
* @param name
* Name of file.
@@ -801,9 +800,9 @@ public class BitstreamResource extends Resource
}
/**
* Find bitstream from DSpace database. It is encapsulation of method
* org.dspace.content.Bitstream.find with checking if item exist and if user
* logged into context has permission to do passed action.
* Find bitstream from DSpace database. This encapsulatets the
* org.dspace.content.Bitstream.find method with a check whether the item exists and
* whether the user logged into the context has permission to preform the requested action.
*
* @param context
* Context of actual logged user.
@@ -811,7 +810,7 @@ public class BitstreamResource extends Resource
* Id of bitstream in DSpace.
* @param action
* Constant from org.dspace.core.Constants.
* @return It returns DSpace bitstream.
* @return Returns DSpace bitstream.
* @throws WebApplicationException
* Is thrown when item with passed id is not exists and if user
* has no permission to do passed action.
@@ -835,12 +834,12 @@ public class BitstreamResource extends Resource
context.abort();
if (context.getCurrentUser() != null)
{
log.error("User(" + context.getCurrentUser().getEmail() + ") has not permission to "
log.error("User(" + context.getCurrentUser().getEmail() + ") doesn't have the permission to "
+ getActionString(action) + " bitstream!");
}
else
{
log.error("User(anonymous) has not permission to " + getActionString(action) + " bitsteam!");
log.error("User(anonymous) doesn't have the permission to " + getActionString(action) + " bitsteam!");
}
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
}
@@ -848,7 +847,7 @@ public class BitstreamResource extends Resource
}
catch (SQLException e)
{
processException("Something get wrong while finding bitstream. SQLException, Message:" + e, context);
processException("Something went wrong while finding bitstream. SQLException, Message:" + e, context);
}
return bitstream;
}

View File

@@ -431,7 +431,7 @@ public class ItemsResource extends Resource
* ContextException. When was problem with creating context of
* DSpace.
*/
// TODO Add option to add bitsream by URI.(for very big files)
// TODO Add option to add bitstream by URI.(for very big files)
@POST
@Path("/{item_id}/bitstreams")
public Bitstream addItemBitstream(@PathParam("item_id") Integer itemId, InputStream inputStream,

View File

@@ -26,9 +26,10 @@ import org.dspace.usage.UsageEvent;
import org.dspace.utils.DSpace;
/**
* Superclass of all resource class in REST api. It has methods for creating
* context, write statistics, process exception, splitting key of metadata,
* string representation of action and method for getting user from header.
* Superclass of all resource classes in REST API. It has methods for creating
* context, write statistics, processsing exceptions, splitting a key of
* metadata, string representation of action and method for getting the logged
* in user from the token in request header.
*
* @author Rostislav Novak (Computing and Information Centre, CTU in Prague)
*
@@ -46,21 +47,21 @@ public class Resource
/**
* Create context to work with DSpace database. It can create context
* without logged user (parameter user is null) or with. It can throws
* WebApplicationException caused by: SQLException, if there was problem
* with reading from database. AuthorizeException, if there was problem with
* authorization to read form database. And Exception, if there was some
* problem with creating context.
* with or without a logged in user (parameter user is null). Throws
* WebApplicationException caused by: SQLException if there was a problem
* with reading from database. Throws AuthorizeException if there was
* a problem with authorization to read from the database. Throws Exception
* if there was a problem creating context.
*
* @param person
* User which will be logged in context.
* @return New created context with logged user if user was not null.
* Otherwise, without logged user.
* @return Newly created context with the logged in user unless the specified user was null.
* If user is null, create the context without a logged in user.
* @throws ContextException
* Throw if was problem to create context. It can be caused by
* SQLException, error in creating context or find user to log
* in. Or can be caused by AuthorizeException if was problem to
* authorize to find user.
* Thrown in case of a problem creating context. Can be caused by
* SQLException error in creating context or finding the user to
* log in. Can be caused by AuthorizeException if there was a
* problem authorizing the found user.
*/
protected static org.dspace.core.Context createContext(EPerson person) throws ContextException
{
@@ -90,11 +91,11 @@ public class Resource
}
/**
* It write statistic about using REST api.
* Records a statistics event about an object used via REST API.
* @param dspaceObject
* Object of DSpace which is performed.
* DSpace object on which a request was performed.
* @param action
* What action is performed with object.
* Action that was performed.
* @param user_ip
* @param user_agent
* @param xforwarderfor

View File

@@ -58,68 +58,68 @@ public class RestIndex {
"Server path: " + servletContext.getContextPath() +
"<h2>Index</h2>" +
"<ul>" +
"<li>GET / - It returns this page.</li>" +
"<li>GET /test - Return string \"REST api is running\". It is method for testing.</li>" +
"<li>POST /login - Method for login into DSpace RESTful api. You must post User class. Example: {\"email\":\"test@dspace\",\"password\":\"pass\"}. It returns token under which will must sending requests. In header \"rest-dspace-token\"</li>" +
"<li>POST /logout - Method for logout from DSpace RESTful api. You must post request with header \"rest-dspace-token\" token</li>" +
"<li>GET / - Return this page.</li>" +
"<li>GET /test - Return the string \"REST api is running\" for testing purposes.</li>" +
"<li>POST /login - Method for logging into the DSpace RESTful API. You must post User class. Example: {\"email\":\"test@dspace\",\"password\":\"pass\"}. Returns a token which must be included in future requests in the \"rest-dspace-token\" header.</li>" +
"<li>POST /logout - Method for logging out of the DSpace RESTful API. The request must include the \"rest-dspace-token\" token</li> header." +
"</ul>" +
"<h2>Communities</h2>" +
"<ul>" +
"<li>GET /communities - Returns array of all communities in DSpace.</li>" +
"<li>GET /communities/top-communities - Returns array of all top communities in DSpace.</li>" +
"<li>GET /communities/{communityId} - Returns community.</li>" +
"<li>GET /communities/{communityId}/collections - Returns array of collections of community.</li>" +
"<li>GET /communities/{communityId}/communities - Returns array of subcommunities of community.</li>" +
"<li>POST /communities - Create new community at top level. You must post community.</li>" +
"<li>POST /communities/{communityId}/collections - Create new collections in community. You must post collection.</li>" +
"<li>POST /communities/{communityId}/communities - Create new subcommunity in community. You must post community.</li>" +
"<li>PUT /communities/{communityId} - Update community.</li>" +
"<li>DELETE /communities/{communityId} - Delete community.</li>" +
"<li>DELETE /communities/{communityId}/collections/{collectionId} - Delete collection in community.</li>" +
"<li>DELETE /communities/{communityId}/communities/{communityId2} - Delete subcommunity in community.</li>" +
"<li>GET /communities - Return an array of all communities in DSpace.</li>" +
"<li>GET /communities/top-communities - Returns an array of all top-leve communities in DSpace.</li>" +
"<li>GET /communities/{communityId} - Returns a community with the specified ID.</li>" +
"<li>GET /communities/{communityId}/collections - Returns an array of collections of the specified community.</li>" +
"<li>GET /communities/{communityId}/communities - Returns an array of subcommunities of the specified community.</li>" +
"<li>POST /communities - Create a new top-level community. You must post a community.</li>" +
"<li>POST /communities/{communityId}/collections - Create a new collection in the specified community. You must post a collection.</li>" +
"<li>POST /communities/{communityId}/communities - Create a new subcommunity in the specified community. You must post a community.</li>" +
"<li>PUT /communities/{communityId} - Update the specified community.</li>" +
"<li>DELETE /communities/{communityId} - Delete the specified community.</li>" +
"<li>DELETE /communities/{communityId}/collections/{collectionId} - Delete the specified collection in the specified community.</li>" +
"<li>DELETE /communities/{communityId}/communities/{communityId2} - Delete the specified subcommunity (communityId2) in the specified community (communityId).</li>" +
"</ul>" +
"<h2>Collections</h2>" +
"<ul>" +
"<li>GET /collections - Return all collections of DSpace in array.</li>" +
"<li>GET /collections/{collectionId} - Return collection with id.</li>" +
"<li>GET /collections/{collectionId}/items - Return all items of collection.</li>" +
"<li>POST /collections/{collectionId}/items - Create posted item in collection.</li>" +
"<li>POST /collections/find-collection - Find collection by passed name.</li>" +
"<li>PUT /collections/{collectionId} </li> - Update collection. You muset post collection." +
"<li>DELETE /collections/{collectionId} - Delete collection from DSpace.</li>" +
"<li>DELETE /collections/{collectionId}/items/{itemId} - Delete item in collection. </li>" +
"<li>GET /collections - Return all DSpace collections in array.</li>" +
"<li>GET /collections/{collectionId} - Return a collection with the specified ID.</li>" +
"<li>GET /collections/{collectionId}/items - Return all items of the specified collection.</li>" +
"<li>POST /collections/{collectionId}/items - Create an item in the specified collection. You must post an item.</li>" +
"<li>POST /collections/find-collection - Find a collection by name.</li>" +
"<li>PUT /collections/{collectionId} </li> - Update the specified collection. You must post a collection." +
"<li>DELETE /collections/{collectionId} - Delete the specified collection from DSpace.</li>" +
"<li>DELETE /collections/{collectionId}/items/{itemId} - Delete the specified item (itemId) in the specified collection (collectionId). </li>" +
"</ul>" +
"<h2>Items</h2>" +
"<ul>" +
"<li>GET /items - Return list of items.</li>" +
"<li>GET /items/{item id} - Return item.</li>" +
"<li>GET /items/{item id}/metadata - Return item metadata.</li>" +
"<li>GET /items/{item id}/bitstreams - Return item bitstreams.</li>" +
"<li>POST /items/find-by-metadata-field - Find items by metadata entry.</li>" +
"<li>POST /items/{item id}/metadata - Add metadata to item.</li>" +
"<li>POST /items/{item id}/bitstreams - Add bitstream to item.</li>" +
"<li>PUT /items/{item id}/metadata - Update metadata in item.</li>" +
"<li>DELETE /items/{item id} - Delete item.</li>" +
"<li>DELETE /items/{item id}/metadata - Clear item metadata.</li>" +
"<li>DELETE /items/{item id}/bitstreams/{bitstream id} - Delete item bitstream.</li>" +
"<li>GET /items - Return a list of items.</li>" +
"<li>GET /items/{item id} - Return the specified item.</li>" +
"<li>GET /items/{item id}/metadata - Return metadata of the specified item.</li>" +
"<li>GET /items/{item id}/bitstreams - Return bitstreams of the specified item.</li>" +
"<li>POST /items/find-by-metadata-field - Find items by the specified metadata value.</li>" +
"<li>POST /items/{item id}/metadata - Add metadata to the specified item.</li>" +
"<li>POST /items/{item id}/bitstreams - Add a bitstream to the specified item.</li>" +
"<li>PUT /items/{item id}/metadata - Update metadata in the specified item.</li>" +
"<li>DELETE /items/{item id} - Delete the specified item.</li>" +
"<li>DELETE /items/{item id}/metadata - Clear metadata of the specified item.</li>" +
"<li>DELETE /items/{item id}/bitstreams/{bitstream id} - Delete the specified bitstream of the specified item.</li>" +
"</ul>" +
"<h2>Bitstreams</h2>" +
"<ul>" +
"<li>GET /bitstreams - Return all bitstreams in DSpace.</li>" +
"<li>GET /bitstreams/{bitstream id} - Return bitstream.</li>" +
"<li>GET /bitstreams/{bitstream id}/policy - Return bitstream policies.</li>" +
"<li>POST /bitstreams/{bitstream id}/retrieve - Return data of bitstream.</li>" +
"<li>POST /bitstreams/{bitstream id}/policy - Add policy to item.</li>" +
"<li>PUT /bitstreams/{bitstream id}/data - Update data of bitstream.</li>" +
"<li>PUT /bitstreams/{bitstream id} - Update metadata of bitstream.</li>" +
"<li>DELETE /bitstreams/{bitstream id} - Delete bitstream from DSpace.</li>" +
"<li>DELETE /bitstreams/{bitstream id}/policy/{policy_id} - Delete bitstream policy.</li>" +
"<li>GET /bitstreams/{bitstream id} - Return the specified bitstream.</li>" +
"<li>GET /bitstreams/{bitstream id}/policy - Return policies of the specified bitstream.</li>" +
"<li>GET /bitstreams/{bitstream id}/retrieve - Return the contents of the specified bitstream.</li>" +
"<li>POST /bitstreams/{bitstream id}/policy - Add a policy to the specified bitstream.</li>" +
"<li>PUT /bitstreams/{bitstream id}/data - Update the contents of the specified bitstream.</li>" +
"<li>PUT /bitstreams/{bitstream id} - Update metadata of the specified bitstream.</li>" +
"<li>DELETE /bitstreams/{bitstream id} - Delete the specified bitstream from DSpace.</li>" +
"<li>DELETE /bitstreams/{bitstream id}/policy/{policy_id} - Delete the specified bitstream policy.</li>" +
"</ul>" +
"</body></html> ";
}
/**
* Method for only test if rest api is running.
* Method only for testing whether the REST API is running.
*
* @return String "REST api is running."
*/
@@ -131,11 +131,11 @@ public class RestIndex {
}
/**
* Method for login user into REST api.
* Method to login a user into REST API.
*
* @param user
* User which will be logged into REST api.
* @return Returns response code OK with token. Otherwise returns response
* User which will be logged in to REST API.
* @return Returns response code OK and a token. Otherwise returns response
* code FORBIDDEN(403).
*/
@POST
@@ -155,14 +155,14 @@ public class RestIndex {
}
/**
* Method for logout from DSpace REST api. It removes token and user from
* Method to logout a user from DSpace REST API. Removes the token and user from
* TokenHolder.
*
* @param headers
* Request header which contains header with key
* "rest-dspace-token" and value of token.
* @return Return response OK, otherwise BAD_REQUEST, if was problem with
* logout or token is incorrect.
* Request header which contains the header named
* "rest-dspace-token" containing the token as value.
* @return Return response OK, otherwise BAD_REQUEST, if there was a problem with
* logout or the token is incorrect.
*/
@POST
@Path("/logout")
@@ -191,10 +191,12 @@ public class RestIndex {
}
/**
* ? status: OK
* authenticated: TRUE | FALSE
* epersonEMAIL: user@dspace.org
* epersonNAME: Joe User
* Method to check current status of the service and logged in user.
*
* okay: true | false
* authenticated: true | false
* epersonEMAIL: user@example.com
* epersonNAME: John Doe
* @param headers
* @return
*/

View File

@@ -164,7 +164,7 @@
<xsl:call-template name="standardAttributes">
<xsl:with-param name="class">ds-table</xsl:with-param>
</xsl:call-template>
<!-- rows and cols atributes are not allowed in strict
<!-- rows and cols attributes are not allowed in strict
<xsl:attribute name="rows"><xsl:value-of select="@rows"/></xsl:attribute>
<xsl:attribute name="cols"><xsl:value-of select="@cols"/></xsl:attribute>

View File

@@ -891,7 +891,7 @@
<xsl:call-template name="standardAttributes">
<xsl:with-param name="class">ds-table</xsl:with-param>
</xsl:call-template>
<!-- rows and cols atributes are not allowed in strict
<!-- rows and cols attributes are not allowed in strict
<xsl:attribute name="rows"><xsl:value-of select="@rows"/></xsl:attribute>
<xsl:attribute name="cols"><xsl:value-of select="@cols"/></xsl:attribute>

View File

@@ -244,11 +244,11 @@ log.dir = ${dspace.dir}/log
identifier.doi.user = username
identifier.doi.password = password
# DOI prefix used to mint DOIs. All DOIs minted by DSpace will use this prefix.
# The Prefix will be assinged by the registration agency.
# The Prefix will be assigned by the registration agency.
identifier.doi.prefix = 10.5072
# If you want to, you can further separate your namespace. Should all the suffix
# of all DOIs minted by DSpace start with a special string to separate it from
# other services also minting DOIs under your prefix?
# If you want to, you can further separate your namespace. Should all the
# suffixes of all DOIs minted by DSpace start with a special string to separate
# it from other services also minting DOIs under your prefix?
identifier.doi.namespaceseparator = dspace/
##### Plugin management #####