#ifndef ____workflow_h__
#define ____workflow_h__

#include "HTTPPage.h"

namespace http {

   class __workflow : public HTTPPage {

      int processCommand(std::string request, core::TCPSession *session, HTTPSession *httpSession, HTTPRequest &httpRequest, std::stringstream &data) {	   
         data << "<svg style=\"width: 100%; height: 100%; position: absolute; top: 0px; left: 0px;\">" << std::endl;
         data << " <path id=\"connector0\" data-source=\"start:bottom\" data-dest=\"formpage1\" d=\"\" stroke=\"#FFFFFF\" stroke-width=\"1\" fill=\"none\" />" << std::endl;
         data << " <path id=\"connector1\" data-source=\"formpage1:next\" data-dest=\"formpage2\" d=\"\" stroke=\"#FFFFFF\" stroke-width=\"1\" fill=\"none\" />" << std::endl;
         data << " <path id=\"connector2\" data-source=\"formpage2:next\" data-dest=\"formpage3\" d=\"\" stroke=\"#FFFFFF\" stroke-width=\"1\" fill=\"none\" />" << std::endl;
         data << " <path id=\"connector3\" data-source=\"formpage2:previous\" data-dest=\"formpage1\" d=\"\" stroke=\"#FFFFFF\" stroke-width=\"1\" fill=\"none\" />" << std::endl;
         data << " <path id=\"connector4\" data-source=\"formpage3:previous\" data-dest=\"formpage2\" d=\"\" stroke=\"#FFFFFF\" stroke-width=\"1\" fill=\"none\" />" << std::endl;
         data << " <path id=\"connector5\" data-source=\"formpage3:process\" data-dest=\"processform\" d=\"\" stroke=\"#FFFFFF\" stroke-width=\"1\" fill=\"none\" />" << std::endl;
         data << "</svg>" << std::endl;
         data << "<div style=\"position: absolute; width: 200px; top: 20px; left: 50px; background: #C04040; border: 1px solid white;\" id=\"start\"" << std::endl;
         data << "     onmousedown=\"mousedown(this, event); return true;\" " << std::endl;
         data << "     onmouseup=\"mouseup(event); return true;\" " << std::endl;
         data << "     onmousemove=\"mousemove(event); return true;\">" << std::endl;
         data << "[AQ] START" << std::endl;
         data << "</div>" << std::endl;
         data << "" << std::endl;
         data << "<div style=\"position: absolute; top: 100px; left: 150px; background: #E0E0E0; border: 1px solid white; color: #000000;\" " << std::endl;
         data << "     id=\"formpage1\"" << std::endl;
         data << "     onmousedown=\"mousedown(this, event); return true;\" " << std::endl;
         data << "     onmouseup=\"mouseup(event); return true;\" " << std::endl;
         data << "     onmousemove=\"mousemove(event); return true;\">" << std::endl;
         data << "" << std::endl;
         data << " <div style=\"width: 200px; height: 20px; padding-left: 3px; background: #4040C0; color: #FFFFFF;\">" << std::endl;
         data << "  <span>[XQ] FORM Page 1</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"cancel\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px ;background: #C0C0FF;\">" << std::endl;
         data << "  <span>Cancel</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"next\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px; background: #C0C0FF;\">" << std::endl;
         data << "  <span>Next</span> " << std::endl;
         data << " </div>" << std::endl;
         data << "</div>" << std::endl;
         data << "" << std::endl;
         data << "<div style=\"position: absolute; top: 300px; left: 250px; background: #E0E0E0; border: 1px solid white;\" " << std::endl;
         data << "     id=\"formpage2\" " << std::endl;
         data << "     onmousedown=\"mousedown(this, event); return true;\" " << std::endl;
         data << "     onmouseup=\"mouseup(event); return true;\" " << std::endl;
         data << "     onmousemove=\"mousemove(event); return true;\">" << std::endl;
         data << " <div style=\"width: 200px; height: 20px; padding-left: 3px; background: #4040C0; color: #FFFFFF;\">" << std::endl;
         data << "  <span>[XQ] FORM Page 2</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"previous\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px ;background: #C0C0FF;\">" << std::endl;
         data << "  <span>Previous</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"next\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px; background: #C0C0FF;\">" << std::endl;
         data << "  <span>Next</span> " << std::endl;
         data << " </div>" << std::endl;
         data << "</div>" << std::endl;
         data << "" << std::endl;
         data << "<div style=\"position: absolute; top: 400px; left: 200px; background: #E0E0E0; border: 1px solid white;\" " << std::endl;
         data << "     id=\"formpage3\" " << std::endl;
         data << "     onmousedown=\"mousedown(this, event); return true;\" " << std::endl;
         data << "     onmouseup=\"mouseup(event); return true;\" " << std::endl;
         data << "     onmousemove=\"mousemove(event); return true;\">" << std::endl;
         data << " <div style=\"width: 200px; height: 20px; padding-left: 3px; background: #4040C0; color: #FFFFFF;\">" << std::endl;
         data << "  <span>[XQ] FORM Page 3</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"previous\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px ;background: #C0C0FF;\">" << std::endl;
         data << "  <span>Previous</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"process\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px; background: #C0C0FF;\">" << std::endl;
         data << "  <span>Process Form</span> " << std::endl;
         data << " </div>" << std::endl;
         data << "</div>" << std::endl;
         data << "" << std::endl;
         data << "<div style=\"position: absolute; top: 500px; left: 200px; background: #E0E0E0; border: 1px solid white;\" " << std::endl;
         data << "     id=\"processform\" " << std::endl;
         data << "     onmousedown=\"mousedown(this, event); return true;\" " << std::endl;
         data << "     onmouseup=\"mouseup(event); return true;\" " << std::endl;
         data << "     onmousemove=\"mousemove(event); return true;\">" << std::endl;
         data << " <div style=\"width: 200px; height: 20px; padding-left: 3px; background: #40C040; color: #FFFFFF;\">" << std::endl;
         data << "  <span>[PQ] Process Form</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"previous\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px ;background: #C0C0FF;\">" << std::endl;
         data << "  <span>Previous</span> " << std::endl;
         data << " </div>" << std::endl;
         data << " <div data-name=\"process\" style=\"width: 200px; height: 20px; margin-top: 2px; padding-left: 3px; background: #C0C0FF;\">" << std::endl;
         data << "  <span>Process Form</span> " << std::endl;
         data << " </div>" << std::endl;
         data << "</div>" << std::endl;
         data << "" << std::endl;
         data << "<script src=\"/__workflow_js\" />" << std::endl;

	 httpRequest.response.addHeader("Content-Type", "script/javascript");
         return 0;

      }

   };

}

#endif
