org.gcube.portlets.user.results.server.servlet
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(NewresultsetServiceImpl 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(NewresultsetServiceImpl 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 - Exceptionpublic String convertUsingDefault(String xml, org.gcube.application.framework.core.session.ASLSession d4session) throws Exception
xml - the XML to convert.d4session - the user session.Exceptionprotected 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 - RemoteExceptionprotected String retrieveXSLT(String xslId, org.gcube.application.framework.core.session.ASLSession d4session) throws RemoteException
xslId - the schema id.d4session - RemoteExceptionprotected 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
IOExceptionCopyright © 2013. All Rights Reserved.