net.anotheria.asg.generator.view.jsp.QueriesPageJspGenerator Maven / Gradle / Ivy
package net.anotheria.asg.generator.view.jsp;
import java.util.ArrayList;
import java.util.List;
import net.anotheria.asg.generator.FileEntry;
import net.anotheria.asg.generator.GeneratedJSPFile;
import net.anotheria.asg.generator.GeneratorDataRegistry;
import net.anotheria.asg.generator.IGenerateable;
import net.anotheria.asg.generator.IGenerator;
import net.anotheria.asg.generator.meta.MetaDocument;
import net.anotheria.asg.generator.meta.MetaLink;
import net.anotheria.asg.generator.meta.MetaModule;
import net.anotheria.asg.generator.meta.MetaProperty;
import net.anotheria.asg.generator.view.CMSMappingsConfiguratorGenerator;
import net.anotheria.asg.generator.view.meta.MetaModuleSection;
import net.anotheria.asg.generator.view.meta.MetaSection;
import net.anotheria.asg.generator.view.meta.MetaView;
import net.anotheria.util.StringUtils;
/**
* Generator for the queries page. Currently obsolete.
*
* @author another
* @version $Id: $Id
*/
public class QueriesPageJspGenerator extends AbstractJSPGenerator implements IGenerator{
/* (non-Javadoc)
* @see net.anotheria.anodoc.generator.IGenerator#generate(net.anotheria.anodoc.generator.IGenerateable, net.anotheria.anodoc.generator.Context)
*/
/** {@inheritDoc} */
public List generate(IGenerateable g) {
List files = new ArrayList();
MetaView view = (MetaView)g;
FileEntry menu = new FileEntry(generateMenu(view));
menu.setType(".jsp");
files.add(menu);
FileEntry footer = new FileEntry(generateFooter(view, FOOTER_SELECTION_QUERIES, getFooterName(view)));
footer.setType(".jsp");
files.add(footer);
for (int i=0; i0){
FileEntry showQueryFile = new FileEntry(generateShowQueriesPage(section, view));
showQueryFile.setType(".jsp");
files.add(showQueryFile);
}
}
return files;
}
private GeneratedJSPFile generateShowQueriesPage(MetaModuleSection section, MetaView view){
ident = 0;
GeneratedJSPFile jsp = new GeneratedJSPFile();
jsp.setPackage(getContext().getPackageName(section.getDocument())+".jsp");
startNewJob(jsp);
jsp.setName(getShowQueriesPageName(section.getDocument()));
append(getBaseJSPHeader());
MetaDocument doc = section.getDocument();
appendString("");
appendString("");
increaseIdent();
appendString("");
increaseIdent();
appendString(""+view.getTitle()+" ");
generatePragmas(view);
appendString("");
decreaseIdent();
appendString("");
appendString("");
increaseIdent();
//appendString("");
/*
List elements = section.getElements();
*/
int colspan = 1;
appendString("");
increaseIdent();
openTR();
appendString(" ");
closeTR();
openTR();
appendString(" ");
closeTR();
openTR("class="+quote("lineCaptions"));
appendString(" Available queries: ");
closeTR();
List links = doc.getLinks();
for (int i=0; inone");
appendString("");
appendIncreasedString("")+">"+" "+"");
appendString(" ");
//ret += writeClosingTag("select");
decreaseIdent();
appendString(" GO");
decreaseIdent();
closeTD();
appendString("");
closeTR();
}
decreaseIdent();
appendString("
");
decreaseIdent();
appendString("");
appendString("");
decreaseIdent();
appendString("");
appendString("");
append(getBaseJSPFooter());
return jsp;
}
/** {@inheritDoc} */
@Override
protected String getMenuName(MetaView view){
return "../../shared/jsp/"+StringUtils.capitalize(view.getName())+"QueriesMenu";
}
private GeneratedJSPFile generateMenu(MetaView view){
GeneratedJSPFile jsp = new GeneratedJSPFile();
jsp.setPackage(getContext().getJspPackageName(MetaModule.SHARED));
jsp.setName(getMenuName(view));
append(getBaseJSPHeader());
appendString("");
increaseIdent();
appendString("");
increaseIdent();
appendString("");
increaseIdent();
appendString("");
increaseIdent();
appendString("");
appendIncreasedString(" ");
appendString(" ");
appendString("");
appendIncreasedString("\"> ");
appendString(" ");
decreaseIdent();
appendString(" ");
decreaseIdent();
appendString(" ");
decreaseIdent();
appendString(" ");
decreaseIdent();
appendString("
");
append(getBaseJSPFooter());
return jsp;
}
/** {@inheritDoc} */
@Override
protected String getFooterName(MetaView view){
return "../../shared/jsp/"+StringUtils.capitalize(view.getName())+"QueryFooter";
}
}