Class AbstractJSPGenerator
- java.lang.Object
-
- net.anotheria.asg.generator.AbstractGenerator
-
- net.anotheria.asg.generator.view.jsp.AbstractJSPGenerator
-
- Direct Known Subclasses:
DialogPageJspGenerator,IndexPageJspGenerator,JspGenerator,LinksToMePageJspGenerator,ListPageJspGenerator,MenuJspGenerator,QueriesPageJspGenerator,SharedFooterJspGenerator,ShowPageJspGenerator,TablePageJspGenerator
public abstract class AbstractJSPGenerator extends AbstractGenerator
Generator for the JSP files used for generations of the view jsps.- Version:
- $Id: $Id
- Author:
- lrosenberg
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractJSPGenerator.TagAttributeHTML/JSP tag attribute object representation.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFOOTER_SELECTION_CMSCaption for the CMS link in the footer.static java.lang.StringFOOTER_SELECTION_QUERIESCaptions for the Queries link in the footer.-
Fields inherited from class net.anotheria.asg.generator.AbstractGenerator
CRLF, ident
-
-
Constructor Summary
Constructors Constructor Description AbstractJSPGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendCommentLine(java.lang.String commentLine)appendCommentLine.protected voidcloseJavaScript()Appends to generation output script tag closing.protected voidcloseTag(java.lang.String tag, java.lang.String params)closeTag.protected voidcloseTD()closeTD.protected voidcloseTD(java.lang.String additionalParams)closeTD.protected voidcloseTR()closeTR.protected voidcloseTR(java.lang.String additionalParams)closeTR.protected GeneratedJSPFilegenerateFooter(MetaView view, java.lang.String selection, java.lang.String name)Generates a footer file which is included by other jsps.protected voidgeneratePragmas()Generates generic pragmas.protected voidgeneratePragmas(MetaView view)Generates pragmas for a given view.protected static java.lang.StringgenerateTimestampedLinkPath(java.lang.String path)generateTimestampedLinkPath.protected java.lang.StringgetBaseCSVHeader()Generates the header for jsp files that generate csv exports.protected java.lang.StringgetBaseJSPFooter()Returns the basic footer used in all jsps.protected java.lang.StringgetBaseJSPHeader()Generates the header for all jsp files.protected java.lang.StringgetBaseXMLHeader()Generates the header for jsp files that generate xml exports.protected java.lang.StringgetBottomImage(java.lang.String alt)Returns the tag for the move to the bottom image in the list view with the given alt tag.static java.lang.StringgetContainerPageName(MetaDocument doc, MetaContainerProperty table)getContainerPageName.ContextgetContext()getContext.static java.lang.StringgetCSSPath(java.lang.String stylesheetName, Context context)getCSSPath.protected java.lang.StringgetCurrentCSSPath(java.lang.String stylesheetName)getCurrentCSSPath.protected java.lang.StringgetCurrentImagePath(java.lang.String imageName)getCurrentImagePath.protected java.lang.StringgetCurrentJavaScriptPath(java.lang.String javaScript)getCurrentJavaScriptPath.protected java.lang.StringgetCurrentJSPath(java.lang.String jsName)getCurrentJSPath.protected java.lang.StringgetCurrentYUIPath(java.lang.String yuiName)getCurrentYUIPath.protected java.lang.StringgetDeleteImage()Returns the tag for the delete image in the overview.protected java.lang.StringgetDeleteImage(java.lang.String alt)Returns the tag for the delete image in the overview with the given alt tag.static java.lang.StringgetDialogName(MetaDialog dialog, MetaDocument doc)getDialogName.protected java.lang.StringgetDownImage(java.lang.String alt)Returns the tag for the move down image in the list view with the given alt tag.protected java.lang.StringgetDuplicateImage()Returns image tag for the duplicate entry image.protected java.lang.StringgetDuplicateImage(java.lang.String alt)Returns the tag for the duplicate image in the overview with the given alt tag.protected java.lang.StringgetEditImage()Returns the tag for the edit image in the overview.protected java.lang.StringgetEditImage(java.lang.String alt)getEditImage.static java.lang.StringgetEditPageName(MetaDocument doc)Returns the name of the edit page for this document.static java.lang.StringgetExportAsCSVPageName(MetaDocument doc)Returns the name of the jsp file for the csv page export for the document.static java.lang.StringgetExportAsXMLPageName(MetaDocument doc)Returns the name of the jsp file for the xml page export for the document.protected java.lang.StringgetFooterName(MetaView view)getFooterName.protected java.lang.StringgetImage(java.lang.String name, java.lang.String alt)Returns the img tag to embed an image into the jsp.static java.lang.StringgetImagePath(java.lang.String imageName, Context context)getImagePath.static java.lang.StringgetJavaScriptPath(java.lang.String javaScript, Context context)getJavaScriptPath.static java.lang.StringgetJSPath(java.lang.String jsName, Context context)getJSPath.static java.lang.StringgetLinksToMePageName(MetaDocument doc)getLinksToMePageName.protected java.lang.StringgetLockImage()Returns the tag for the lock image in the overview.protected java.lang.StringgetLockImage(java.lang.String alt)Returns the tag for the lock image in the overview with the given alt tag.protected java.lang.StringgetMenuName(MetaView view)getMenuName.static java.lang.StringgetPackage(MetaDocument doc)getPackage.static java.lang.StringgetPackage(MetaModule mod)getPackage.protected java.lang.StringgetPreviewImage()Returns the tag for the preview image in the overview.protected java.lang.StringgetPreviewImage(java.lang.String alt)Returns the tag for the preview image in the overview with the given alt tag.static java.lang.StringgetSearchResultPageName()getSearchResultPageName.static java.lang.StringgetShowPageName(MetaDocument doc)Returns the name of the jsp file for the show page for the document.static java.lang.StringgetShowQueriesPageName(MetaDocument doc)getShowQueriesPageName.protected java.lang.StringgetTopImage(java.lang.String alt)Returns the tag for the move to the top image in the list view with the given alt tag.protected java.lang.StringgetTopMenuPage()getTopMenuPage.protected java.lang.StringgetUnLockImage()Returns the tag for the lock image in the overview.protected java.lang.StringgetUnLockImage(java.lang.String alt)Returns the tag for the unLock image in the overview with the given alt tag.protected java.lang.StringgetUpImage(java.lang.String alt)Returns the tag for the move up image in the list view with the given alt tag.protected java.lang.StringgetVersionImage()Returns the tag for the version info image in the overview.protected java.lang.StringgetVersionImage(java.lang.String alt)Returns the tag for the Version in the overview with the given alt tag.static java.lang.StringgetVersionInfoPageName()Returns the page name for the version info page.static java.lang.StringgetVersionInfoPageName(MetaDocument doc)Returns the page name for the version info page for the given document.static java.lang.StringgetYUIPath(java.lang.String yuiName, Context context)getYUIPath.protected voidopenJavaScript()Appends to generation output script tag with type javascript.protected voidopenTag(java.lang.String tag, java.lang.String params)openTag.protected voidopenTD()Opens a table cell.protected voidopenTD(java.lang.String additionalParams)Opens a table cell.protected voidopenTR()openTR.protected voidopenTR(java.lang.String additionalParams)openTR.protected voidtag(java.lang.String tag, java.lang.String id, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output tag without body.protected voidtag(java.lang.String tag, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output tag without body.protected voidtag(java.lang.String tag, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output tag without body.protected voidtagClose(java.lang.String tag)Appends to generation output closing for tag.protected voidtagOpen(java.lang.String tag, java.lang.String id, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output opening for tag.protected voidtagOpen(java.lang.String tag, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output opening for tag.protected voidtagOpen(java.lang.String tag, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output opening for tag.-
Methods inherited from class net.anotheria.asg.generator.AbstractGenerator
append, appendCatch, appendCatch, appendComment, appendComment, appendCommentLine, appendEmptyline, appendGenerationPoint, appendImport, appendImport, appendIncreasedStatement, appendIncreasedStatement, appendIncreasedString, appendIncreasedString, appendMark, appendNullCheck, appendStatement, appendStatement, appendString, appendString, closeBlock, closeBlock, closeBlock, closeBlockNEW, createMultilingualList, decreaseIdent, emptyline, emptyline, getCurrentJob, getCurrentJobContent, getElementLanguage, increaseIdent, openFun, openTry, quote, quote, quote, resetIdent, startClassBody, startNewJob, writeComment, writeCommentLine, writeEmptyline, writeImport, writeImport, writeIncreasedStatement, writeIncreasedString, writeStatement, writeString
-
-
-
-
Field Detail
-
FOOTER_SELECTION_QUERIES
public static final java.lang.String FOOTER_SELECTION_QUERIES
Captions for the Queries link in the footer.- See Also:
- Constant Field Values
-
FOOTER_SELECTION_CMS
public static final java.lang.String FOOTER_SELECTION_CMS
Caption for the CMS link in the footer.- See Also:
- Constant Field Values
-
-
Method Detail
-
appendCommentLine
protected void appendCommentLine(java.lang.String commentLine)
appendCommentLine.
- Overrides:
appendCommentLinein classAbstractGenerator- Parameters:
commentLine- aStringobject.
-
getBaseJSPHeader
protected java.lang.String getBaseJSPHeader()
Generates the header for all jsp files.- Returns:
- a
Stringobject.
-
getBaseXMLHeader
protected java.lang.String getBaseXMLHeader()
Generates the header for jsp files that generate xml exports.- Returns:
- a
Stringobject.
-
getBaseCSVHeader
protected java.lang.String getBaseCSVHeader()
Generates the header for jsp files that generate csv exports.- Returns:
- a
Stringobject.
-
generateFooter
protected GeneratedJSPFile generateFooter(MetaView view, java.lang.String selection, java.lang.String name)
Generates a footer file which is included by other jsps.- Parameters:
view- the vie to generate the footer for.selection- ?name- the name of the file.- Returns:
- a
GeneratedJSPFileobject.
-
getDuplicateImage
protected java.lang.String getDuplicateImage()
Returns image tag for the duplicate entry image.- Returns:
- a
Stringobject.
-
getBaseJSPFooter
protected java.lang.String getBaseJSPFooter()
Returns the basic footer used in all jsps.- Returns:
- content of the base jsp footer.
-
getShowPageName
public static java.lang.String getShowPageName(MetaDocument doc)
Returns the name of the jsp file for the show page for the document.- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getSearchResultPageName
public static java.lang.String getSearchResultPageName()
getSearchResultPageName.
- Returns:
- a
Stringobject.
-
getVersionInfoPageName
public static java.lang.String getVersionInfoPageName()
Returns the page name for the version info page.- Returns:
- a
Stringobject.
-
getVersionInfoPageName
public static java.lang.String getVersionInfoPageName(MetaDocument doc)
Returns the page name for the version info page for the given document.- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getShowQueriesPageName
public static java.lang.String getShowQueriesPageName(MetaDocument doc)
getShowQueriesPageName.
- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getExportAsCSVPageName
public static java.lang.String getExportAsCSVPageName(MetaDocument doc)
Returns the name of the jsp file for the csv page export for the document.- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getExportAsXMLPageName
public static java.lang.String getExportAsXMLPageName(MetaDocument doc)
Returns the name of the jsp file for the xml page export for the document.- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getEditPageName
public static java.lang.String getEditPageName(MetaDocument doc)
Returns the name of the edit page for this document.- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getDialogName
public static java.lang.String getDialogName(MetaDialog dialog, MetaDocument doc)
getDialogName.
- Parameters:
dialog- aMetaDialogobject.doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getLinksToMePageName
public static java.lang.String getLinksToMePageName(MetaDocument doc)
getLinksToMePageName.
- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getContainerPageName
public static java.lang.String getContainerPageName(MetaDocument doc, MetaContainerProperty table)
getContainerPageName.
- Parameters:
doc- aMetaDocumentobject.table- aMetaContainerPropertyobject.- Returns:
- a
Stringobject.
-
generateTimestampedLinkPath
protected static java.lang.String generateTimestampedLinkPath(java.lang.String path)
generateTimestampedLinkPath.
- Parameters:
path- aStringobject.- Returns:
- a
Stringobject.
-
getCurrentImagePath
protected java.lang.String getCurrentImagePath(java.lang.String imageName)
getCurrentImagePath.
- Parameters:
imageName- aStringobject.- Returns:
- a
Stringobject.
-
getImagePath
public static java.lang.String getImagePath(java.lang.String imageName, Context context)getImagePath.
- Parameters:
imageName- aStringobject.context- aContextobject.- Returns:
- a
Stringobject.
-
getCurrentCSSPath
protected java.lang.String getCurrentCSSPath(java.lang.String stylesheetName)
getCurrentCSSPath.
- Parameters:
stylesheetName- aStringobject.- Returns:
- a
Stringobject.
-
getCurrentJSPath
protected java.lang.String getCurrentJSPath(java.lang.String jsName)
getCurrentJSPath.
- Parameters:
jsName- aStringobject.- Returns:
- a
Stringobject.
-
getCurrentYUIPath
protected java.lang.String getCurrentYUIPath(java.lang.String yuiName)
getCurrentYUIPath.
- Parameters:
yuiName- aStringobject.- Returns:
- a
Stringobject.
-
getCurrentJavaScriptPath
protected java.lang.String getCurrentJavaScriptPath(java.lang.String javaScript)
getCurrentJavaScriptPath.
- Parameters:
javaScript- aStringobject.- Returns:
- a
Stringobject.
-
getCSSPath
public static java.lang.String getCSSPath(java.lang.String stylesheetName, Context context)getCSSPath.
- Parameters:
stylesheetName- aStringobject.context- aContextobject.- Returns:
- a
Stringobject.
-
getJSPath
public static java.lang.String getJSPath(java.lang.String jsName, Context context)getJSPath.
- Parameters:
jsName- aStringobject.context- aContextobject.- Returns:
- a
Stringobject.
-
getJavaScriptPath
public static java.lang.String getJavaScriptPath(java.lang.String javaScript, Context context)getJavaScriptPath.
- Parameters:
javaScript- aStringobject.context- aContextobject.- Returns:
- a
Stringobject.
-
getYUIPath
public static java.lang.String getYUIPath(java.lang.String yuiName, Context context)getYUIPath.
- Parameters:
yuiName- aStringobject.context- aContextobject.- Returns:
- a
Stringobject.
-
getPackage
public static java.lang.String getPackage(MetaModule mod)
getPackage.
- Parameters:
mod- aMetaModuleobject.- Returns:
- a
Stringobject.
-
getPackage
public static java.lang.String getPackage(MetaDocument doc)
getPackage.
- Parameters:
doc- aMetaDocumentobject.- Returns:
- a
Stringobject.
-
getDeleteImage
protected java.lang.String getDeleteImage()
Returns the tag for the delete image in the overview.- Returns:
- a
Stringobject.
-
getPreviewImage
protected java.lang.String getPreviewImage()
Returns the tag for the preview image in the overview.- Returns:
- a
Stringobject.
-
getVersionImage
protected java.lang.String getVersionImage()
Returns the tag for the version info image in the overview. Note: for now it returns a 'V' text.- Returns:
- a
Stringobject.
-
getEditImage
protected java.lang.String getEditImage()
Returns the tag for the edit image in the overview.- Returns:
- a
Stringobject.
-
getVersionImage
protected java.lang.String getVersionImage(java.lang.String alt)
Returns the tag for the Version in the overview with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getDeleteImage
protected java.lang.String getDeleteImage(java.lang.String alt)
Returns the tag for the delete image in the overview with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getPreviewImage
protected java.lang.String getPreviewImage(java.lang.String alt)
Returns the tag for the preview image in the overview with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getLockImage
protected java.lang.String getLockImage()
Returns the tag for the lock image in the overview.- Returns:
- created image tag
-
getUnLockImage
protected java.lang.String getUnLockImage()
Returns the tag for the lock image in the overview.- Returns:
- created image tag
-
getLockImage
protected java.lang.String getLockImage(java.lang.String alt)
Returns the tag for the lock image in the overview with the given alt tag.- Parameters:
alt- actually alt - for the image tag- Returns:
- created image tag
-
getUnLockImage
protected java.lang.String getUnLockImage(java.lang.String alt)
Returns the tag for the unLock image in the overview with the given alt tag.- Parameters:
alt- actually alt for image tag- Returns:
- created image tag
-
getTopImage
protected java.lang.String getTopImage(java.lang.String alt)
Returns the tag for the move to the top image in the list view with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getBottomImage
protected java.lang.String getBottomImage(java.lang.String alt)
Returns the tag for the move to the bottom image in the list view with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getUpImage
protected java.lang.String getUpImage(java.lang.String alt)
Returns the tag for the move up image in the list view with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getDownImage
protected java.lang.String getDownImage(java.lang.String alt)
Returns the tag for the move down image in the list view with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getDuplicateImage
protected java.lang.String getDuplicateImage(java.lang.String alt)
Returns the tag for the duplicate image in the overview with the given alt tag.- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getEditImage
protected java.lang.String getEditImage(java.lang.String alt)
getEditImage.
- Parameters:
alt- aStringobject.- Returns:
- a
Stringobject.
-
getImage
protected java.lang.String getImage(java.lang.String name, java.lang.String alt)Returns the img tag to embed an image into the jsp.- Parameters:
name- name of the gif file containing the image.alt- alternative description (alt tag).- Returns:
- a
Stringobject.
-
generatePragmas
protected void generatePragmas(MetaView view)
Generates pragmas for a given view.- Parameters:
view- the view to generate pragmas for.
-
generatePragmas
protected void generatePragmas()
Generates generic pragmas. Adds the generated content to the current job.
-
openTag
protected void openTag(java.lang.String tag, java.lang.String params)openTag.
- Parameters:
tag- aStringobject.params- aStringobject.
-
closeTag
protected void closeTag(java.lang.String tag, java.lang.String params)closeTag.
- Parameters:
tag- aStringobject.params- aStringobject.
-
openTR
protected void openTR(java.lang.String additionalParams)
openTR.
- Parameters:
additionalParams- aStringobject.
-
closeTR
protected void closeTR(java.lang.String additionalParams)
closeTR.
- Parameters:
additionalParams- aStringobject.
-
openTR
protected void openTR()
openTR.
-
closeTR
protected void closeTR()
closeTR.
-
openTD
protected void openTD()
Opens a table cell.
-
closeTD
protected void closeTD()
closeTD.
-
openTD
protected void openTD(java.lang.String additionalParams)
Opens a table cell.- Parameters:
additionalParams- additional parameters.
-
closeTD
protected void closeTD(java.lang.String additionalParams)
closeTD.
- Parameters:
additionalParams- aStringobject.
-
tag
protected void tag(java.lang.String tag, java.lang.String id, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output tag without body.- Parameters:
tag- tag nameid- html id attributeclazz- html class attributeattrs- array of tag attributes
-
tag
protected void tag(java.lang.String tag, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output tag without body.- Parameters:
tag- tag nameclazz- html class attributeattrs- array of tag attributes
-
tag
protected void tag(java.lang.String tag, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output tag without body.- Parameters:
tag- tag nameattrs- array of tag attributes
-
tagOpen
protected void tagOpen(java.lang.String tag, java.lang.String id, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output opening for tag.- Parameters:
tag- tag nameid- html id attributeclazz- html class attributeattrs- array of tag attributes
-
tagOpen
protected void tagOpen(java.lang.String tag, java.lang.String clazz, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output opening for tag.- Parameters:
tag- tag nameclazz- html class attributeattrs- array of tag attributes
-
tagOpen
protected void tagOpen(java.lang.String tag, AbstractJSPGenerator.TagAttribute... attrs)Appends to generation output opening for tag.- Parameters:
tag- tag nameattrs- array of tag attributes
-
tagClose
protected void tagClose(java.lang.String tag)
Appends to generation output closing for tag.- Parameters:
tag- tag name
-
openJavaScript
protected void openJavaScript()
Appends to generation output script tag with type javascript.
-
closeJavaScript
protected void closeJavaScript()
Appends to generation output script tag closing.
-
getTopMenuPage
protected java.lang.String getTopMenuPage()
getTopMenuPage.
- Returns:
- a
Stringobject.
-
getMenuName
protected java.lang.String getMenuName(MetaView view)
getMenuName.
- Parameters:
view- aMetaViewobject.- Returns:
- a
Stringobject.
-
-