Search

Search Result

Demo web page written using JLevel 2.0




JLevel version 2.0 is now ready and will be available for download on Friday the 15th March by 9pm NZ time. It will be available on SourceForge.net and will also be downloadable from this page. Meanwhile here are the preview codes to enlighten you on how to use JLevel 2.0. As mention in the previous announcements that we released regarding JLevel 2.0, it has very significant deviation from what version 1.0.0 offered before. But for the benefit of those that have used JLevel 1.0.0 Beta we have retained the variable version but has made some changes to make the variable easier to code than was previously allowed. Instead of starting a variable with $ sign and ending the variable with $ sign each variable now starts with either : s - for styled open variable (ready to accept in-line style see demo code for details) o - for open variable (ready to accept attributes see dome for details) c - for closed opening variable (does not accept style nor attributes) e - for end variable (ends all three opening variables above)




It might interest you to know that this content was generated using JLevel inside Servlet. Use JLevel freely for your Java codes of any form you can experiment and see what works best for you to enhance your productivity. It is simple as you can see below just call method that has name of html tags that we are all familiar with and get you tags form and properly closed for you by JLevel. Apply CSS as you would on any html web page, this time with JLevel if you start the content within any method that you called with css, JLevel detects it and inserts the style attribute for you and yet format things as it should but if you choose not to use in-line still it will omit the style. This does not mean that if you did not start your content with css that you cannot define it at any point by calling the style method.Pay proper attention to our sample codes and you will learn a lot of simple tricks to make your coding faster and even more rewarding. Never waste your time looking for html parser as JLevel has taken over and provide you with new and improved experience on parsing html with Java without writing much code.
/**
 * @author Kogonuso
 * @since 09/03/13
 *
 */



import com.kogonuso.JLevel;

public class Transition extends JLevel{

   /*This method demonstrates how JLevel 2.0 can be written using only methods 
    * instead of variables as in the content in the method 
    * below it is your choice to pick the method you prefer and stick to it*/
    protected String processRequest(){
       
            String[] document ={
    doctype(),
    html( 
     head(
      title(t("JavaScript testing in JLevel")),

               includeStyle("stylesheet1.css"),

               attachJQuery("//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js")

    ),
    body(

    div(id$("mainContent"),
    div(id$("nav"),br,
                                //header and navigation called as a separate method
                                headerAndNavigation(),
                                br7,
                               
    //menu a
     dl(class$("dropdown"),
     dt( id$("one-ddheader"),onmouseover$("ddMenu('one',1)"),
       onmouseout("ddMenu('one',-1)"),t("Menu One")),
     dd( id$("one-ddcontent"),onmouseover$("cancelHide('one')"),
       onmouseout("ddMenu('one',-1)"),
     ul(
     li(a (href$("#"),class$("underline"), t(" Item 1"))),
     li(a (href$("#"),class$("underline"), t("Item 2" ))),
    li(a( href$("#"),class$("underline"), t("Item 3") )),
    li(a(href$("#"),class$("underline"), t(" Item 4" ))),
    li(a(href$("#"),t("Item 5")))
     ))),
//     //menu 2
     dl(class$("dropdown"),
       dt( id$("two-ddheader"),onmouseover$("ddMenu('two',1)"),
         onmouseout("ddMenu('two',-1)"),t("Menu two")),
       dd( id$("two-ddcontent"),onmouseover$("cancelHide('two')"),
         onmouseout("ddMenu('two',-1)"),
       ul(
       li(a(href$("#"),class$("underline"),t("Item 1"))),
       li(a(href$("#"),class$("underline"),t("Item 2"))),
      li(a(href$("#"),class$("underline"),t(" Item 3"))),
      li(a(href$("#"),class$("underline"),t("Item 4"))),
      li(a(href$("#"),t("Item 5")))
       ))),
     //menu3
     //menu 2
       dl(class$("dropdown"),
         dt( id$("three-ddheader"),onmouseover$("ddMenu('three',1)"), 
           onmouseout("ddMenu('three',-1)"),t("Menu three")),
         dd( id$("three-ddcontent"),onmouseover$("cancelHide('three')"),
           onmouseout("ddMenu('three',-1)"),
         ul(
         li(a(href$("#"),class$("underline"),t("Item 1"))),
         li(a(href$("#"),class$("underline"),t("Item 2"))),
        li(a(href$("#"),class$("underline"),t("Item 3"))),
        li(a(href$("#"),class$("underline"),t("Item 4"))),
        li(a(href$("#"),t(" Item 5")))
         ))),
     div("margin-left:30px;clear:both;",
     //Content area
       
     p("font-weight:900;color:green;",t(br+"Pure JLevel tag free Java made possible Html page")),
     pre(big(t("Get Ready for JLevel 2.0 - the simple tag free html java code library"+br+
     "Go ahead and start forgetting what they taught you regarding counting HTML " +br+
     "Tags both in web Development and java coding as these will become obsolete with JLevel 2.0."+br+

     "It will provide experience that will seem fulfilling just like when web 2.0 took over the norm" +br+
     "of WWW/Internet interaction and remained so today."+br+

     "Nothing new to learn if you already know Java and Html. Your knowledge of JLevel 1.0.0 Beta " +br+
     "WILL NOT BE useful with JLevel 2.0 as this is totally re-engineered library."+br+
     "The purpose is still the same - to make programing and web development never feel like a drag " +br+
     "anymore for developer that uses Html,Css JavaScript,jQuery and other scripts."+br+

     "It will be simple that you will forget that Html ever has close set (tags). That is you will " +br+
     "never worry about closing the open tag that takes attributes or in-line style and closing tag " +br+
     "at all, all these have be automated. Furthermore,all self closing tags are have been taken care of."+br+

     "Watch out for the preview code this week!")))
      
 
       ))),br2,
    

                                //footer method
                                footer(),

                                
    insertScript("C:/Users/Kogonuso/Desktop/Portables/Sites/Servlet+JSP/Test/WebContent/dropdown.js"),
                insertScript("C:/Users/Kogonuso/Desktop/Portables/Sites/Servlet+JSP/Test/WebContent/js2.js")
    
    ))
  };
  saveAsHtml("transition", level(document));
  return(level(document));
        }

