Author: yradtsevich
Date: 2012-08-28 11:23:31 -0400 (Tue, 28 Aug 2012)
New Revision: 43265
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.classpath
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.project
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.settings/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.settings/org.eclipse.jdt.core.prefs
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/META-INF/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/META-INF/MANIFEST.MF
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/config/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/config/tagConfig.xml
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/icons/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/icons/tree.jpg
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/annotations-api.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-ant.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-ha.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-tribes.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/ecj-3.7.2.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/el-api.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jasper-el.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jasper.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jsp-api.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jstl-1.2.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/servlet-api.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-api.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-coyote.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-dbcp.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-es.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-fr.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-ja.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-jdbc.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-util.jar
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/plugin.xml
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/Activator.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/TagAttribyteStorage.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/XMLParser.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/actions/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/actions/SampleAction.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspContext.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspFragment.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspWriter.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyPageContext.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/BodyContentTag.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/HelloTag.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/MyTag.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/ShowDateTag.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/TagLifecycle.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/simple/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/simple/tag/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/simple/tag/SimpleTagImpl.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/EditorUtil.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/FileUtil.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/SelectionUtil.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/WriterOutputStream.java
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/calendar_template.html
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/ccFoo_template.html
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/from_template.html
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/jspBody_template.html
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/test_template.html
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/view_template.html
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/info.txt
Log:
https://issues.jboss.org/browse/JBIDE-12502 - Create a prototype of a VPE templating
system without using JavaXPCOM
- VPE templating system without using JavaXPCOM created by Ilya Buziuk - initial commit
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.classpath
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.classpath
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.classpath 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib"
path="lib/annotations-api.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/catalina-ant.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/catalina-ha.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/catalina-tribes.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/catalina.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/ecj-3.7.2.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/el-api.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/jasper-el.jar"
sourcepath="c:/Users/ibuziuk/Downloads/apache-tomcat-7.0.29-src.zip"/>
+ <classpathentry exported="true" kind="lib"
path="lib/jasper.jar"
sourcepath="C:/Users/ibuziuk/Downloads/apache-tomcat-7.0.29-src.zip"/>
+ <classpathentry exported="true" kind="lib"
path="lib/jsp-api.jar"
sourcepath="C:/Users/ibuziuk/Downloads/apache-tomcat-7.0.29-src.zip"/>
+ <classpathentry exported="true" kind="lib"
path="lib/servlet-api.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-api.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-coyote.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-dbcp.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-i18n-es.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-i18n-fr.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-i18n-ja.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-jdbc.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tomcat-util.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/jstl-1.2.jar"
sourcepath="c:/Users/ibuziuk/Downloads/jstl-1.2-sources.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.project
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.project
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.project 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>by.buziuk.dom.parser</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/.settings/org.eclipse.jdt.core.prefs 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/META-INF/MANIFEST.MF
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/META-INF/MANIFEST.MF
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/META-INF/MANIFEST.MF 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,33 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Parser
+Bundle-SymbolicName: by.buziuk.dom.parser; singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: by.buziuk.dom.parser.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.editors,
+ org.eclipse.jface.text
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.eclipse.wst.xml.core.internal.document
+Bundle-ClassPath: lib/annotations-api.jar,
+ lib/catalina-ant.jar,
+ lib/catalina-ha.jar,
+ lib/catalina-tribes.jar,
+ lib/catalina.jar,
+ lib/ecj-3.7.2.jar,
+ lib/el-api.jar,
+ lib/jasper-el.jar,
+ lib/jasper.jar,
+ lib/jsp-api.jar,
+ lib/servlet-api.jar,
+ lib/tomcat-api.jar,
+ lib/tomcat-coyote.jar,
+ lib/tomcat-dbcp.jar,
+ lib/tomcat-i18n-es.jar,
+ lib/tomcat-i18n-fr.jar,
+ lib/tomcat-i18n-ja.jar,
+ lib/tomcat-jdbc.jar,
+ lib/tomcat-util.jar,
+ lib/jstl-1.2.jar
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/config/tagConfig.xml
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/config/tagConfig.xml
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/config/tagConfig.xml 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<config>
+ <schemas>
+ <schema prefix="j"
uri="http://java.sun.com/JSP/Page" />
+ <schema prefix=""
uri="http://www.w3.org/1999/xhtml" />
+ <schema prefix="t" uri="urn:jsptagdir:/WEB-INF/tags" />
+ <schema prefix="cc"
uri="http://java.sun.com/jsp/jstl/core"
/>
+ <schema prefix="c"
uri="http://java.sun.com/jsp/jstl/core"
/>
+
+ </schemas>
+ <tags>
+
+ <tag name="test"
file="template/test_template.html"></tag>
+ <tag name="from"
file="template/from_template.html"></tag>
+ <tag name="calendar"
file="template/calendar_template.html"></tag>
+ <tag name="view"
file="template/view_template.html"></tag>
+
+ <tag name="j:body"
file="template/jspBody_template.html"></tag>
+ <tag name="cc:foo"
file="template/ccFoo_template.html"></tag>
+
+ <tag name="showDate"
class="by.buziuk.dom.parser.template.util.body.tag.ShowDateTag"></tag>
+ <tag name="life"
class="by.buziuk.dom.parser.template.util.body.tag.TagLifecycle"></tag>
+ <tag name="bodyRepeater"
class="by.buziuk.dom.parser.template.util.body.tag.BodyContentTag"></tag>
+ <tag name="myTag"
class="by.buziuk.dom.parser.template.util.body.tag.MyTag"></tag>
+ <tag name="helloTag"
class="by.buziuk.dom.parser.template.util.body.tag.HelloTag"></tag>
+ <tag name="repeatBody"
class="by.buziuk.dom.parser.template.util.simple.tag.SimpleTagImpl"></tag>
+
+ <!--START JSTL core -->
+ <tag name="c:catch"
class="org.apache.taglibs.standard.tag.common.core.CatchTag"></tag>
+ <tag name="c:choose"
class="org.apache.taglibs.standard.tag.common.core.ChooseTag"></tag>
+ <tag name="c:if"
class="org.apache.taglibs.standard.tag.rt.core.IfTag"></tag>
+ <tag name="c:import"
class="org.apache.taglibs.standard.tag.rt.core.ImportTag"></tag>
+ <tag name="c:forEach"
class="org.apache.taglibs.standard.tag.rt.core.ForEachTag"></tag>
+ <tag name="c:forTokens"
class="org.apache.taglibs.standard.tag.rt.core.ForTokensTag"></tag>
+ <tag name="c:out"
class="org.apache.taglibs.standard.tag.rt.core.OutTag"></tag>
+ <tag name="c:otherwise"
class="org.apache.taglibs.standard.tag.common.core.OtherwiseTag"></tag>
+ <tag name="c:param"
class="org.apache.taglibs.standard.tag.rt.core.ParamTag"></tag>
+ <tag name="c:redirect"
class="org.apache.taglibs.standard.tag.rt.core.RedirectTag"></tag>
+ <tag name="c:remove"
class="org.apache.taglibs.standard.tag.common.core.RemoveTag"></tag>
+ <tag name="c:set"
class="org.apache.taglibs.standard.tag.rt.core.SetTag"></tag>
+ <tag name="c:url"
class="org.apache.taglibs.standard.tag.rt.core.UrlTag"></tag>
+ <tag name="c:when"
class="org.apache.taglibs.standard.tag.rt.core.WhenTag"></tag>
+ <!--END JSTL core -->
+
+ </tags>
+</config>
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/icons/tree.jpg
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/icons/tree.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/annotations-api.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/annotations-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-ant.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-ant.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-ha.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-ha.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-tribes.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina-tribes.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/catalina.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/ecj-3.7.2.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/ecj-3.7.2.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/el-api.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/el-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jasper-el.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jasper-el.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jasper.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jasper.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jsp-api.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jsp-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jstl-1.2.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/jstl-1.2.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/servlet-api.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/servlet-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-api.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-coyote.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-coyote.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-dbcp.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-dbcp.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-es.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-es.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-fr.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-fr.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-ja.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-i18n-ja.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-jdbc.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-jdbc.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-util.jar
===================================================================
(Binary files differ)
Property changes on:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/lib/tomcat-util.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/plugin.xml
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/plugin.xml
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/plugin.xml 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="Sample Action Set"
+ visible="true"
+ id="by.buziuk.dom.parser.actionSet">
+ <action
+ label="&Sample Action"
+ icon="icons/tree.jpg"
+ class="by.buziuk.dom.parser.actions.SampleAction"
+ tooltip="Parse to DOM"
+ toolbarPath="sampleGroup"
+ id="by.buziuk.dom.parser.actions.SampleAction">
+ </action>
+ </actionSet>
+ </extension>
+
+</plugin>
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/Activator.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/Activator.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/Activator.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,61 @@
+package by.buziuk.dom.parser;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "by.buziuk.dom.parser"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/TagAttribyteStorage.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/TagAttribyteStorage.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/TagAttribyteStorage.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,22 @@
+package by.buziuk.dom.parser;
+
+public class TagAttribyteStorage {
+ private String filePath;
+ private String classPath;
+
+ public String getFilePath() {
+ return filePath;
+ }
+
+ public void setFilePath(String filePath) {
+ this.filePath = filePath;
+ }
+
+ public String getClassPath() {
+ return classPath;
+ }
+
+ public void setClassPath(String classPath) {
+ this.classPath = classPath;
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/XMLParser.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/XMLParser.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/XMLParser.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,66 @@
+package by.buziuk.dom.parser;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class XMLParser {
+
+ public static Map<String, TagAttribyteStorage> getTagAttributes(String fileName,
+ String parentTag, String keyAttribute,
+ String firstOptinalAttributeValue,
+ String secondOptionalAttributeValue) {
+
+ Map<String, TagAttribyteStorage> attributeMap = new HashMap<String,
TagAttribyteStorage>();
+
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ File file = new File(fileName);
+
+ if (file.exists()) {
+ Document doc = db.parse(file);
+ Element docElement = doc.getDocumentElement();
+
+ // Print root element of the document
+ System.out.println("Root element of the document: " +
docElement.getNodeName());
+
+ NodeList tagList = docElement.getElementsByTagName(parentTag);
+ // Print total tag elements in the document
+
+ System.out.println("Total tags length: " + tagList.getLength());
+
+ if (tagList != null && tagList.getLength() > 0) {
+ for (int i = 0; i < tagList.getLength(); i++) {
+ Node node = tagList.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Element e = (Element) node;
+
+ if (e.hasAttribute(keyAttribute) &&
(e.hasAttribute(firstOptinalAttributeValue) ||
e.hasAttribute(secondOptionalAttributeValue))) {
+
+ String tagName = e.getAttribute(keyAttribute);
+ String firstAttribute = e.getAttribute(firstOptinalAttributeValue);
+ String secondAttribute = e.getAttribute(secondOptionalAttributeValue);
+
+ TagAttribyteStorage tagAttribyteStorage = new TagAttribyteStorage();
+ tagAttribyteStorage.setFilePath(firstAttribute);
+ tagAttribyteStorage.setClassPath(secondAttribute);
+
+ attributeMap.put(tagName, tagAttribyteStorage);
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ System.out.println(e);
+ }
+ return attributeMap;
+ }
+}
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/actions/SampleAction.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/actions/SampleAction.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/actions/SampleAction.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,420 @@
+package by.buziuk.dom.parser.actions;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Map;
+import javax.servlet.jsp.JspContext;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.BodyContent;
+import javax.servlet.jsp.tagext.BodyTag;
+import javax.servlet.jsp.tagext.IterationTag;
+import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.SimpleTag;
+import javax.servlet.jsp.tagext.Tag;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import by.buziuk.dom.parser.TagAttribyteStorage;
+import by.buziuk.dom.parser.XMLParser;
+import by.buziuk.dom.parser.template.util.MyJspContext;
+import by.buziuk.dom.parser.template.util.MyJspWriter;
+import by.buziuk.dom.parser.template.util.MyPageContext;
+import by.buziuk.dom.parser.util.FileUtil;
+import by.buziuk.dom.parser.util.SelectionUtil;
+
+
+/**
+ * Our sample action implements workbench action delegate. The action proxy will
+ * be created by the workbench and shown in the UI. When the user tries to use
+ * the action, this delegate will be created and execution will be delegated to
+ * it.
+ *
+ * @see IWorkbenchWindowActionDelegate
+ */
+public class SampleAction implements IWorkbenchWindowActionDelegate {
+
+ private IWorkbenchWindow window;
+
+ private static final String CHILDREN_INSERT_POINT = "CHILDREN INSERTION
POINT";
+ private final String CONTEXT = "config/tagConfig.xml";
+
+ // Tags attributes
+ private final static String TAG = "tag";
+ private final static String NAME = "name";
+ private final static String FILE = "file";
+ private final static String CLASS = "class";
+
+ // Shema attributes
+ private final static String SCHEMA = "schema";
+ private final static String PREFIX = "prefix";
+ private final static String URI = "uri";
+
+ // Maps
+ private Map<String, TagAttribyteStorage> tagAttributeMap = null;
+ private Map<String, TagAttribyteStorage> shemaAttributeMap = null;
+
+ private PageContext context;
+
+ /**
+ * The constructor.
+ */
+ public SampleAction() {
+ }
+
+ /**
+ * The action has been activated. The argument of the method represents the
+ * 'real' action sitting in the workbench UI.
+ *
+ * @see IWorkbenchWindowActionDelegate#run
+ */
+ public void run(IAction action) {
+ ISelection selection = SelectionUtil.getCurrentSelection();
+
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ Object firstElement = ssel.getFirstElement();
+
+ if (firstElement instanceof Element) {
+
+ shemaAttributeMap = getShemaAttributeMap();
+ tagAttributeMap = getTagAttributeMap();
+ context = new MyPageContext(); // page context - one for the whole page
+
+ NodeList childNodes = ((Element) firstElement).getOwnerDocument().getChildNodes();
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ try {
+ processNode(childNodes.item(i), null);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ }
+ }
+ }
+
+ private Map<String, TagAttribyteStorage> getShemaAttributeMap() {
+ if (shemaAttributeMap == null) {
+ shemaAttributeMap = XMLParser.getTagAttributes(
+ SelectionUtil.getResourcePath(CONTEXT), SCHEMA, URI,
+ PREFIX, "");
+ }
+ return shemaAttributeMap;
+ }
+
+ private Map<String, TagAttribyteStorage> getTagAttributeMap() {
+ if (tagAttributeMap == null) {
+ tagAttributeMap = XMLParser.getTagAttributes(
+ SelectionUtil.getResourcePath(CONTEXT), TAG, NAME, FILE,
+ CLASS);
+ }
+ return tagAttributeMap;
+ }
+
+ private String getFileContextDefinedInTagMap(String tagName,
+ Map<String, TagAttribyteStorage> tagAttributeMap) {
+ if (tagAttributeMap.containsKey(tagName)) {
+ TagAttribyteStorage attributeStorrage = tagAttributeMap.get(tagName);
+ if(attributeStorrage.getFilePath() != null &&
attributeStorrage.getFilePath().length() != 0){
+ File file = new File(
+ SelectionUtil.getResourcePath(attributeStorrage.getFilePath()));
+ String fileContext = FileUtil.getFilecontext(file);
+ return fileContext;
+ }
+ }
+ return null;
+ }
+
+ private String getClassNameDefinedInTagMap(String tagName,
+ Map<String, TagAttribyteStorage> tagAttributeMap) {
+ if (tagAttributeMap.containsKey(tagName)) {
+ TagAttribyteStorage attributeStorage = tagAttributeMap.get(tagName);
+ if(attributeStorage.getClassPath() != null &&
attributeStorage.getClassPath().length() != 0){
+ return attributeStorage.getClassPath();
+ }
+
+ }
+ return null;
+ }
+
+ private void processNode(final Node node, JspTag parentTag) throws IOException {
+
+ String tagName;
+
+ if (node.getNamespaceURI() != null &&
shemaAttributeMap.containsKey(node.getNamespaceURI())) {
+ tagName = shemaAttributeMap.get(node.getNamespaceURI()).getFilePath() + ":"
+ node.getLocalName();
+ } else {
+ tagName = node.getNodeName();
+ }
+
+ String fileContext = getFileContextDefinedInTagMap(tagName, tagAttributeMap);
+ String className = getClassNameDefinedInTagMap(tagName, tagAttributeMap);
+
+
+ if (fileContext != null) {
+ context.getOut().println(FileUtil.getContextBeforeKeyString(fileContext,CHILDREN_INSERT_POINT));
+ processChildren(node, parentTag);
+ context.getOut().println(FileUtil.getContextAfterKeyString(fileContext,
CHILDREN_INSERT_POINT));
+ } else if (className != null) {
+
+ try {
+ Class<?> tagHandlerClass = Class.forName(className);
+ Object object = tagHandlerClass.newInstance();
+
+ if (object instanceof SimpleTag) {
+ SimpleTag simpleTag = (SimpleTag) object;
+ processSimpleTag(node, simpleTag, tagHandlerClass, parentTag);
+ } else if (object instanceof Tag){
+ Tag tag = (Tag) object;
+ processClassicTag(node, tag, tagHandlerClass, parentTag);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ } else {
+
+ short nodeType = node.getNodeType();
+
+ switch (nodeType) {
+ case Node.ELEMENT_NODE:
+ context.getOut().println("<" + node.getNodeName() + ">");
+ processChildren(node, null);
+ context.getOut().println("</" + node.getNodeName() + ">");
+ break;
+
+ case Node.TEXT_NODE:
+ context.getOut().println(node.getTextContent().trim());
+ break;
+
+ case Node.DOCUMENT_TYPE_NODE:
+ context.getOut().println("<!DOCTYPE " + node.getNodeName() +
">");
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ private void processChildren(Node node, JspTag parentTag) throws IOException{
+ NodeList childNodes = node.getChildNodes();
+ for(int i = 0; i < childNodes.getLength(); i++){
+ if(childNodes.item(i).getNodeType() == Node.ELEMENT_NODE){
+ processNode(childNodes.item(i), parentTag);
+ }else{
+ context.getOut().println(childNodes.item(i).getTextContent().trim());
+ }
+ }
+ }
+
+ private boolean processClassicTag(Node node, Tag tag,
+ Class<?> tagHandlerClass, JspTag parentTag) {
+
+ try {
+ JspWriter out = context.getOut();
+ tag.setPageContext(context);
+
+ if (parentTag instanceof Tag) {
+ tag.setParent((Tag) parentTag);
+ } else {
+ tag.setParent(null);
+ }
+
+ if (node.hasAttributes()) {
+ setAttributesToTagHandler(node, tagHandlerClass, tag);
+ }
+
+ int evalTag = tag.doStartTag();
+ if (evalTag != Tag.SKIP_BODY) {
+ if (evalTag != Tag.EVAL_BODY_INCLUDE) {
+ out = context.pushBody();
+ if (tag instanceof BodyTag) {
+ BodyTag bodyTag = (BodyTag) tag;
+ bodyTag.setBodyContent((BodyContent) out);
+ bodyTag.doInitBody();
+ }
+ }
+ if (tag instanceof IterationTag) {
+ IterationTag iterationTag = (IterationTag) tag;
+ do {
+ processChildren(node, tag);
+ int evalDoAfterbody = iterationTag.doAfterBody();
+ if (evalDoAfterbody != BodyTag.EVAL_BODY_AGAIN) {
+ break;
+ }
+ } while (true);
+ if (evalTag != Tag.EVAL_BODY_INCLUDE) {
+ out = context.popBody();
+ }
+ }
+ }
+ if (tag.doEndTag() == Tag.SKIP_PAGE){
+// TagHandlerPool.reuse(tag);
+ return true;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+// TagHandlerPool.reuse(tag);
+ return false;
+ }
+
+ private boolean processSimpleTag(final Node node, final SimpleTag simpleTag,
+ Class<?> testClass, JspTag parentTag) {
+
+ try {
+// JspWriter out = context.getOut();
+
+ final MyJspContext context = new MyJspContext();
+ simpleTag.setJspContext(context);
+
+ if (parentTag != null) {
+ simpleTag.setParent(parentTag);
+ }
+
+ if (node.hasAttributes()) {
+ setAttributesToTagHandler(node, testClass, simpleTag);
+ }
+
+ simpleTag.setJspBody(new JspFragment() {
+
+ @Override
+ public void invoke(Writer out) throws JspException, IOException {
+ // TODO: check .tld for skip_body (minor)
+ processChildren(node, simpleTag);
+ }
+
+ @Override
+ public JspContext getJspContext() {
+ return context;
+ }
+ });
+
+ simpleTag.doTag();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+// _jsp_instancemanager.destroyInstance(_jspx_th_myTag_005fRepeatBody_005f0);
+ return false;
+ }
+
+ private void setAttributesToTagHandler(Node node, Class<?> testClass, JspTag tag)
{
+
+ try{
+ NamedNodeMap attributes = node.getAttributes();
+ BeanInfo info = Introspector.getBeanInfo(testClass);
+ PropertyDescriptor[] prop = info.getPropertyDescriptors();
+
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attribute = (Attr) attributes.item(i);
+ String attributeName = attribute.getName();
+
+ for (int j = 0; j < prop.length; j++) {
+ if (attributeName.equals(prop[j].getName())) {
+
+ Method method = prop[j].getWriteMethod();
+ Class<?> parametrType = method.getParameterTypes()[0];
+
+ methodInvocation(method, parametrType, attribute, tag);
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void methodInvocation(Method method, Class<?> parametrType,
+ Attr attribute, JspTag tag) throws IllegalArgumentException,
+ IllegalAccessException, InvocationTargetException {
+
+ if (parametrType == int.class) {
+ int intValue;
+ try {
+ intValue = Integer.parseInt(attribute
+ .getValue());
+ } catch (NumberFormatException e) {
+ intValue = 1;
+ }
+ method.invoke(tag, intValue);
+
+ } else if (parametrType == double.class) {
+ double doubleValue;
+ try {
+ doubleValue = Double.parseDouble(attribute.getValue());
+ }catch (NumberFormatException e){
+ doubleValue = 1;
+ }
+ method.invoke(tag, doubleValue);
+
+ } else if (parametrType == float.class) {
+ float floatValue;
+ try{
+ floatValue = Float.parseFloat(attribute.getValue());
+ }catch(NumberFormatException e){
+ floatValue = 1;
+ }
+ method.invoke(tag, floatValue);
+
+ } else if (parametrType == boolean.class) {
+ boolean booleanValue;
+ try {
+ booleanValue = Boolean.parseBoolean(attribute.getValue());
+ }catch(NumberFormatException e){
+ booleanValue = false;
+ }
+ method.invoke(tag, booleanValue);
+ } else {
+ method.invoke(tag, attribute.getValue());
+ }
+
+ }
+
+ /**
+ * Selection in the workbench has been changed. We can change the state of
+ * the 'real' action here if we want, but this can only happen after the
+ * delegate has been created.
+ *
+ * @see IWorkbenchWindowActionDelegate#selectionChanged
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ /**
+ * We can use this method to dispose of any system resources we previously
+ * allocated.
+ *
+ * @see IWorkbenchWindowActionDelegate#dispose
+ */
+ public void dispose() {
+ }
+
+ /**
+ * We will cache window object in order to be able to provide parent shell
+ * for the message dialog.
+ *
+ * @see IWorkbenchWindowActionDelegate#init
+ */
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+}
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspContext.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspContext.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspContext.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,93 @@
+package by.buziuk.dom.parser.template.util;
+
+import java.util.Enumeration;
+
+import javax.el.ELContext;
+import javax.servlet.jsp.JspContext;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.el.ExpressionEvaluator;
+import javax.servlet.jsp.el.VariableResolver;
+
+
+public class MyJspContext extends JspContext {
+
+ private MyJspWriter out = new MyJspWriter(1000, true);
+
+ @Override
+ public void setAttribute(String name, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setAttribute(String name, Object value, int scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Object getAttribute(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getAttribute(String name, int scope) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object findAttribute(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void removeAttribute(String name) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeAttribute(String name, int scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int getAttributesScope(String name) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Enumeration<String> getAttributeNamesInScope(int scope) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public JspWriter getOut() {
+ return out;
+ }
+
+ @Override
+ public ExpressionEvaluator getExpressionEvaluator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ELContext getELContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public VariableResolver getVariableResolver() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspFragment.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspFragment.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspFragment.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,23 @@
+package by.buziuk.dom.parser.template.util;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.servlet.jsp.JspContext;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.JspFragment;
+
+public class MyJspFragment extends JspFragment {
+ private MyJspContext context = new MyJspContext();
+
+ @Override
+ public void invoke(Writer out) throws JspException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public JspContext getJspContext() {
+ return context;
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspWriter.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspWriter.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyJspWriter.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,182 @@
+package by.buziuk.dom.parser.template.util;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.io.Writer;
+
+import javax.servlet.jsp.JspWriter;
+
+import by.buziuk.dom.parser.util.WriterOutputStream;
+
+public class MyJspWriter extends JspWriter {
+
+ private PrintStream out = System.out;
+
+ public MyJspWriter(int bufferSize, boolean autoFlush) { // was changed from protected to
public
+ super(bufferSize, autoFlush);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void newLine() throws IOException {
+ out.println();
+ }
+
+
+
+ public void print(boolean b) {
+ out.print(b);
+ }
+
+
+
+ public void print(char c) {
+ out.print(c);
+ }
+
+
+
+ public void print(int i) {
+ out.print(i);
+ }
+
+
+
+ public void print(long l) {
+ out.print(l);
+ }
+
+
+
+ public void print(float f) {
+ out.print(f);
+ }
+
+
+
+ public void print(double d) {
+ out.print(d);
+ }
+
+
+
+ public void print(char[] s) {
+ out.print(s);
+ }
+
+
+
+ public void print(String s) {
+ out.print(s);
+ }
+
+
+
+ public void print(Object obj) {
+ out.print(obj);
+ }
+
+
+
+ public void println() {
+ out.println();
+ }
+
+
+
+ public void println(boolean x) {
+ out.println(x);
+ }
+
+
+
+ public void println(char x) {
+ out.println(x);
+ }
+
+
+
+ public void println(int x) {
+ out.println(x);
+ }
+
+
+
+ public void println(long x) {
+ out.println(x);
+ }
+
+
+
+ public void println(float x) {
+ out.println(x);
+ }
+
+
+
+ public void println(double x) {
+ out.println(x);
+ }
+
+
+
+ public void println(char[] x) {
+ out.println(x);
+ }
+
+
+
+ public void println(String x) {
+ out.println(x);
+ }
+
+
+
+ public void println(Object x) {
+ out.println(x);
+ }
+
+
+
+ @Override
+ public void clear() throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void clearBuffer() throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void flush() throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void close() throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int getRemaining() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ out.write(new String(cbuf).getBytes(), off, len);
+ }
+
+
+ public void setWriter(Writer writer) {
+// out = (PrintStream) new WriterOutputStream(writer, "UTF-8"); // out
+
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyPageContext.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyPageContext.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/MyPageContext.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,249 @@
+package by.buziuk.dom.parser.template.util;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Enumeration;
+
+import javax.el.ELContext;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.el.ExpressionEvaluator;
+import javax.servlet.jsp.el.VariableResolver;
+import javax.servlet.jsp.tagext.BodyContent;
+
+import org.apache.jasper.el.ELContextImpl;
+import org.apache.jasper.runtime.BodyContentImpl;
+
+public class MyPageContext extends PageContext {
+
+ private MyJspWriter baseOut;
+ private JspWriter out;
+ private BodyContentImpl[] outs;
+ private int depth;
+
+ public MyPageContext() {
+ baseOut = new MyJspWriter(1000, true);
+ out = baseOut;
+ this.outs = new BodyContentImpl[0];
+ this.depth = -1;
+ }
+
+ @Override
+ public void initialize(Servlet servlet, ServletRequest request,
+ ServletResponse response, String errorPageURL,
+ boolean needsSession, int bufferSize, boolean autoFlush)
+ throws IOException, IllegalStateException, IllegalArgumentException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void release() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public HttpSession getSession() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getPage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ServletRequest getRequest() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ServletResponse getResponse() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Exception getException() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ServletConfig getServletConfig() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ServletContext getServletContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void forward(String relativeUrlPath) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void include(String relativeUrlPath) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void include(String relativeUrlPath, boolean flush)
+ throws ServletException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handlePageException(Exception e) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handlePageException(Throwable t) throws ServletException,
+ IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setAttribute(String name, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setAttribute(String name, Object value, int scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Object getAttribute(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getAttribute(String name, int scope) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object findAttribute(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void removeAttribute(String name) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeAttribute(String name, int scope) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int getAttributesScope(String name) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Enumeration<String> getAttributeNamesInScope(int scope) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public JspWriter getOut() {
+ // TODO Auto-generated method stub
+ return out;
+ }
+
+ @Override
+ public ExpressionEvaluator getExpressionEvaluator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ELContext getELContext() {
+ return new ELContextImpl();
+ }
+
+ @Override
+ public VariableResolver getVariableResolver() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public BodyContent pushBody() {
+ depth++;
+ if (depth >= outs.length) {
+ BodyContentImpl[] newOuts = new BodyContentImpl[depth + 1];
+ for (int i = 0; i < outs.length; i++) {
+ newOuts[i] = outs[i];
+ }
+ newOuts[depth] = new BodyContentImpl(out);
+ outs = newOuts;
+ }
+
+ // outs[depth].setWriter(writer);
+ out = outs[depth];
+
+ // Update the value of the "out" attribute in the page scope
+ // attribute namespace of this PageContext
+ setAttribute(OUT, out);
+
+ return outs[depth];
+ }
+
+ @Override
+ public JspWriter pushBody(Writer writer) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public JspWriter popBody() {
+ depth--;
+ if (depth >= 0) {
+ out = outs[depth];
+ } else {
+ out = baseOut;
+ }
+
+ // Update the value of the "out" attribute in the page scope
+ // attribute namespace of this PageContext
+ setAttribute(OUT, out);
+
+ return out;
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/BodyContentTag.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/BodyContentTag.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/BodyContentTag.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,52 @@
+package by.buziuk.dom.parser.template.util.body.tag;
+
+import java.io.IOException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.tagext.BodyContent;
+import javax.servlet.jsp.tagext.BodyTagSupport;
+
+public class BodyContentTag extends BodyTagSupport
+{
+ private int iterations, howMany;
+
+ public void setHowMany(int i)
+ {
+ this.howMany = i;
+ }
+
+ public void setBodyContent(BodyContent bc)
+ {
+ super.setBodyContent(bc);
+ System.out.println("BodyContent = '" + bc.getString() +
"'");
+ }
+
+ public int doAfterBody()
+ {
+ try
+ {
+ BodyContent bodyContent = super.getBodyContent();
+ String bodyString = bodyContent.getString();
+ JspWriter out = bodyContent.getEnclosingWriter();
+
+ if ( iterations % 2 == 0 )
+ out.print(bodyString.toLowerCase());
+ else
+ out.print(bodyString.toUpperCase());
+
+ iterations++;
+ bodyContent.clear(); // empty buffer for next evaluation
+ }
+ catch (IOException e)
+ {
+ System.out.println("Error in BodyContentTag.doAfterBody()" +
e.getMessage());
+ e.printStackTrace();
+ } // end of catch
+
+ int retValue = SKIP_BODY;
+
+ if ( iterations < howMany )
+ retValue = EVAL_BODY_AGAIN;
+
+ return retValue;
+ }
+}
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/HelloTag.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/HelloTag.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/HelloTag.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,13 @@
+package by.buziuk.dom.parser.template.util.body.tag;
+import java.io.*;
+import javax.servlet.jsp.tagext.*;
+public class HelloTag extends TagSupport {
+ public int doStartTag() {
+ try {
+ pageContext.getOut().write("Hello world!");
+ } catch (IOException e) {
+ System.err.println(e.toString());
+ }
+ return SKIP_BODY;
+ }
+}
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/MyTag.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/MyTag.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/MyTag.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,24 @@
+package by.buziuk.dom.parser.template.util.body.tag;
+
+import javax.servlet.*;
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+import java.util.*;
+import java.io.*;
+
+public class MyTag extends BodyTagSupport {
+ public int doAfterBody() throws JspException {
+ try {
+ BodyContent bodycontent = getBodyContent();
+ String body = bodycontent.getString();
+
+ if (body != null) {
+ System.out.println("This is body context!!!");
+ pageContext.getOut().write(body.toUpperCase());
+ }
+ } catch (IOException ioe) {
+ throw new JspException("Error:" + ioe.getMessage());
+ }
+ return SKIP_BODY;
+ }
+}
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/ShowDateTag.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/ShowDateTag.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/ShowDateTag.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,50 @@
+package by.buziuk.dom.parser.template.util.body.tag;
+
+import java.io.IOException;
+import java.util.Date;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.Tag;
+
+
+public class ShowDateTag implements Tag {
+
+ private PageContext pageContext;
+ private Tag parent;
+
+ @Override
+ public void setPageContext(PageContext pc) {
+ this.pageContext = (PageContext) pc;
+
+ }
+
+ @Override
+ public int doStartTag() throws JspException {
+ return SKIP_BODY;
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ try {
+ pageContext.getOut().print("" + new Date());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return EVAL_PAGE;
+ }
+
+ @Override
+ public void setParent(Tag tag) {
+ this.parent = tag;
+ }
+
+ @Override
+ public void release() {
+ }
+
+ @Override
+ public Tag getParent() {
+ return this.parent;
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/TagLifecycle.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/TagLifecycle.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/body/tag/TagLifecycle.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,82 @@
+package by.buziuk.dom.parser.template.util.body.tag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.Tag;
+import javax.servlet.jsp.tagext.TagSupport;
+
+public class TagLifecycle extends TagSupport
+{
+ // Code to implement the "attr2" attribute
+
+ private String attr2;
+
+
+ // Constructor
+
+ public TagLifecycle()
+ {
+ System.out.println("TagLifecycle constructor called");
+ }
+
+ // Methods inherited from TagSupport
+
+ public void setPageContext(PageContext p)
+ {
+ super.setPageContext(p);
+ System.out.println("setPageContext() called (" + p + ")");
+ }
+
+ public void setParent(Tag t)
+ {
+ super.setParent(t);
+ System.out.println("setParent() called (" + t + ")");
+ }
+
+ public Tag getParent()
+ {
+ System.out.println("getParent() called");
+ return super.getParent();
+ }
+
+ public void release()
+ {
+ System.out.println("release() called");
+ }
+
+ // Code to implement the "attr1" attribute
+
+ private String attr1;
+ public String getAttr1()
+ {
+ return attr1;
+ }
+ public void setAttr1(String s)
+ {
+ System.out.println("setAttr1() called with value " + s);
+ attr1 = s;
+ }
+
+ public String getAttr2()
+ {
+ return attr2;
+ }
+ public void setAttr2(String s)
+ {
+ System.out.println("setAttr2() called with value " + s);
+ attr2 = s;
+ }
+
+ public int doStartTag() throws JspException
+ {
+ System.out.println("doStartTag() called");
+
+ return SKIP_BODY;
+ }
+
+ public int doEndTag() throws JspException
+ {
+ System.out.println("doEndTag() called");
+ return super.doEndTag();
+ }
+}
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/simple/tag/SimpleTagImpl.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/simple/tag/SimpleTagImpl.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/template/util/simple/tag/SimpleTagImpl.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,57 @@
+package by.buziuk.dom.parser.template.util.simple.tag;
+
+import java.io.IOException;
+
+import javax.servlet.jsp.JspContext;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.SimpleTag;
+
+import by.buziuk.dom.parser.template.util.MyPageContext;
+
+public class SimpleTagImpl implements SimpleTag {
+
+ private JspTag parentTag;
+ private JspContext jspContext;
+ private JspFragment jspBody;
+
+ private int howMany;
+
+ @Override
+ public void doTag() throws JspException, IOException {
+
+ for(int i =0; i < howMany; i++){
+ jspBody.invoke(jspContext.getOut());
+ }
+ }
+
+ @Override
+ public void setParent(JspTag parent) {
+ this.parentTag = parent;
+
+ }
+
+ @Override
+ public JspTag getParent() {
+ return this.parentTag;
+ }
+
+ @Override
+ public void setJspContext(JspContext context) {
+ this.jspContext = context;
+ }
+
+ @Override
+ public void setJspBody(JspFragment jspBody) {
+ this.jspBody = jspBody;
+ }
+
+ public int getHowMany() {
+ return howMany;
+ }
+
+ public void setHowMany(int howMany) {
+ this.howMany = howMany;
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/EditorUtil.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/EditorUtil.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/EditorUtil.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,12 @@
+package by.buziuk.dom.parser.util;
+
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+public class EditorUtil {
+ public static IWorkbenchPart getActivePart() {
+ IWorkbenchPart part = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().getActivePart();
+ return part;
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/FileUtil.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/FileUtil.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/FileUtil.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,45 @@
+package by.buziuk.dom.parser.util;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class FileUtil {
+
+ public static String getFilecontext(File file) {
+
+ String line = null;
+ StringBuffer lines = new StringBuffer();
+
+ try{
+ FileReader reader = new FileReader(file);
+ BufferedReader bufferedReader = new BufferedReader(reader);
+ while ( (line = bufferedReader.readLine()) != null) {
+ lines.append(line);
+ lines.append("\n");
+ }
+ bufferedReader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return lines.toString();
+
+ }
+
+ public static String getContextBeforeKeyString(String primaryString, String keyString){
+ StringBuilder stringBuilder = new StringBuilder(primaryString);
+ int index = stringBuilder.indexOf(keyString);
+ return stringBuilder.substring(0, index);
+ }
+
+ public static String getContextAfterKeyString(String primaryString, String keyString){
+ int primaryStringLength = primaryString.length();
+
+ StringBuilder stringBuilder = new StringBuilder(primaryString);
+ int index = stringBuilder.indexOf(keyString) + keyString.length();
+ return stringBuilder.substring(index, primaryStringLength);
+ }
+
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/SelectionUtil.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/SelectionUtil.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/SelectionUtil.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,47 @@
+package by.buziuk.dom.parser.util;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.osgi.framework.Bundle;
+
+import by.buziuk.dom.parser.Activator;
+
+
+public class SelectionUtil {
+
+
+ public static ISelection getCurrentSelection() {
+ Activator activator = Activator.getDefault();
+ IWorkbench workbench = activator.getWorkbench();
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ ISelectionService selectionService = workbenchWindow.getSelectionService();
+ ISelection selection = selectionService.getSelection();
+ return selection;
+ }
+
+
+ public static String getResourcePath(String resourceName) {
+ Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
+
+ if (bundle != null) {
+ URL url = bundle.getEntry(resourceName);
+
+ if (url != null) {
+ try {
+ return FileLocator.resolve(url).getPath();
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+ }
+
+ return null;
+ }
+}
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/WriterOutputStream.java
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/WriterOutputStream.java
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/src/by/buziuk/dom/parser/util/WriterOutputStream.java 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,62 @@
+package by.buziuk.dom.parser.util;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+
+
+public class WriterOutputStream extends OutputStream
+{
+ protected Writer _writer;
+ protected String _encoding;
+ private byte[] _buf=new byte[1];
+
+ public WriterOutputStream(Writer writer, String encoding)
+ {
+ _writer=writer;
+ _encoding=encoding;
+ }
+
+ public WriterOutputStream(Writer writer)
+ {
+ _writer=writer;
+ }
+
+ public void close()
+ throws IOException
+ {
+ _writer.close();
+ _writer=null;
+ _encoding=null;
+ }
+
+ public void flush()
+ throws IOException
+ {
+ _writer.flush();
+ }
+
+ public void write(byte[] b)
+ throws IOException
+ {
+ if (_encoding==null)
+ _writer.write(new String(b));
+ else
+ _writer.write(new String(b,_encoding));
+ }
+
+ public void write(byte[] b, int off, int len)
+ throws IOException
+ {
+ if (_encoding==null)
+ _writer.write(new String(b,off,len));
+ else
+ _writer.write(new String(b,off,len,_encoding));
+ }
+
+ public synchronized void write(int b)
+ throws IOException
+ {
+ _buf[0]=(byte)b;
+ write(_buf);
+ }
+}
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/calendar_template.html
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/calendar_template.html
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/calendar_template.html 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,3 @@
+<new Calendar>
+ <span>CHILDREN INSERTION POINT</span>
+</new Calendar>
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/ccFoo_template.html
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/ccFoo_template.html
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/ccFoo_template.html 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,3 @@
+<newFoo>
+ <spanFoo>CHILDREN INSERTION POINT</spanFoo>
+</newFoo>
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/from_template.html
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/from_template.html
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/from_template.html 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,3 @@
+<div>
+ <span>CHILDREN INSERTION POINT</span>
+</div>
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/jspBody_template.html
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/jspBody_template.html
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/jspBody_template.html 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,3 @@
+<newbody>
+ <spanBody>CHILDREN INSERTION POINT</spanBody>
+</newbody>
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/test_template.html
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/test_template.html
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/test_template.html 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,3 @@
+<div>
+ <span>CHILDREN INSERTION POINT</span>
+</div>
\ No newline at end of file
Added:
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/view_template.html
===================================================================
---
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/view_template.html
(rev 0)
+++
workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/by.buziuk.dom.parser/template/view_template.html 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,3 @@
+<div>
+ <span>CHILDREN INSERTION POINT</span>
+</div>
\ No newline at end of file
Added: workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/info.txt
===================================================================
--- workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/info.txt
(rev 0)
+++ workspace/yradtsevich/ibuziuk/JSP-to-HTML-converter-plugin/info.txt 2012-08-28
15:23:31 UTC (rev 43265)
@@ -0,0 +1,36 @@
+about
+______________________________
+DOM parser for tags resolving
+jsp tags support
+shema support
+
+
+How it works
+______________________________
+Simply select in the text editor some tag (must be instanceof Element(org.w3c.dom))
-->
+press plug-in button -> DOM parser will parse the document and output the result to
the console
+all resolving config is in "/config/tagConfig.xml" file
+(some tags will be replaced --> see folder "template")
+
+
+Environment
+_____________________________
+eclipse 4 juno (32-bit)
+jdk 6
+
+
+
+
+Programming languages
+_______________________________
+java
+
+
+
+how to install
+______________________________
+simply add project to workspace
+set Run Configuration:
+ - Runtime jre: jdk 32-bit
+ - Plugins: all workspace and enabled target plug-ins
+Run project as eclipse application