All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.asg.generator.view.jsp.TablePageJspGenerator Maven / Gradle / Ivy

package net.anotheria.asg.generator.view.jsp;

import java.util.List;

import net.anotheria.asg.generator.GeneratedJSPFile;
import net.anotheria.asg.generator.meta.MetaDocument;
import net.anotheria.asg.generator.meta.MetaProperty;
import net.anotheria.asg.generator.meta.MetaTableProperty;
import net.anotheria.asg.generator.view.CMSMappingsConfiguratorGenerator;
import net.anotheria.asg.generator.view.action.ModuleBeanGenerator;
import net.anotheria.asg.generator.view.meta.MetaModuleSection;
import net.anotheria.util.StringUtils;

/**
 * Generates the jsps for the edit view.
 * @author another
 */
public class TablePageJspGenerator extends AbstractJSPGenerator {
	
	
	
	public GeneratedJSPFile generate(MetaModuleSection section, MetaDocument doc, MetaTableProperty table){
		
		GeneratedJSPFile jsp = new GeneratedJSPFile();
		startNewJob(jsp);
		jsp.setName(getContainerPageName(doc, table));
		
	    resetIdent();
	    
	    List columns = table.getColumns();
	    String formName = CMSMappingsConfiguratorGenerator.getContainerEntryFormName(doc, table);
	    
		append(getBaseJSPHeader());
		
		appendString("");
		appendString("");
		increaseIdent();
		appendString("");
		increaseIdent();
		appendString("Edit "+doc.getName()+StringUtils.capitalize(table.getName())+"");
		generatePragmas();
		appendString("");
		decreaseIdent();
		appendString("");
		appendString("");
		increaseIdent();		
		
		appendString("");
		increaseIdent();
		appendString("");
	    appendIncreasedString("");
		for (int i=0; i"+StringUtils.capitalize(table.extractSubName(p))+"");
		}
	    appendIncreasedString("");
		appendString("");
		appendString("");
		increaseIdent();
		appendString("\">");
		increaseIdent();
		appendString("");
		for (int i=0; i");
		}
		String parameter = "pId=";
		parameter += "&pPosition=";
		appendString("");
		decreaseIdent();
		appendString("");
		decreaseIdent();
		appendString("");
		decreaseIdent();
		appendString("
Pos 
"+getDeleteImage("delete row")+"
"); appendString("
"); decreaseIdent(); appendString(""); increaseIdent(); //TODO removing of "html:" may cause some problems... //appendString(""); appendString("
"); //appendString(""); appendString(""); appendString("\">"); appendString("
"); appendIncreasedString(""); appendString(""); for (int i=0; i"); increaseIdent(); if (i"); increaseIdent(); String name = table.extractSubName(p); if (name==null || name.length()==0) name = " "; appendString(name+":"); decreaseIdent(); appendString(""); decreaseIdent(); appendString(""); }else{ if (i==columns.size()){ appendString(""); appendString(""); } } decreaseIdent(); appendString(""); } //appendString(""); appendString(""); appendString(""); decreaseIdent(); appendString(""); appendString(""); append(getBaseJSPFooter()); return jsp; } }









Add row:
 "); String field = ""; field += ""; field += "\">"; appendIncreasedString(field); appendString(" "); }else{ appendString(" "); appendIncreasedString(" » Add "); appendString("