Package com.simoncat.beans

Examples of com.simoncat.beans.FinalScreenOutput


   
      XMLServers xmlserver = new XMLServers();
      ss=xmlserver.readXmls("", this.getServlet().getServletContext());
      System.out.println("3")
      if(ss==null){
    FinalScreenOutput fso = new FinalScreenOutput();
    fso.setPageTitle    ("Schedule Server [Finished]");

    fso.setMessage       ("No existen servidores para programar reinicios!");
    if (Constants.xmlOutputOnly) {
        request.setAttribute ("content", Constants.xmlContentType);
    } else {
        request.setAttribute ("content", Constants.htmlContentType);
        request.setAttribute ("style", "confirm.xsl");
View Full Code Here


        
   
      XMLServers xmlserver = new XMLServers();
      ss=xmlserver.readXmls("", this.getServlet().getServletContext());
      if(ss==null){
    FinalScreenOutput fso = new FinalScreenOutput();
    fso.setPageTitle    ("List Servers [Finished]");

    fso.setMessage       ("No existen servidores para listar!");
    if (Constants.xmlOutputOnly) {
        request.setAttribute ("content", Constants.xmlContentType);
    } else {
        request.setAttribute ("content", Constants.htmlContentType);
        request.setAttribute ("style", "confirm.xsl");
View Full Code Here

                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {

        HttpSession session = request.getSession();

        FinalScreenOutput fso = new FinalScreenOutput();
        fso.setPageTitle    ("Add Server [Finished]");

        if ( form != null ) { 

            DynaActionForm df =  (DynaActionForm) form;
            String username   =  (String) df.get("name");
            String useri_p  =  (String) df.get("address");
            String user  =  (String) df.get("user");
      String password  =  (String) df.get("password");     
      String portSSH =  (String) df.get("portssh");
         String tomcatPath =  (String) df.get("tomcatPath");
         String userTomcat =  (String) df.get("userTomcat");
            String passwordTomcat =  (String) df.get("passwordTomcat");
      String port =  (String) df.get("port");
      String testURL =  (String) df.get("testURL")
       String observation  =  (String) df.get("observation");       
 
            Server c         =  new Server();
            c.setName(username);
            c.setAddress(useri_p);
      c.setUser(user);
            c.setPassword(password);
      c.setPortSSH(portSSH);
         c.setTomcatPath(tomcatPath);
         c.setUserTomcat(userTomcat);
            c.setPasswordTomcat(passwordTomcat);
      c.setPort(port);
      c.setTestURL(testURL);                       
      c.setObservation(observation);

            session.setAttribute ("server_data", c);
   
      XMLServers xmlserver = new XMLServers();
      boolean r = xmlserver.writeToXml(c,"", this.getServlet().getServletContext());
 
            fso.setMessage       ("Server's information added sucessfully! xml:"+r);

        } else {
            fso.setMessage       ("Sorry, problem with submitted form!");
        }

        if (Constants.xmlOutputOnly) {
            request.setAttribute ("content", Constants.xmlContentType);
        } else {
View Full Code Here

                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {

        //HttpSession session = request.getSession();

        FinalScreenOutput fso;

        if ( form != null ) {
 
            //DynaActionForm df =  (DynaActionForm) form;
            //String warName  =  (String) df.get("c1");
            //String serverId =  (String) df.get("c2");
      //System.out.println("WAR:"+ warName + " Server:" + serverId );


            //recovery war

    /*FileUploadUtils fu = new FileUploadUtils(request);
    Map<String,FileField> fileMap = fu. getFileFieldMap();
    Map<String,String> nfileMap = fu.getNonFileFieldMap();
    FileField ff = fileMap.get("fileControl");
    String fileName = nfileMap.get("fileName");
    fileName = "/home/repository/"+fileName;
  
    ff.write(fileName);*/
     
      System.out.println("AAA");
      if (ServletFileUpload.isMultipartContent(request)){
    System.out.println("BBB");
          // Parse the HTTP request...
        //ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());
        //List fileItemsList = servletFileUpload.parseRequest(request);
       
        DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory();
        diskFileItemFactory.setSizeThreshold(140960); /* the unit is bytes */

    System.out.println("CCC");
        File repositoryPath = new File("/tmp");
        diskFileItemFactory.setRepository(repositoryPath);
    System.out.println("DDD");
        ServletFileUpload servletFileUpload = new ServletFileUpload(diskFileItemFactory);
        servletFileUpload.setSizeMax(-1);//81920); /* the unit is bytes */
        System.out.println("EEE");
        try {
       
            List fileItemsList = servletFileUpload.parseRequest(request);
        System.out.println("FFF items#"+fileItemsList.size())
            /* Process file items... */
            Iterator it = fileItemsList.iterator();
            while (it.hasNext()){
                System.out.println("GGG");     
              FileItem fileItem = (FileItem)it.next();
              if (fileItem.isFormField()){
                /* The file item contains a simple name-value pair of a form field */
                System.out.println("CAMPO NORMAL:"+fileItem.getFieldName());
              }
              else{
                /* The file item contains an uploaded file */
                System.out.println("CAMPO FILE:"+fileItem.getFieldName());
              }
            }
        System.out.println("HHH");
        }
        catch (SizeLimitExceededException ex) {
            /* The size of the HTTP request body exceeds the limit */
      System.out.println("SE DESPARRAMO POR EL TAMAÑO DEL FILE");
        }
    System.out.println("III");
       
      }
           System.out.println("JJJ");    

            //undeploy WAR in SERVER
    //recuperar los datos del server
     //Server server = new Server();

    //verificar si la aplicasion esta corriendo?
    ////http://localhost:8080/manager/list
    HttpClient hc1 = new HttpClient("localhost",8080,"tomcat","admin","");
    boolean lb = hc1.appIsRunning("Binary");
    boolean ub=false;
    boolean db=false;
    if(lb){
      // autenticar y undeploy la aplicacion en el tomcat.
      ////http://localhost:8080/manager/undeploy?path=/Binary
      String undeploy = "http://localhost:8080/manager/undeploy?path=/Binary";
           HttpClient hc2 = new HttpClient("localhost",8080,"tomcat","admin",undeploy);
       ub=hc2.execute();
    }
        //Copy WAR
    //confirmar upload 
   
    if((lb && ub) || (!lb) ){
          //Deploy WAR       
        //enviar comando al tomcat 
      ////http://localhost:8080/manager/deploy?path=/Binary&war=file:/tmp/Binary.war 
       String deploy = "http://localhost:8080/manager/deploy?path=/Binary&war=file:/tmp/Binary.war";
           HttpClient hc3 = new HttpClient("localhost",8080,"tomcat","admin",deploy);
       db=hc3.execute();
    }

    fso = new FinalScreenOutput();
          fso.setPageTitle    ("Upload-Deploy War[Finished]");

            fso.setMessage       ("WAR deployed sucessfully!"+ "It was Running:"+lb+" Undeploy:"+ub+" deploy:"+db);

        } else {
    fso = new FinalScreenOutput();
          fso.setPageTitle    ("Upload-Deploy War[NOT   Finished]");
            fso.setMessage       ("Sorry, problem with submitted form!");
        }

        if (Constants.xmlOutputOnly) {
            request.setAttribute ("content", Constants.xmlContentType);
        } else {
View Full Code Here

   
      XMLServers xmlserver = new XMLServers();
      ss=xmlserver.readXmls("", this.getServlet().getServletContext());
      System.out.println("3--->")
      if(ss==null){
    FinalScreenOutput fso = new FinalScreenOutput();
    fso.setPageTitle    ("Event Server [Finished]");

    fso.setMessage       ("No existen servidores para programar reinicios!");
    if (Constants.xmlOutputOnly) {
        request.setAttribute ("content", Constants.xmlContentType);
    } else {
        request.setAttribute ("content", Constants.htmlContentType);
        request.setAttribute ("style", "confirm.xsl");
View Full Code Here

TOP

Related Classes of com.simoncat.beans.FinalScreenOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.