    /*This method demonstrates how JLevel 2.0 can be written using only variable instead of methods as in the content above
     * it is your choice to pick the method you prefer and stick to it*/
    protected String headerAndNavigation(){
     String[] headerNav ={
                //header
                 div("width:1000px;height:70px;", id$("header"),
                 h1(id$("head"),a(href$("#"),
                 t("JLevel 2.0 - Java Library")))
                 ),
                 
                 //the navigation bar
                 sdiv,"width:1000px;height:60px;line-height:50px;background-color:#0D2A4F;margin:auto;",ct,
                 odiv,id$,"navdiv",ct,
         oul,id$,"nav",ct,
         cli,aHref,"#",ct,"Home",ea,eli,
                                            cli,aHref,"#",ct,"JLevel v2.0",ea,eli,
            cli,
             aHref,"http://jlevel4java.blogspot.co.nz/",ct,"Products",ea,
                oul,class$,"child",ct,
                    cli,aHref,"#",ct,"Animation",ea,eli,
                                                cli,aHref,"#",ct,"Transition",ea,eli,
                    cli,aHref,"#",ct,"Content",ea,eli,
                    cli,aHref,"#",ct,"Speakers",ea,
                                                  cul,
                            cli,aHref,"#",ct,"10 watt",ea,eli,
                            cli,aHref,"#",ct,"20 watt",ea,eli,
                            cli,aHref,"#",ct,"30 watt",ea,eli,
                        eul,
                    cli,
                    cli,aHref,"#",ct,"Random Equipment",ea,eli,
                eul,
            eli,
            cli,
                aHref,"http://kogonuso.blogspot.co.nz/",ct,"Services",ea,
                oul,class$,"child",ct,
                    cli,aHref,"#",ct,"Repairs",ea,eli,
                    cli,aHref,"#",ct,"Installations",ea,eli,
                    cli,aHref,"#",ct,"Setups",ea,eli,
                eul,
            eli,
            cli,aHref,"http://jlevel4java.blogspot.com/p/about.html",ct,"About",ea,eli,
            cli,aHref,"http://jlevel4java.blogspot.com/p/spport.html",ct,"Contact",ea,eli,
        eul,
        ediv,ediv
                                        
                                    };
            
            return level(headerNav);
        }
        
    /*One of short methods to show how methods can be used inside a JLevel document former method*/
        protected String footer(){
            String[] footer ={
            cdiv,ccenter,ofooter,id$,"footer",ct,"© JLevel 2013. All Rights Reserved!",efooter,ecenter,ediv,
             };
         
         return level(footer);
        }
        
        
        
        /*One of short methods to show how methods can be used inside a JLevel document former method*/
        protected String advert(){
         return br6+"That's what JLevel can do for you!";
        }

    

 public static void main(String[] args) {
  Transition t = new Transition();
  t.processRequest();

 }

}

No comments: