You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2007/07/26 11:05:18 UTC

svn commit: r559760 - in /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit: freemarker/DefaultTemplateEncoder.java freemarker/TemplateEncoder.java freemarker/TemplateRenderer.java html/ext/HtmlOutputTextRenderer.java

Author: mmarinschek
Date: Thu Jul 26 02:05:17 2007
New Revision: 559760

URL: http://svn.apache.org/viewvc?view=rev&rev=559760
Log:
https://issues.apache.org/jira/browse/TOMAHAWK-1065: fixed missing method

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/DefaultTemplateEncoder.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateEncoder.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateRenderer.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlOutputTextRenderer.java

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/DefaultTemplateEncoder.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/DefaultTemplateEncoder.java?view=diff&rev=559760&r1=559759&r2=559760
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/DefaultTemplateEncoder.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/DefaultTemplateEncoder.java Thu Jul 26 02:05:17 2007
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.myfaces.renderkit.freemarker;
 
 import java.io.IOException;
@@ -22,7 +40,7 @@
 
     private static final Log log = LogFactory.getLog(DefaultTemplateEncoder.class);
 
-    public void encodeTemplate(FacesContext context, UIComponent component, String template) throws IOException {    
+    public void encodeTemplate(FacesContext context, UIComponent component, String template, Object dataModel) throws IOException {
             Configuration cfg = new Configuration();
         log.info("Encoding template : " + getClass().getResource(template));
         TemplateLoader templateLoader = new ClassTemplateLoader(getClass(), template);
@@ -31,7 +49,7 @@
         Template temp = cfg.getTemplate(template);
         try
         {
-            temp.process(getDatamodel(context, component), context.getResponseWriter());
+            temp.process(dataModel, context.getResponseWriter());
         }
         catch (TemplateException e)
         {

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateEncoder.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateEncoder.java?view=diff&rev=559760&r1=559759&r2=559760
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateEncoder.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateEncoder.java Thu Jul 26 02:05:17 2007
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.myfaces.renderkit.freemarker;
 
 import javax.faces.context.FacesContext;
@@ -8,5 +26,5 @@
  * @author Martin Marinschek
  */
 public interface TemplateEncoder {
-    public void encodeTemplate(FacesContext context, UIComponent component, String template) throws IOException;
+    public void encodeTemplate(FacesContext context, UIComponent component, String template, Object dataModel) throws IOException;
 }

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateRenderer.java?view=diff&rev=559760&r1=559759&r2=559760
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/freemarker/TemplateRenderer.java Thu Jul 26 02:05:17 2007
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.myfaces.renderkit.freemarker;
 
 import java.io.IOException;
@@ -70,7 +88,7 @@
             }
         }
 
-        templateEncoder.encodeTemplate(context, component, template);
+        templateEncoder.encodeTemplate(context, component, template, getDatamodel(context, component));
     }
     
     protected abstract Object getDatamodel(FacesContext context, UIComponent component);

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlOutputTextRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlOutputTextRenderer.java?view=diff&rev=559760&r1=559759&r2=559760
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlOutputTextRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/renderkit/html/ext/HtmlOutputTextRenderer.java Thu Jul 26 02:05:17 2007
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.myfaces.renderkit.html.ext;
 
 import java.util.HashMap;