class: SwordUtil

public class: SwordUtil
Author: kleinfe1 (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 2757 $ $LastChangedDate: 2009-06-17 16:; Complexity: 1
Dates: Created: 16.07.2009 15:33:31; Modified: 16.07.2009 15:33:31;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {D2D9EAAB-7B3B-4d24-97BD-204A359AA60A}
This class provides helper method for the SWORD Server implementation.
 

Goto: Custom Properties, Fields, Methods

Extends: FacesBean

See also: PubManDepositServlet, FacesBean

Appears in: sword

Connections
 
Custom Properties
 
SwordUtil Attributes
Attribute Details
private const String
  acceptedFormat
Initial: "application/zip"
Notes: Constants
public static const String
  BEAN_NAME
Initial: "SwordUtil"
private PubManDepositServlet
  depositServlet
private String
  depositXml
Initial: ""
private Vector
  filenames
Initial: new Vector()
private String
  format
Initial: ""
Notes: Format of the provided Metadata
private const String
  itemPath
Initial: "/pubman/item/"
private Logger
  logger
Initial: Logger.getLogger(SwordUtil.class)
public static String
  LOGIN_URL
Initial: "/aa/login"
public static String
  LOGOUT_URL
Initial: "/aa/logout/clear.jsp"
private const String
  mdFormatBibTex
Initial: ".bib"
private const String
  mdFormatEndnote
Initial: ".enl"
private const String
  mdFormatEscidoc
Initial: ".xml"
private const String
  mdFormatTEI
Initial: ".tei"
private static const int
  NUMBER_OF_URL_TOKENS
Initial: 2
private static const long
  serialVersionUID
Initial: 1L
private const String
  serviceDocUrl
Initial: "faces/sword/servicedocument"
private const String
  transformationService
Initial: "escidoc"
private const String
  treatmentText
Initial: "Zip archives recognised as content packages are opened and the individual files contained in them are stored."
private String
  validationPoint
private const String
  validationPointAccept
Initial: "accept_item"
private const String
  validationPointDefault
Initial: "default"
private const String
  validationPointSubmit
Initial: "submit_item"
 
SwordUtil Methods
Operation Details
public
checkCollection(
   String collection,
   AccountUserVO user):boolean
Sequential
Notes: Checks if a user has depositing rights for a collection.
@return true if the user has depositing rights, else false
public
checkUser(
   ServiceDocumentRequest sdr):AccountUserVO
Sequential
Notes: Logs in a user.
@return AccountUserVO
private
convertToFile(
   byte[] file,
   String name,
   AccountUserVO user):FileVO
Sequential
Tags: throws=Exception
Notes: Converts a byte[] into a FileVO.
@return FileVO
public
createResponseAtom(
   PubItemVO item,
   Deposit deposit,
   boolean valid):SWORDEntry
Sequential
public
doDeposit(
   AccountUserVO user,
   PubItemVO item):PubItemVO
Sequential
Tags: throws=ItemInvalidException,PubItemStatusInvalidException,Exception
Notes: @return Saved pubItem
public
getAcceptedFormat():String
Sequential
public
getAccountUser(
   String user,
   String pwd):AccountUserVO
Sequential
Notes: Creates a Account User.
@return AccountUserVO
public
getFileNames():Vector
Sequential
protected
getItemControllerSessionBean():de.mpg.escidoc.pubman.ItemControllerSessionBean
Sequential
Notes: Returns a reference to the scoped data bean (the ItemControllerSessionBean).
@return a reference to the scoped data bean
public
getMethod(
   PubItemVO item):String
Sequential
public
getTreatmentText():String
Sequential
public
getValidationPoint():String
Sequential
public
getWorkflow():PublicationAdminDescriptorVO.Workflow
Sequential
Notes: Returns the Workflow of the current context.
public
getWorkflowAsString(
   PubContextVOPresentation pubContext):String
Sequential
Notes: Returns the Workflow for a given context.
@return workflow type as string
public
init():void
Sequential
public
loginUser(
   String userid,
   String password):String
Sequential
Tags: throws=HttpException,IOException,ServiceException,URISyntaxException
Notes: Logs in the given user with the given password.
@return The handle for the logged in user.
public
logoutUser():void
Sequential
Tags: throws=IOException,ServiceException,URISyntaxException
Notes: @param fc
private
processFiles(
   String item,
   Vector files,
   Vector names,
   AccountUserVO user):PubItemVO
Sequential
Tags: throws=ItemInvalidException,ContentStreamNotFoundException,Exception
Notes: @return
public
readZipFile(
   InputStream in,
   AccountUserVO user):PubItemVO
Sequential
Tags: throws=ItemInvalidException,ContentStreamNotFoundException,Exception
Notes: This method takes a zip file and reads out the entries.
public
setValidationPoint(
   String validationPoint):void
Sequential
public
SwordUtil():
Sequential
Notes: Public constructor
protected
uploadFile(
   InputStream in,
   String mimetype,
   String userHandle):URL
Sequential
Tags: throws=Exception
Notes: Uploads a file to the staging servlet and returns the corresponding URL.
@param InputStream to upload
@return The URL of the uploaded file.
public
validateItem(
   PubItemVO item):ValidationReportVO
Sequential
Tags: throws=NamingException