public class MetadataConverter extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
schemaNameId
Schema name to XSLT generic resource id map.
|
protected boolean |
setup |
protected Map<String,String> |
xsltCache
Id to XSLT map cache.
|
Constructor and Description |
---|
MetadataConverter(CollectionServiceImpl myServlet)
Create a new MetadataConverter.
|
Modifier and Type | Method and Description |
---|---|
String |
convert(String schemaName,
String xml,
org.gcube.application.framework.core.session.ASLSession d4session)
Convert the given metadata XML to HTML.
|
String |
convertUsingDefault(String xml,
org.gcube.application.framework.core.session.ASLSession d4session)
Convert the given XML to HTML using the default XSLT.
|
protected String |
getDefaultXSLT() |
protected String |
getXSL(String xsltId,
org.gcube.application.framework.core.session.ASLSession d4session)
Get a XSLT from is id.
|
void |
isReady() |
protected String |
retrieveXSLT(String xslId,
org.gcube.application.framework.core.session.ASLSession d4session)
Retrieve a schema from his generic resource.
|
protected void |
retrieveXSLTIds(org.gcube.application.framework.core.session.ASLSession session)
Retrieve from user profile all transformation schemas id.
|
void |
setup(org.gcube.application.framework.core.session.ASLSession d4session)
Load user xslt.
|
protected String |
transform(String xml,
String xslt)
Transform an XML string to HTML string using an XSLT processor.
|
public MetadataConverter(CollectionServiceImpl myServlet)
public void setup(org.gcube.application.framework.core.session.ASLSession d4session)
d4session
- public void isReady()
public String convert(String schemaName, String xml, org.gcube.application.framework.core.session.ASLSession d4session) throws Exception
schemaName
- xml
- d4session
- Exception
public String convertUsingDefault(String xml, org.gcube.application.framework.core.session.ASLSession d4session) throws Exception
xml
- the XML to convert.d4session
- the user session.Exception
protected void retrieveXSLTIds(org.gcube.application.framework.core.session.ASLSession session)
d4session
- protected String getXSL(String xsltId, org.gcube.application.framework.core.session.ASLSession d4session) throws RemoteException
xsltId
- the XSLT id.d4session
- RemoteException
protected String retrieveXSLT(String xslId, org.gcube.application.framework.core.session.ASLSession d4session) throws RemoteException
xslId
- the schema id.d4session
- RemoteException
protected String transform(String xml, String xslt) throws TransformerException
xml
- the XML to convert.xslt
- the XML used for the conversion.TransformerException
- if an error occurs.protected String getDefaultXSLT() throws IOException
IOException
Copyright © 2014. All Rights Reserved.