dke.smwp.wrapper
Class Show_XSL
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--dke.smwp.wrapper.Show_XSL
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class Show_XSL
- extends javax.servlet.http.HttpServlet
generates XSL documents for generated XML documents.
the XML document is generated upon page class information
- Version:
- 1.0
- Author:
- Werner Enser
- See Also:
- Serialized Form
Fields inherited from class javax.servlet.http.HttpServlet |
HEADER_IFMODSINCE, HEADER_LASTMOD, LSTRING_FILE, lStrings, METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_POST, METHOD_PUT, METHOD_TRACE |
Fields inherited from class javax.servlet.GenericServlet |
config |
Method Summary |
void |
destroy()
Clean up resources |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
processes the HTTP get request;
fetches XML documents designated by given parameters:
systemID: filename of xml document which is to be fetched (e.g. wines/winery_rioja.xml)
or
id: id of xml document which is to be fetched (integer value) |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
processes the HTTP post request;
fetches XML documents designated by given parameters:
systemID: filename of xml document which is to be fetched (e.g. wines/winery_rioja.xml)
or
id: id of xml document which is to be fetched (integer value) |
private java.lang.String |
getErrorTemplate(boolean generateHeader)
gets xsl template to display error messages |
private java.lang.String |
getFCAttributeTemplate(java.lang.String[] fc_attributeName,
java.lang.String[] fc_attributeLabel)
gets xsl description for fragment and page attributes |
private java.lang.String |
getFCTemplate(java.sql.Connection con,
java.lang.String pc_elementName,
java.lang.String fc_longName)
gets xsl description for fragment element which is attached to page class |
private java.lang.String |
getFCTupleDataTemplate(java.lang.String pc_elementName)
gets xsl description for transforming fragment tuple data into html |
private java.lang.String |
getPageClass(java.sql.Connection con,
int xml_id)
gets page class name from generated xml document
designated by systemID |
private java.lang.String |
getPageClass(java.sql.Connection con,
java.lang.String systemID)
gets page class name from generated xml document
designated by systemID |
private java.lang.String |
getPCTemplate(java.sql.Connection con,
java.lang.String pc_name)
gets xsl description for page class element |
private java.lang.String |
getXSL(java.sql.Connection con,
java.lang.String pc_name)
generates xsl document for page class designated by xml_id ; |
void |
init()
Initialize global variables |
Methods inherited from class javax.servlet.http.HttpServlet |
, doDelete, doHead, doOptions, doPut, doTrace, getAllDeclaredMethods, getLastModified, maybeSetLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
CONTENT_TYPE
private static final java.lang.String CONTENT_TYPE
DB_SCHEMA_NAME
private static final java.lang.String DB_SCHEMA_NAME
TABLE_SMWP_XML_DOCUMENT
private static final java.lang.String TABLE_SMWP_XML_DOCUMENT
TABLE_SMWP_PCFC_MAPPING
private static final java.lang.String TABLE_SMWP_PCFC_MAPPING
TABLE_SMWP_FC_PARAMS
private static final java.lang.String TABLE_SMWP_FC_PARAMS
TABLE_SMWP_PC_PARAMS
private static final java.lang.String TABLE_SMWP_PC_PARAMS
TABLE_SMWP_PUBLISH_PC
private static final java.lang.String TABLE_SMWP_PUBLISH_PC
TABLE_SMWP_PUBLISH_FC
private static final java.lang.String TABLE_SMWP_PUBLISH_FC
TABLE_SMWP_TABLENAME
private static final java.lang.String TABLE_SMWP_TABLENAME
Show_XSL
public Show_XSL()
init
public void init()
throws javax.servlet.ServletException
- Initialize global variables
- Overrides:
init
in class javax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- processes the HTTP post request;
fetches XML documents designated by given parameters:
systemID: filename of xml document which is to be fetched (e.g. wines/winery_rioja.xml)
or
id: id of xml document which is to be fetched (integer value)
- Overrides:
doPost
in class javax.servlet.http.HttpServlet
- Parameters:
request
- HTTP requestresponse
- generaed XML document or error message (in XML format)- Throws:
javax.servlet.ServletException
- java.io.IOException
- fetching XML documents failed
doGet
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- processes the HTTP get request;
fetches XML documents designated by given parameters:
systemID: filename of xml document which is to be fetched (e.g. wines/winery_rioja.xml)
or
id: id of xml document which is to be fetched (integer value)
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Parameters:
request
- HTTP requestresponse
- generaed XML document or error message (in XML format)- Throws:
javax.servlet.ServletException
- java.io.IOException
- fetching XML documents failed
destroy
public void destroy()
- Clean up resources
- Overrides:
destroy
in class javax.servlet.GenericServlet
getPageClass
private java.lang.String getPageClass(java.sql.Connection con,
int xml_id)
throws java.sql.SQLException
- gets page class name from generated xml document
designated by
systemID
- Parameters:
con
- Connection handlexml_id
- unique identifier of xml document whose
page class is to be fetched- Throws:
java.sql.SQLException
- fetching data failed
getPageClass
private java.lang.String getPageClass(java.sql.Connection con,
java.lang.String systemID)
throws java.sql.SQLException
- gets page class name from generated xml document
designated by
systemID
- Parameters:
con
- Connection handlesystemID
- unique identifier of xml document whose
page class is to be fetched- Throws:
java.sql.SQLException
- fetching data failed
getXSL
private java.lang.String getXSL(java.sql.Connection con,
java.lang.String pc_name)
throws java.sql.SQLException
- generates xsl document for page class designated by
xml_id
;
- Parameters:
con
- Connection handlepc_name
- name of page class the xsl document is generated for- Returns:
- xsl document
- Throws:
java.sql.SQLException
- fetching page class information failed
getErrorTemplate
private java.lang.String getErrorTemplate(boolean generateHeader)
- gets xsl template to display error messages
- Parameters:
generateHeader
- true
if xsl parent element is to be
generated, false
otherwise
getPCTemplate
private java.lang.String getPCTemplate(java.sql.Connection con,
java.lang.String pc_name)
throws java.sql.SQLException
- gets xsl description for page class element
- Parameters:
con
- Connection handlepc_name
- name of page class- Throws:
java.sql.SQLException
- fetching data failed
getFCTemplate
private java.lang.String getFCTemplate(java.sql.Connection con,
java.lang.String pc_elementName,
java.lang.String fc_longName)
throws java.sql.SQLException
- gets xsl description for fragment element which is attached to page class
- Parameters:
con
- Connection handlepc_elementName
- xml element name of page class the fragment is
attached tofc_longName
- name of fragment class attached to page class- Returns:
- xsl description for fragment element
- Throws:
java.sql.SQLException
- fetching data failed
getFCTupleDataTemplate
private java.lang.String getFCTupleDataTemplate(java.lang.String pc_elementName)
- gets xsl description for transforming fragment tuple data into html
- Parameters:
pc_elementName
- xml element-name of page class the fragment is attached to
getFCAttributeTemplate
private java.lang.String getFCAttributeTemplate(java.lang.String[] fc_attributeName,
java.lang.String[] fc_attributeLabel)
- gets xsl description for fragment and page attributes
- Parameters:
fc_attributeName
- name of attributefc_attributeLabel
- name which is displayed for attribute label- Returns:
- xsl description for attributes