ServletOutputStream out = response.getOutputStream(); out.println("<html><style>HTML { font-family: \"Verdana\"; font-size:10pt; }</style><body>"); out.println("<h2>Welcome to the Little-JIL loader</h2>"); out.println("<b>" + msg + "</b><br>"); out.println("<form action=\"" + request.getRequestURI() + "\" method=GET>"); out.println("Diagram name: <input type=text name=diagramName value=\"" + (diagramName == null ? "" : diagramName) + "\"> " + "<input type=submit>"); out.println("<br><br><input type=submit name=\"ai2tv\" value=\"Test ai2tv diagram\">"); out.println("</form>");
blackboard.closeTransaction();
        public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {            String diagramName = request.getParameter("diagramName");            String msg = "";            if (request.getParameter("ai2tv") != null) {                final ClientAsset client = (ClientAsset) factory.createInstance("ClientProto");                client.setClientPG(factory.createPropertyGroup("ClientPG"));                client.setFramePG(factory.createPropertyGroup("FramePG"));                ReportAsset reportAsset = (ReportAsset) factory.createInstance("ReportProto");                NewBucketPG bucketPG = (NewBucketPG) factory.createPropertyGroup("BucketPG");                bucketPG.setSampleTime(System.currentTimeMillis());                bucketPG.setGroup(new Vector() { { add(client);} });                reportAsset.setBucketPG(bucketPG);                blackboard.openTransaction();                blackboard.publishAdd(reportAsset);                blackboard.closeTransaction();                logger.debug("published report asset");                msg = "Published report asset";            }            else if (diagramName != null) {                Diagram diagram = null;                try {                    ObjectInputStream objIn = new ObjectInputStream(                            new BufferedInputStream(new FileInputStream(diagramName)));                    Program program = (Program) objIn.readObject();                    diagram = program.getRootDiagram();                    blackboard.openTransaction();                    blackboard.publishAdd(diagram);                    blackboard.closeTransaction();                    logger.debug("published diagram");                    msg = "Published diagram";                } catch (Exception e) {                    msg = "Could not load diagram: " + e;                }            }            ServletOutputStream out = response.getOutputStream();            out.println("<html><style>HTML { font-family: \"Verdana\"; font-size:10pt; }</style><body>");            out.println("<h2>Welcome to the Little-JIL loader</h2>");            out.println("<b>" + msg + "</b><br>");            out.println("<form action=\"" + request.getRequestURI() + "\" method=GET>");            out.println("Diagram name: <input type=text name=diagramName value=\"" +                    (diagramName == null ? "" : diagramName) + "\"> " +                    "<input type=submit>");            out.println("<br><br><input type=submit name=\"ai2tv\" value=\"Test ai2tv diagram\">");            out.println("</form>");        }