result.setName(DISPLAY_COMPONENT);
DefaultGraphForFunctionByEventsourceGraph graph = new DefaultGraphForFunctionByEventsourceGraph();
BoostFunction getTagBeansXML1 = ReflectionFunctions.createInvokeMethod("text");
BoostFunction getTagBeansXML = FunctionFactory.concatenation( getTagBeansXML1,
new StringFunctions(StringFunctions.Operation.replace, "</beans>" , "<bean id=\"appletArchiveDir\" class=\"project.gluebooster.text.StringBean\"><property name=\"append\" value=\""+ getFilename(APPLET_ARCHIVE_DIR)+"\"/></bean> <bean id=\"appletCodebaseDir\" class=\"project.gluebooster.text.StringBean\"><property name=\"append\" value=\""+ getFilename(APPLET_CODEBASE_DIR)+"\"/></bean> </beans>")
);
BoostFunction toBeanFactory = new SpringContextFunctions(SpringContextFunctions.Operation.toBeanFactory );
graph.addEdges(getTagBeansXML, toBeanFactory);
//1: get the archive text
BoostFunction archiveText = new SpringContextFunctions(SpringContextFunctions.Operation.getBean, "archive");
BoostFunction nullToEmptyString = new StringFunctions(StringFunctions.Operation.nullToEmptyString);
BoostFunction prependGlueboosterArchives = new StringFunctions(StringFunctions.Operation.prepend, ",project/gluebooster/java/javaBooster/0.4/javaBooster-0.4.jar,jung/jung-api/2.0/jung-api-2.0.jar,jung/jung-graph-impl/2.0/jung-graph-impl-2.0.jar,commons-collections/collections-generic/4.01/collections-generic-4.01.jar,org/springframework/spring/2.5.5/spring-2.5.5.jar,jung/jung-algorithms/2.0/jung-algorithms-2.0.jar,jung/jung-visualization/2.0/jung-visualization-2.0.jar,commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar,commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar,commons-lang/commons-lang/2.3/commons-lang-2.3.jar,org/codehaus/groovy/groovy-all/1.5.7/groovy-all-1.5.7.jar,com/sun/tools/1.6.0/tools-1.6.0.jar,");
BoostFunction addArchiveDir = new StringFunctions(StringFunctions.Operation.replace, "," , ",\"+ parent.appletArchiveDir + \"/");
BoostFunction asIndex0 = ToPairFunction.createWithFirstConstant(Integer.valueOf(0));
graph.addEdges(toBeanFactory, archiveText, nullToEmptyString, prependGlueboosterArchives,addArchiveDir, asIndex0);
//2 encode the bean xml
BoostFunction escapeHtml = new StringFunctions( StringFunctions.Operation.escapeHtml);
BoostFunction asIndex1 = ToPairFunction.createWithFirstConstant(Integer.valueOf(3));
graph.addEdges(getTagBeansXML, escapeHtml, asIndex1, new StandardFunctions(StandardFunctions.Operation.constant,""));
//3: get width
BoostFunction width = new SpringContextFunctions(SpringContextFunctions.Operation.getBean, "width");
BoostFunction nullToEmptyString2 = new StringFunctions(StringFunctions.Operation.nullToEmptyString);
BoostFunction asIndex2 = ToPairFunction.createWithFirstConstant(Integer.valueOf(1));
graph.addEdges(toBeanFactory, width, nullToEmptyString2, asIndex2);
//4: get height
BoostFunction height = new SpringContextFunctions(SpringContextFunctions.Operation.getBean, "height");
BoostFunction nullToEmptyString3 = new StringFunctions(StringFunctions.Operation.nullToEmptyString);
BoostFunction asIndex3 = ToPairFunction.createWithFirstConstant(Integer.valueOf(2));
graph.addEdges(toBeanFactory, height, nullToEmptyString3, asIndex3);
//combine
ListAssemblingFunctionWithIndices toList = new ListAssemblingFunctionWithIndices(4, "as list");
graph.addEdge(asIndex0, toList);
graph.addEdge(asIndex1, toList);
graph.addEdge(asIndex2, toList);
graph.addEdge(asIndex3, toList);
BoostFunction concatenation = new StringFunctions( StringFunctions.Operation.concatenate, getArchiveDirJavascript() + APPLET_JAVASCRIPT_1
,null, APPLET_JAVASCRIPT_2 , "' width='", null, "' height='", null, "'><param NAME='beans' value=\"", null, "\"/></applet>");
graph.addEdge(toList, concatenation);
FunctionByEventsourceGraph<Tag, String> function = new FunctionByEventsourceGraph(graph, getTagBeansXML, concatenation);