You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/03/04 23:04:13 UTC
svn commit: r919197 - in
/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp:
./ WEB-INF/ WEB-INF/java/org/apache/myfaces/javaloader/componentTest/
resources/styles/
Author: werpu
Date: Thu Mar 4 22:04:13 2010
New Revision: 919197
URL: http://svn.apache.org/viewvc?rev=919197&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-86
added first version of the history component, works now as it should
Modified:
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/TaintHistoryRenderer.java
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/resources/styles/main.css
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/template.xhtml
Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/TaintHistoryRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/TaintHistoryRenderer.java?rev=919197&r1=919196&r2=919197&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/TaintHistoryRenderer.java (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/TaintHistoryRenderer.java Thu Mar 4 22:04:13 2010
@@ -20,7 +20,6 @@
package org.apache.myfaces.javaloader.componentTest;
import org.apache.commons.lang.StringUtils;
-import org.apache.myfaces.scripting.api.ScriptingConst;
import org.apache.myfaces.scripting.components.CompilerComponent;
import org.apache.myfaces.scripting.core.util.WeavingContext;
import org.apache.myfaces.scripting.refresh.ReloadingMetadata;
@@ -32,7 +31,9 @@
import javax.faces.context.ResponseWriter;
import javax.faces.render.FacesRenderer;
import java.io.IOException;
+import java.text.DateFormat;
import java.util.Collection;
+import java.util.Date;
import java.util.logging.Logger;
/**
@@ -54,9 +55,12 @@
startDiv(component, wrtr, "historyBox");
int lastTainted = ((TaintHistory)component).getNoEntries();
+
Collection<ReloadingMetadata> result = WeavingContext.getRefreshContext().getLastTainted(lastTainted);
if (result == null || result.isEmpty()) {
wrtr.write("No taint history found");
+ } else {
+ writeHistory(component, wrtr, result);
}
endDiv(wrtr);
@@ -64,33 +68,15 @@
}
- private void writeWarnings(UIComponent component, ResponseWriter wrtr, CompilationResult result) throws IOException {
- startDiv(component, wrtr, "warnings");
- for (CompilationResult.CompilationMessage msg : result.getWarnings()) {
+ private void writeHistory(UIComponent component, ResponseWriter wrtr, Collection<ReloadingMetadata> result) throws IOException {
+ startDiv(component, wrtr, "history");
+ for(ReloadingMetadata entry: result) {
startDiv(component, wrtr, "line");
- writeDiv(component, wrtr, "lineNo", String.valueOf(msg.getLineNumber()));
- writeDiv(component, wrtr, "message", msg.getMessage());
- endDiv(wrtr);
- }
- endDiv(wrtr);
- }
-
- private void writeWarningsLabel(UIComponent component, ResponseWriter wrtr, CompilerComponent compilerComp) throws IOException {
- if (!StringUtils.isBlank(compilerComp.getWarningsLabel())) {
- startDiv(component, wrtr, "warningsLabel");
- wrtr.write(compilerComp.getWarningsLabel());
+ writeDiv(component, wrtr, "timestamp", DateFormat.getInstance().format(new Date(entry.getTimestamp())));
+ writeDiv(component, wrtr, "changedFile", entry.getFileName());
endDiv(wrtr);
}
- }
- private void writeErrors(UIComponent component, ResponseWriter wrtr, CompilationResult result) throws IOException {
- startDiv(component, wrtr, "errors");
- for (CompilationResult.CompilationMessage msg : result.getErrors()) {
- startDiv(component, wrtr, "line");
- writeDiv(component, wrtr, "lineNo", String.valueOf(msg.getLineNumber()));
- writeDiv(component, wrtr, "message", msg.getMessage());
- endDiv(wrtr);
- }
endDiv(wrtr);
}
Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml?rev=919197&r1=919196&r2=919197&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml Thu Mar 4 22:04:13 2010
@@ -30,7 +30,7 @@
<param-name>org.apache.myfaces.FACES_INIT_PLUGINS</param-name>
<param-value>org.apache.myfaces.scripting.servlet.StartupServletContextPluginChainLoader</param-value>
</context-param>
- <!--
+
<context-param>
<description>Additional comma separated loader paths to allow direct editing on the sources directory instead
of the deployment dir
@@ -67,7 +67,7 @@
<param-name>facelets.RESOURCE_RESOLVER</param-name>
<param-value>org.apache.myfaces.scripting.facelet.ReroutingResourceResolver</param-value>
</context-param>
- -->
+
<!--
<context-param>
<description>a comma separated whitelist of root packages which are compiled those and nothing else
Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml?rev=919197&r1=919196&r2=919197&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml Thu Mar 4 22:04:13 2010
@@ -22,6 +22,7 @@
<h:commandLink style="color: white;" value="press me" action="#{javatestbean.doAction}"/>
<grv:testcomponent2 testAttr="vvv" testAttr3="Attribute 3 set"
testAttr4="Attribute 4 set and showing"/>
+
</h:panelGroup>
</h:form>
</div>
Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/resources/styles/main.css
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/resources/styles/main.css?rev=919197&r1=919196&r2=919197&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/resources/styles/main.css (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/resources/styles/main.css Thu Mar 4 22:04:13 2010
@@ -17,7 +17,6 @@
text-align: center;
}
-
div#backGroundFloat {
position: fixed;
z-index: -1;
@@ -87,6 +86,63 @@
}
/*==================================================
+ Basic CSS information for our
+ taint history component
+====================================================*/
+
+div.historyBox {
+ width: 820px;
+ heigh: 200px;
+
+ display: block;
+ overflow: auto;
+ border: 1px solid white;
+ color: #dedddd;
+ opacity: 0.92;
+
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 5px;
+
+ padding: 5px;
+ margin-left: 10px;
+
+ background-image: url("../resources/img/gradient2.png");
+ background-repeat: repeat-x;
+}
+
+div.historyBox .line {
+ display: table;
+ width: 780px;
+
+ border: 1px dashed black;
+ background-color: #ccccff;
+ color: black;
+ padding: 5px;
+ margin-top: 10px;
+ margin-left: auto;
+ margin-right: auto;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+
+ border-radius: 5px;
+}
+
+div.historyBox .line .timestamp {
+ width: 120px;
+ float: left;
+ color: red;
+}
+
+div.historyBox .line .changedFile {
+ width: 650px;
+ overflow: hidden;
+ display: block;
+ float: left;
+}
+
+
+/*==================================================
Basic CSS information for our compiler
output component
====================================================*/
Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/template.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/template.xhtml?rev=919197&r1=919196&r2=919197&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/template.xhtml (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/template.xhtml Thu Mar 4 22:04:13 2010
@@ -40,6 +40,14 @@
<exs:compilerOutput errorsLabel="Errors:" warningsLabel="Warnings:" scriptingLanguage=""/>
</h:panelGroup>
+ <h:panelGroup>
+ <h3>
+ <h:outputFormat value="Change History" escape="false"/>
+ </h3>
+ <exs:taintHistory noEntries="5" />
+ </h:panelGroup>
+
+
<p>
<ui:insert name="body">Hello World Example!</ui:insert>
</p>