Package fi.tut.mei.resdescapi.ardapi
Class ARD_API
- java.lang.Object
-
- fi.tut.mei.resdescapi.ardapi.ARD_API
-
public class ARD_API extends Object
Abstract Resource Description (ARD) API for processing such resources.- Author:
- Niko Siltala
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARD_FILE_TYPE
File type (ending) used for Abstract Resource description Files
-
Constructor Summary
Constructors Constructor Description ARD_API()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
convertARDObjToDOM(AbstractResourceDesc ardObj)
Converts Abstract Resource Description (ARD) from Java Objects format to DOM document.String
convertARDObjToString(AbstractResourceDesc ardObj)
Converts Resource Description (RD) from Java Objects format to String.String
createDocFromARD_HTML(AbstractResourceDesc ardObj)
Creates XHTML formatted documentation out of an ARD objectResourceDescription
createRDSkeleton(AbstractResourceDesc ardObj, String profileId)
Creates Resource Description (RD) Skeleton out of ARD and selected ProfileString
makeTransform(AbstractResourceDesc ardObj, String transformLocation)
Executes a XSLT Transformation for ARD objectAbstractResourceDesc
readARDInFromLocation(String fileLocation)
Reads in Abstract Resource Description file (XML format) and builds the Java binding (JAXB) objects.AbstractResourceDesc
readARDInFromString(InputStream ardInXML_inputStream)
Reads in Abstract Resource Description as argument content (InputStream, String as XML format) and builds the Java binding (JAXB) objects.AbstractResourceDesc
readARDInFromString(String ardInXML)
Reads in Abstract Resource Description as argument content (XML format) and builds the Java binding (JAXB) objects.boolean
saveARDToLocation(AbstractResourceDesc ardObj, String fileLocation)
Saves given ARD object data into file.
-
-
-
Field Detail
-
ARD_FILE_TYPE
public static final String ARD_FILE_TYPE
File type (ending) used for Abstract Resource description Files- See Also:
- Constant Field Values
-
-
Method Detail
-
readARDInFromLocation
public AbstractResourceDesc readARDInFromLocation(String fileLocation) throws IOException, Exception
Reads in Abstract Resource Description file (XML format) and builds the Java binding (JAXB) objects.- Parameters:
fileLocation
- Location of the file (in local file system, network drive or web location.- Returns:
- AbstractResourceDesc Root object for the read in structure
- Throws:
Exception
IOException
-
readARDInFromString
public AbstractResourceDesc readARDInFromString(String ardInXML) throws Exception
Reads in Abstract Resource Description as argument content (XML format) and builds the Java binding (JAXB) objects.- Parameters:
rdInXML
- ARD's content in XML format- Returns:
- AbstractResourceDesc Root object for the read in structure
- Throws:
Exception
-
readARDInFromString
public AbstractResourceDesc readARDInFromString(InputStream ardInXML_inputStream) throws JAXBException, Exception
Reads in Abstract Resource Description as argument content (InputStream, String as XML format) and builds the Java binding (JAXB) objects.- Parameters:
ardInXML_inputStream
- ARD's content as InputStream and content in XML format- Returns:
- AbstractResourceDesc Root object for the read in structure
- Throws:
JAXBException
Exception
-
saveARDToLocation
public boolean saveARDToLocation(AbstractResourceDesc ardObj, String fileLocation) throws JAXBException, IOException, Exception
Saves given ARD object data into file.- Parameters:
ardObj
- Abstract Resource Description as object modelfileLocation
- Location of the file where data is to be stored.- Returns:
- true if storing is successful
- Throws:
Exception
JAXBException
IOException
-
convertARDObjToString
public String convertARDObjToString(AbstractResourceDesc ardObj) throws JAXBException, Exception
Converts Resource Description (RD) from Java Objects format to String.- Parameters:
rdObj
- Resource Description (RD)- Returns:
- RD contents as String
- Throws:
JAXBException
Exception
-
convertARDObjToDOM
public Document convertARDObjToDOM(AbstractResourceDesc ardObj) throws JAXBException, Exception
Converts Abstract Resource Description (ARD) from Java Objects format to DOM document.- Parameters:
ardObj
- Abstract Resource Description (ARD)- Returns:
- ARD contents as DOM document
- Throws:
JAXBException
Exception
-
makeTransform
public String makeTransform(AbstractResourceDesc ardObj, String transformLocation) throws NullPointerException, IOException, Exception
Executes a XSLT Transformation for ARD object- Parameters:
ardObj
- ARD Object to be processedtransformLocation
- Location of XLST to be used for transformation. Can be URL or file location.- Returns:
- Transformation result
- Throws:
NullPointerException
- null values have been given as argumentsIOException
- Something has failed in IO systemException
- Some generic exception has occurred
-
createDocFromARD_HTML
public String createDocFromARD_HTML(AbstractResourceDesc ardObj) throws NullPointerException, IOException, Exception
Creates XHTML formatted documentation out of an ARD object- Parameters:
ardObj
- ARD Object to be processed- Returns:
- XHTML formatted document of the ARD
- Throws:
NullPointerException
- null values have been given as argumentsIOException
- Something has failed in IO systemException
- Some generic exception has occurred
-
createRDSkeleton
public ResourceDescription createRDSkeleton(AbstractResourceDesc ardObj, String profileId) throws ProfileNotExistException, JAXBException, IOException, NullPointerException
Creates Resource Description (RD) Skeleton out of ARD and selected Profile- Parameters:
ardObj
- ARD as object modelprofileId
- ID of the profile- Returns:
- Resource Description (RD) as object model
- Throws:
ProfileNotExistException
- Requested Profile does not exist in the given ARDJAXBException
IOException
- Something has failed in IO systemNullPointerException
- null values have been given as arguments
-
-