You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/03/04 17:35:01 UTC
svn commit: r383154 [1/2] - in /incubator/tobago/trunk: ./ tobago-core/
tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/
tobago-core/src/main/java/org/apache/myfaces/tobago/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/con...
Author: bommel
Date: Sat Mar 4 08:34:56 2006
New Revision: 383154
URL: http://svn.apache.org/viewcvs?rev=383154&view=rev
Log:
last step for simplify theme handling
apply checkstyle rules
cleanup code
added paging for sheet if dataModel don't know the row count
added license to artifacts
added scrollable resultSet example in tobago-example-test
Added:
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/UserVariableResolverImpl.java (contents, props changed)
- copied, changed from r382912, incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/VariableResolverImpl.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java
incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/LICENSE.txt
incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/NOTICE.txt
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Test.java
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resultSetSheet.jsp
Removed:
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/VariableResolverImpl.java
Modified:
incubator/tobago/trunk/pom.xml
incubator/tobago/trunk/tobago-core/pom.xml
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeNode.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeParser.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageAction.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/ResourceServlet.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTag.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/HtmlWriterUtil.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java
incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/faces-config.xml
incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
incubator/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml
incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml
incubator/tobago/trunk/tobago-example/tobago-example-blank/pom.xml
incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml
incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/classes/log4j.xml
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
incubator/tobago/trunk/tobago-example/tobago-example-foreach/pom.xml
incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/faces-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/web.xml
incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/pom.xml
incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/webapp/WEB-INF/web.xml
incubator/tobago/trunk/tobago-example/tobago-example-test/pom.xml
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/META-INF/context.xml
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/classes/log4j.xml
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml
incubator/tobago/trunk/tobago-theme/tobago-theme-richmond/pom.xml
incubator/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/META-INF/tobago-theme.xml
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/pom.xml
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetPageCommandRenderer.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/META-INF/tobago-theme.xml
incubator/tobago/trunk/tobago-theme/tobago-theme-speyside/pom.xml
incubator/tobago/trunk/tobago-theme/tobago-theme-standard/pom.xml
incubator/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java
incubator/tobago/trunk/tobago-tool/maven-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/UnPackThemeMojo.java
incubator/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/DynamicExpression.java
Modified: incubator/tobago/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/pom.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/pom.xml (original)
+++ incubator/tobago/trunk/pom.xml Sat Mar 4 08:34:56 2006
@@ -30,7 +30,7 @@
<inceptionYear>2002</inceptionYear>
<issueManagement>
<system>jira</system>
- <url>http://issues.apache.org/jira/browse/TOBAGO</url>
+ <url>http://issues.apache.org/jira/secure/BrowseProject.jspa?id=12310273</url>
</issueManagement>
<ciManagement>
<system>continuum</system>
@@ -187,9 +187,6 @@
<inherited>false</inherited>
<groupId>org.codehaus.mojo</groupId>
<artifactId>changes-maven-plugin</artifactId>
- <configuration>
- <component>12310553</component>
- </configuration>
</plugin>
<plugin>
@@ -198,8 +195,17 @@
<artifactId>changelog-maven-plugin</artifactId>
<configuration><basedir>${basedir}</basedir></configuration>
</plugin>
-
- </plugins>
+
+ <!--plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <configuration>
+ <threshold>Low</threshold>
+ </configuration>
+ </plugin-->
+
+ </plugins>
</reporting>
Modified: incubator/tobago/trunk/tobago-core/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/pom.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/pom.xml (original)
+++ incubator/tobago/trunk/tobago-core/pom.xml Sat Mar 4 08:34:56 2006
@@ -87,7 +87,7 @@
</configuration>
</plugin>
- <!-- pmd has problems with annotations
+ <!-- pmd has problems with annotations -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
@@ -96,7 +96,7 @@
<targetJdk>1.5</targetJdk>
</configuration>
</plugin>
- -->
+
</plugins>
</reporting>
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java Sat Mar 4 08:34:56 2006
@@ -125,7 +125,7 @@
throws IOException {
ExternalContext externalContext = facesContext.getExternalContext();
- StringBuffer buf = new StringBuffer(content.toString());
+ StringBuffer buf = new StringBuffer(content);
if (LOG.isDebugEnabled()) {
LOG.debug("Size of AjaxResponse:\n" + buf.length());
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java Sat Mar 4 08:34:56 2006
@@ -23,7 +23,30 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.*;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACCESS_KEY;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CREATE_SPAN;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ESCAPE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_FOR;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_HOVER;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL_WITH_ACCESS_KEY;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_RENDER_RANGE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_RENDER_RANGE_EXTERN;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SORTABLE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_VALUE;
+import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_NAVIGATE;
+import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_RESET;
+import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_SCRIPT;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_CHECKBOX;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_LABEL;
+import static org.apache.myfaces.tobago.TobagoConstants.FACET_RADIO;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_OUT;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_SELECT_BOOLEAN_CHECKBOX;
+import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_SELECT_ONE_RADIO;
import org.apache.myfaces.tobago.el.ConstantMethodBinding;
import org.apache.myfaces.tobago.event.SheetStateChangeEvent;
import org.apache.myfaces.tobago.renderkit.RendererBase;
@@ -32,10 +55,18 @@
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
-import javax.faces.component.*;
+import javax.faces.component.ActionSource;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIColumn;
import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIGraphic;
import javax.faces.component.UIOutput;
+import javax.faces.component.UIParameter;
+import javax.faces.component.UISelectBoolean;
import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectItems;
+import javax.faces.component.ValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.el.MethodBinding;
@@ -47,7 +78,11 @@
import javax.faces.render.RenderKitFactory;
import javax.faces.webapp.UIComponentTag;
import javax.servlet.jsp.JspException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
public class ComponentUtil {
@@ -231,7 +266,7 @@
bool = ((ValueBinding) bool).getValue(FacesContext.getCurrentInstance());
}
if (bool instanceof Boolean) {
- return ((Boolean) bool).booleanValue();
+ return (Boolean) bool;
} else if (bool instanceof String) {
LOG.warn("Searching for a boolean, but find a String. Should not happen. "
+ "attribute: '" + name + "' comp: '" + component + "'");
@@ -297,8 +332,8 @@
}
public static boolean isFacetOf(UIComponent component, UIComponent parent) {
- for (Iterator i = parent.getFacets().keySet().iterator(); i.hasNext();) {
- UIComponent facet = parent.getFacet((String) i.next());
+ for (Object o : parent.getFacets().keySet()) {
+ UIComponent facet = parent.getFacet((String) o);
if (component.equals(facet)) {
return true;
}
@@ -354,8 +389,8 @@
ArrayList<SelectItem> list = new ArrayList<SelectItem>();
- for (Iterator kids = component.getChildren().iterator(); kids.hasNext();) {
- UIComponent kid = (UIComponent) kids.next();
+ for (Object o1 : component.getChildren()) {
+ UIComponent kid = (UIComponent) o1;
if (LOG.isDebugEnabled()) {
LOG.debug("kid " + kid);
LOG.debug("kid " + kid.getClass().getName());
@@ -449,7 +484,8 @@
} else {
result.append('\n');
if (!asFacet) {
- result.append(spaces(offset) + toString(component));
+ result.append(spaces(offset));
+ result.append(toString(component));
}
Map facets = component.getFacets();
if (facets.size() > 0) {
@@ -472,17 +508,20 @@
}
private static String toString(UIComponent component) {
+ StringBuffer buf = new StringBuffer(component.getClass().getName());
+ buf.append('@');
+ buf.append(Integer.toHexString(component.hashCode()));
+ buf.append(" ");
+ buf.append(component.getRendererType());
+ buf.append(" ");
if (component instanceof javax.faces.component.UIViewRoot) {
- return component.getClass().getName()
- + '@' + Integer.toHexString(component.hashCode())
- + " " + component.getRendererType()
- + " " + ((javax.faces.component.UIViewRoot) component).getViewId();
- }
- return component.getClass().getName()
- + '@' + Integer.toHexString(component.hashCode())
- + " " + component.getRendererType()
- + " " + component.getId()
- + " " + component.getClientId(FacesContext.getCurrentInstance());
+ buf.append(((javax.faces.component.UIViewRoot) component).getViewId());
+ } else {
+ buf.append(component.getId());
+ buf.append(" ");
+ buf.append(component.getClientId(FacesContext.getCurrentInstance()));
+ }
+ return buf.toString();
}
private static String spaces(int n) {
@@ -715,16 +754,17 @@
public static String createPickerId(FacesContext facesContext, UIComponent component, String postfix) {
- String id = component.getId();
- id = getComponentId(facesContext, component);
+ //String id = component.getId();
+ String id = getComponentId(facesContext, component);
return id + "_picker" + postfix;
}
public static String getComponentId(FacesContext facesContext, UIComponent component) {
String id = component.getId();
- if (id == null) {
- id = component.getClientId(facesContext).substring(id.lastIndexOf('_'));
- }
+ //if (id == null) {
+ // XXX What is this?
+ // id = component.getClientId(facesContext).substring(id.lastIndexOf('_'));
+ //}
return id;
}
@@ -751,7 +791,7 @@
if (labelText != null || labelWithAccessKey != null || accessKey != null) {
Application application = FacesContext.getCurrentInstance().getApplication();
- label = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ label = application.createComponent(UIOutput.COMPONENT_TYPE);
label.setRendererType("Label");
String idprefix = ComponentUtil.getComponentId(facesContext, component);
label.setId(idprefix + "_" + FACET_LABEL);
@@ -806,8 +846,8 @@
List<SelectItem> items = new ArrayList<SelectItem>(indices.length);
if (selectItems.size() != 0) {
- for (int i = 0; i < indices.length; i++) {
- items.add(selectItems.get(indices[i]));
+ for (int indice : indices) {
+ items.add(selectItems.get(indice));
}
} else {
LOG.warn("No items found! rendering dummys instead!");
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java Sat Mar 4 08:34:56 2006
@@ -47,24 +47,31 @@
LOG.debug("action = '" + pageEvent.getAction().name() + "'");
}
- int start, last;
+ int start;
switch(pageEvent.getAction()) {
- case First:
+ case FIRST:
first = 0;
break;
- case Prev:
+ case PREV:
start = sheet.getFirst() - sheet.getRows();
first = start < 0 ? 0 : start;
break;
- case Next:
- start = sheet.getFirst() + sheet.getRows();
- last = sheet.getLastPageIndex();
- first = start > sheet.getRowCount() ? last : start;
+ case NEXT:
+ if (sheet.hasRowCount()) {
+ start = sheet.getFirst() + sheet.getRows();
+ first = start > sheet.getRowCount() ? sheet.getLastPageIndex() : start;
+ } else {
+ if (sheet.isAtEnd()) {
+ first = sheet.getFirst();
+ } else {
+ first = sheet.getFirst() + sheet.getRows();
+ }
+ }
break;
- case Last:
+ case LAST:
first = sheet.getLastPageIndex();
break;
- case ToRow:
+ case TO_ROW:
start = pageEvent.getValue() -1;
if (start > sheet.getLastPageIndex()) {
start = sheet.getLastPageIndex();
@@ -73,7 +80,7 @@
}
first = start;
break;
- case ToPage:
+ case TO_PAGE:
start = pageEvent.getValue() -1;
if (LOG.isDebugEnabled()) {
LOG.debug("start = " + start + " sheet.getRows() = "
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java Sat Mar 4 08:34:56 2006
@@ -50,7 +50,6 @@
import javax.faces.event.FacesEvent;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -149,7 +148,7 @@
if (columnLayout == null && allColumns.size() > 0) {
StringBuffer sb = new StringBuffer();
- for (int i = 0; i < allColumns.size(); i++) {
+ for (UIColumn allColumn : allColumns) {
sb.append("1*;");
}
columnLayout = sb.deleteCharAt(sb.lastIndexOf(";")).toString();
@@ -174,9 +173,9 @@
String[] allTokens = layoutTokens;
layoutTokens = new String[columns.size()];
int j = 0;
- for (int i = 0; i < allTokens.length; i++) {
- if (allTokens[i] != null) {
- layoutTokens[j] = allTokens[i];
+ for (String allToken : allTokens) {
+ if (allToken != null) {
+ layoutTokens[j] = allToken;
j++;
}
}
@@ -300,8 +299,8 @@
public List<UIComponent> getRenderedChildrenOf(UIColumn column) {
List<UIComponent> children = new ArrayList<UIComponent>();
- for (Iterator kids = column.getChildren().iterator(); kids.hasNext();) {
- UIComponent kid = (UIComponent) kids.next();
+ for (Object o : column.getChildren()) {
+ UIComponent kid = (UIComponent) o;
if (kid.isRendered()) {
children.add(kid);
}
@@ -313,8 +312,17 @@
return getFirst() == 0;
}
+ public boolean hasRowCount() {
+ return getRowCount() != -1;
+ }
+
public boolean isAtEnd() {
- return getFirst() >= getLastPageIndex();
+ if (!hasRowCount()) {
+ setRowIndex(getFirst()+getRows()+1);
+ return !isRowAvailable();
+ } else {
+ return getFirst() >= getLastPageIndex();
+ }
}
public int getLastPageIndex() {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeListbox.java Sat Mar 4 08:34:56 2006
@@ -83,7 +83,6 @@
if ("single".equals(selectable)
|| "singleLeafOnly".equals(selectable)
|| "siblingLeafOnly".equals(selectable)) {
- return;
} else {
// fix to single
LOG.warn("Illegal attributeValue selectable : " + selectable + " set to 'single'");
@@ -94,29 +93,33 @@
private void debugStates(FacesContext facesContext) {
if (LOG.isDebugEnabled()) {
LOG.debug("#####################################################");
- String state = "expandState : ;";
+ StringBuffer state = new StringBuffer("expandState : ;");
for (DefaultMutableTreeNode treeNode : getState().getExpandState()) {
- state += nodeStateId(facesContext, findUITreeNode(getRoot(), treeNode)) + ";";
+ state.append(nodeStateId(facesContext, findUITreeNode(getRoot(), treeNode)));
+ state.append(";");
}
LOG.debug(state);
- state = "selectState : ;";
+ state = new StringBuffer("selectState : ;");
for (DefaultMutableTreeNode treeNode : getState().getSelection()) {
- state += nodeStateId(facesContext, findUITreeNode(getRoot(), treeNode)) + ";";
+ state.append(nodeStateId(facesContext, findUITreeNode(getRoot(), treeNode)));
+ state.append(";");
}
LOG.debug(state);
- state = "selectionPath : ;";
+ state = new StringBuffer("selectionPath : ;");
for (UITreeNode treeNode : getSelectionPath()) {
- state += nodeStateId(facesContext, treeNode) + ";";
+ state.append(nodeStateId(facesContext, treeNode));
+ state.append(";");
}
LOG.debug(state);
- state = "expandPath : ;";
+ state = new StringBuffer("expandPath : ;");
for (UITreeNode treeNode : getExpandPath()) {
- state += nodeStateId(facesContext, treeNode) + ";";
+ state.append(nodeStateId(facesContext, treeNode));
+ state.append(";");
}
- LOG.info(state);
+ LOG.debug(state);
LOG.debug("");
}
@@ -200,8 +203,7 @@
children = Collections.EMPTY_LIST;
}
List<UITreeNode> nodes = new ArrayList<UITreeNode>(children.size());
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- Object node = iter.next();
+ for (Object node : children) {
if (node instanceof UITreeNode) {
nodes.add((UITreeNode) node);
}
@@ -274,12 +276,12 @@
depth = defaultColumnCount;
}
- String columns = "1*";
+ StringBuffer columns = new StringBuffer("1*");
for (int i = 1; i < depth; i++) {
- columns += ";1*";
+ columns.append(";1*");
}
- layout.getAttributes().put(ATTR_COLUMNS, columns);
+ layout.getAttributes().put(ATTR_COLUMNS, columns.toString());
getFacets().put(FACET_LAYOUT_DEFAULT, layout);
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeNode.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeNode.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeNode.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITreeNode.java Sat Mar 4 08:34:56 2006
@@ -179,7 +179,7 @@
protected Object checkValue(Object currentValue) {
if (currentValue == null) {
- LOG.error("currentValue is null: '" + currentValue + "'");
+ LOG.error("currentValue is null");
currentValue = emergencyValue();
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java Sat Mar 4 08:34:56 2006
@@ -133,7 +133,7 @@
} catch (ConcurrentModificationException cme) {
int eventIndex = listiterator.previousIndex();
events.remove(eventIndex);
- listiterator = events.listIterator();
+ //listiterator = events.listIterator();
}
}
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java Sat Mar 4 08:34:56 2006
@@ -36,7 +36,7 @@
private Theme defaultTheme;
private List<Theme> availableThemes;
private List<String> resourceDirs;
- private boolean loadThemesFromClasspath;
+ private boolean loadThemesFromClasspath = true;
private List<MappingRule> mappingRules;
private boolean ajaxEnabled;
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java Sat Mar 4 08:34:56 2006
@@ -72,7 +72,7 @@
"tobago-config/mapping-rule/attribute/value", "setValue", 0);
// enable loading theme from classpath
- digester.addCallMethod("tobago-config/load-themes-from-classpath", "setLoadThemesFromClasspath", 0);
+ digester.addCallMethod("tobago-config/load-theme-resources-from-classpath", "setLoadThemesFromClasspath", 0);
// resource dirs
digester.addCallMethod("tobago-config/resource-dir", "addResourceDir", 0);
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java Sat Mar 4 08:34:56 2006
@@ -1,5 +1,21 @@
package org.apache.myfaces.tobago.context;
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -31,7 +47,7 @@
// todo: Test for new theme build mechanism still under development
// http://issues.apache.org/jira/browse/MYFACES-1106
// to activate you have to do:
-// 1. set load-themes-from-classpath = true in the tobago-config.xml
+// 1. set load-theme-resources-from-classpath = true in the tobago-config.xml
// 2. add resource-path in tobago-config.xml
// 3. add ResourceServlet in web.xml
@@ -52,9 +68,9 @@
public void init()
throws ServletException {
locateResourcesInWar(servletContext, resourceManager, "/");
- if (tobagoConfig.isLoadThemesFromClasspath()) {
- locateResourcesInLib(resourceManager);
- }
+
+ locateResourcesInLib(resourceManager);
+
for (String dir : resourceDirs) {
if (LOG.isDebugEnabled()) {
LOG.debug("Locating resources in dir: " + dir);
@@ -76,17 +92,17 @@
}
Set<String> resourcePaths = servletContext.getResourcePaths(path);
if (resourcePaths == null || resourcePaths.isEmpty()) {
- if (LOG.isErrorEnabled()) {
- LOG.error("ResourcePath empty! Please check the tobago-config.xml file!"
+ LOG.error("ResourcePath empty! Please check the tobago-config.xml file!"
+ " path='" + path + "'");
- }
return;
}
for (String childPath : resourcePaths) {
if (childPath.endsWith("/")) {
// ignore, because weblogic puts the path directory itself in the Set
if (!childPath.equals(path)) {
- LOG.error("childPath dir " + childPath);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("childPath dir " + childPath);
+ }
locateResourcesInWar(servletContext, resources, childPath);
}
} else {
@@ -108,7 +124,6 @@
throws ServletException {
ThemeParser parser = new ThemeParser();
- InputStream stream = null;
try {
LOG.error("Loading tobago-theme.xml");
Enumeration<URL> urls = getClass().getClassLoader().getResources("META-INF/tobago-theme.xml");
@@ -124,6 +139,7 @@
String fileName = themeUrl.toString().substring(4, themeUrl.toString().indexOf("!"));
ClassLoader classLoader = ResourceManagerFactory.class.getClassLoader();
URL jarFile = new URL(fileName);
+ InputStream stream = null;
try {
stream = jarFile.openStream();
ZipInputStream zip = new ZipInputStream(stream);
@@ -146,7 +162,9 @@
LOG.info(inputStream);
addProperties(inputStream, resources, name, true);
} else {
- resources.add(name);
+ if (tobagoConfig.isLoadThemesFromClasspath()) {
+ resources.add(name);
+ }
}
}
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerImpl.java Sat Mar 4 08:34:56 2006
@@ -589,10 +589,6 @@
private int miss;
- public Object put(Object key, Object value) {
- return super.put(key, value);
- }
-
public Object get(Object key) {
Object value = super.get(key);
if (value != null) {
@@ -675,11 +671,8 @@
if (name != null ? !locale.equals(cacheKey.locale) : cacheKey.locale != null) {
return false;
}
- if (!clientPropertyId.equals(cacheKey.clientPropertyId)) {
- return false;
- }
+ return clientPropertyId.equals(cacheKey.clientPropertyId);
- return true;
}
private void calcHashCode() {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeParser.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeParser.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeParser.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ThemeParser.java Sat Mar 4 08:34:56 2006
@@ -1,10 +1,25 @@
package org.apache.myfaces.tobago.context;
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
import org.apache.commons.digester.Digester;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.config.TobagoConfig;
import org.xml.sax.SAXException;
import javax.faces.FacesException;
Copied: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/UserVariableResolverImpl.java (from r382912, incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/VariableResolverImpl.java)
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/UserVariableResolverImpl.java?p2=incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/UserVariableResolverImpl.java&p1=incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/VariableResolverImpl.java&r1=382912&r2=383154&rev=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/VariableResolverImpl.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/UserVariableResolverImpl.java Sat Mar 4 08:34:56 2006
@@ -23,14 +23,14 @@
import javax.faces.el.EvaluationException;
import javax.faces.el.VariableResolver;
-public class VariableResolverImpl extends VariableResolver {
+public class UserVariableResolverImpl extends VariableResolver {
- private static final Log LOG = LogFactory.getLog(VariableResolverImpl.class);
+ private static final Log LOG = LogFactory.getLog(UserVariableResolverImpl.class);
private VariableResolver base;
private UserWrapper userWrapper;
- public VariableResolverImpl(VariableResolver base) {
+ public UserVariableResolverImpl(VariableResolver base) {
LOG.info("Hiding ri base implemation: " + base);
this.base = base;
}
Propchange: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/UserVariableResolverImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/el/UserVariableResolverImpl.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageAction.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageAction.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageAction.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageAction.java Sat Mar 4 08:34:56 2006
@@ -1,4 +1,8 @@
package org.apache.myfaces.tobago.event;
+
+import java.util.HashMap;
+import java.util.Map;
+
/*
* Copyright 2002-2005 The Apache Software Foundation.
*
@@ -16,10 +20,56 @@
*/
public enum PageAction {
- First,
- Next,
- Prev,
- Last,
- ToRow,
- ToPage
+
+ FIRST {
+ public String getToken() {
+ return "First";
+ }
+ },
+ NEXT {
+ public String getToken() {
+ return "Next";
+ }
+ },
+ PREV {
+ public String getToken() {
+ return "Prev";
+ }
+ },
+ LAST {
+ public String getToken() {
+ return "Last";
+ }
+ },
+ TO_ROW {
+ public String getToken() {
+ return "ToRow";
+ }
+ },
+ TO_PAGE {
+ public String getToken() {
+ return "ToPage";
+ }
+ };
+
+ private static final Map<String, PageAction> mapping;
+
+ static {
+ mapping = new HashMap<String, PageAction>();
+
+ for (PageAction action : values()) {
+ mapping.put(action.getToken(), action);
+ }
+ }
+
+ public static PageAction parse(String name) {
+ PageAction value = mapping.get(name);
+ if (value != null) {
+ return value;
+ } else {
+ throw new IllegalArgumentException("Unknown name: " + name);
+ }
+ }
+
+ public abstract String getToken();
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/PageActionEvent.java Sat Mar 4 08:34:56 2006
@@ -1,4 +1,5 @@
package org.apache.myfaces.tobago.event;
+
/*
* Copyright 2002-2005 The Apache Software Foundation.
*
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SortActionEvent.java Sat Mar 4 08:34:56 2006
@@ -1,4 +1,5 @@
package org.apache.myfaces.tobago.event;
+
/*
* Copyright 2002-2005 The Apache Software Foundation.
*
@@ -23,7 +24,7 @@
public class SortActionEvent extends ActionEvent {
- UIColumn column;
+ private UIColumn column;
public SortActionEvent(UIData sheet, UIColumn column) {
super(sheet);
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/ResourceServlet.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/ResourceServlet.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/ResourceServlet.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/ResourceServlet.java Sat Mar 4 08:34:56 2006
@@ -18,10 +18,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.commons.io.IOUtils;
import org.apache.myfaces.tobago.context.Theme;
import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -30,29 +30,31 @@
/**
* User: lofwyr
- * @since 1.0.7
*
- * XXX This class is in development. Please don't use it in
- * production environment!
+ * @since 1.0.7
+ * <p/>
+ * XXX This class is in development. Please don't use it in
+ * production environment!
*/
public class ResourceServlet extends HttpServlet {
private static final Log LOG = LogFactory.getLog(ResourceServlet.class);
- private static final int BUFFER_SIZE = 1024;
protected void service(
HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
- LOG.info("C " + request.getContextPath());
- LOG.info("Q " + request.getQueryString());
String requestURI = request.getRequestURI();
- LOG.info("R " + requestURI);
String resource = requestURI.substring(
request.getContextPath().length() + 1); // todo: make it "stable"
- LOG.info("L " + resource);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("C " + request.getContextPath());
+ LOG.debug("Q " + request.getQueryString());
+ LOG.debug("R " + requestURI);
+ LOG.debug("L " + resource);
+ }
// todo: maybe support more extensions (configurable?)
if (requestURI.endsWith(".gif")) {
@@ -66,20 +68,16 @@
} else if (requestURI.endsWith(".css")) {
response.setContentType("text/css");
} else {
- LOG.warn("Unsupported file extension, will be ignored for security " +
- "reasons. resource='" + resource + "'");
- response.setStatus(403); // todo: is there a constant in servlet API for "forbidden"?
+ LOG.warn("Unsupported file extension, will be ignored for security "
+ + "reasons. resource='" + resource + "'");
+ response.setStatus(HttpServletResponse.SC_FORBIDDEN);
}
-
- InputStream inputStream
- = Theme.class.getClassLoader().getResourceAsStream(resource);
-
- ServletOutputStream outputStream = response.getOutputStream();
-
- byte[] buffer = new byte[BUFFER_SIZE];
- int number;
- while (-1 != (number = inputStream.read(buffer))) {
- outputStream.write(buffer, 0, number);
+ InputStream inputStream = null;
+ try {
+ inputStream = Theme.class.getClassLoader().getResourceAsStream(resource);
+ IOUtils.copy(inputStream, response.getOutputStream());
+ } finally {
+ IOUtils.closeQuietly(inputStream);
}
}
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTag.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTag.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTag.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/CellTag.java Sat Mar 4 08:34:56 2006
@@ -26,7 +26,6 @@
import org.apache.myfaces.tobago.component.UICell;
import javax.faces.component.UIComponent;
-import javax.servlet.jsp.JspException;
/*
* Created 29.07.2003 at 15:09:53.
@@ -47,10 +46,6 @@
public String getComponentType() {
return UICell.COMPONENT_TYPE;
- }
-
- public int doStartTag() throws JspException {
- return super.doStartTag();
}
public String getRendererType() {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java Sat Mar 4 08:34:56 2006
@@ -18,23 +18,14 @@
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SORTABLE;
-import org.apache.myfaces.tobago.apt.annotation.Tag;
-import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
-import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
-import org.apache.myfaces.tobago.taglib.decl.HasLabel;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
-/**
- * Renders a UIComponent that represents a single column of data within a
- * parent UIData component.
- */
-@Tag(name = "column")
+
public class ColumnTag extends TobagoTag
- implements HasIdBindingAndRendered, HasLabel {
+ implements ColumnTagDeclaration {
private String sortable;
private String align;
@@ -63,12 +54,6 @@
return align;
}
-
- /**
- * Alignment of this column.
- */
- @TagAttribute
- @UIComponentTagAttribute()
public void setAlign(String align) {
this.align = align;
}
@@ -77,14 +62,7 @@
return sortable;
}
- /**
- * Flag indicating whether or not this column is sortable.
- * To make a column sortable the data of the sheet must be one of
- * <code>java.util.List</code>, <code>Object[]</code> or instance of
- * <code>org.apache.myfaces.tobago.model.SortableByApplication</code>.
- */
- @TagAttribute
- @UIComponentTagAttribute(type = { "java.lang.Boolean" }, defaultValue = "false")
+
public void setSortable(String sortable) {
this.sortable = sortable;
}
Added: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java?rev=383154&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java (added)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java Sat Mar 4 08:34:56 2006
@@ -0,0 +1,57 @@
+package org.apache.myfaces.tobago.taglib.component;
+
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
+import org.apache.myfaces.tobago.taglib.decl.HasLabel;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 20.02.2006
+ * Time: 22:10:07
+ * To change this template use File | Settings | File Templates.
+ */
+
+/**
+ * Renders a UIComponent that represents a single column of data within a
+ * parent UIData component.
+ */
+@Tag(name = "column")
+@UIComponentTag(UIComponent = "javax.faces.component.UIColumn")
+public interface ColumnTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered, HasLabel {
+ /**
+ * Alignment of this column.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ void setAlign(String align);
+
+ /**
+ * Flag indicating whether or not this column is sortable.
+ * To make a column sortable the data of the sheet must be one of
+ * <code>java.util.List</code>, <code>Object[]</code> or instance of
+ * <code>org.apache.myfaces.tobago.model.SortableByApplication</code>.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = { "java.lang.Boolean" }, defaultValue = "false")
+ void setSortable(String sortable);
+}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/taglib/component/TobagoBodyTag.java Sat Mar 4 08:34:56 2006
@@ -59,8 +59,7 @@
if (bodyContent != null) {
String content = bodyContent.getString();
//bodyContent.clearBody();
- String tmp = new String(content); // FIXME: is this not a bit slow? It is needed?
- tmp = tmp.replace('\n', ' ');
+ String tmp = content.replace('\n', ' ');
if (tmp.trim().length() > 0) { // if there are only whitespaces: drop bodyContent
return false;
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComparatorBase.java Sat Mar 4 08:34:56 2006
@@ -1,23 +1,25 @@
package org.apache.myfaces.tobago.util;
-import java.text.CollationKey;
-import java.text.Collator;
-import java.util.Comparator;
/*
* Copyright 2002-2005 The Apache Software Foundation.
- *
- * Licensed 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.
+ *
+ * Licensed 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.
*/
+
+import java.text.CollationKey;
+import java.text.Collator;
+import java.util.Comparator;
+
public abstract class ComparatorBase implements Comparator {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/HtmlWriterUtil.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/HtmlWriterUtil.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/HtmlWriterUtil.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/HtmlWriterUtil.java Sat Mar 4 08:34:56 2006
@@ -398,9 +398,7 @@
ATTRIBUTE_CHARS_TO_ESCAPE[0x3E] = ">".toCharArray(); // 0x3E '>'
TEXT_CHARS_TO_ESCAPE = new char[ATTRIBUTE_CHARS_TO_ESCAPE.length][];
- for (int i = 0; i < ATTRIBUTE_CHARS_TO_ESCAPE.length; i++) {
- TEXT_CHARS_TO_ESCAPE[i] = ATTRIBUTE_CHARS_TO_ESCAPE[i];
- }
+ System.arraycopy(ATTRIBUTE_CHARS_TO_ESCAPE, 0, TEXT_CHARS_TO_ESCAPE, 0, ATTRIBUTE_CHARS_TO_ESCAPE.length);
TEXT_CHARS_TO_ESCAPE[0x3C] = "<".toCharArray(); // 0x '<'
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java Sat Mar 4 08:34:56 2006
@@ -54,9 +54,7 @@
+ tokensToString(layoutTokens));
}
this.layoutTokens = new String[cellCount];
- for (int i = 0; i < cellCount; i++) {
- this.layoutTokens[i] = layoutTokens[i];
- }
+ System.arraycopy(layoutTokens, 0, this.layoutTokens, 0, cellCount);
} else {
if (!ignoreMismatch && LOG.isWarnEnabled()) {
LOG.warn(Integer.toString(cellCount - layoutTokens.length)
@@ -169,11 +167,11 @@
public static String tokensToString(String[] tokens) {
StringBuffer sb = new StringBuffer();
- for (int i = 0; i < tokens.length; i++) {
+ for (String token : tokens) {
if (sb.length() != 0) {
sb.append(";");
}
- sb.append(tokens[i]);
+ sb.append(token);
}
sb.insert(0, "\"");
sb.append("\"");
@@ -202,8 +200,8 @@
public List<Integer> getSpaceList() {
List<Integer> list = new ArrayList<Integer>(spaces.length);
- for (int i = 0; i < spaces.length; i++) {
- list.add(new Integer(spaces[i]));
+ for (int space : spaces) {
+ list.add(new Integer(space));
}
return list;
}
@@ -246,8 +244,8 @@
//TODO replace with Arrays.asList ..
private String arrayAsString(int[] currentSpaces) {
StringBuffer sb = new StringBuffer("[");
- for (int i = 0; i < currentSpaces.length; i++) {
- sb.append(currentSpaces[i]);
+ for (int currentSpace : currentSpaces) {
+ sb.append(currentSpace);
sb.append(", ");
}
sb.replace(sb.lastIndexOf(", "), sb.length(), "]");
@@ -338,8 +336,7 @@
if (isFree(i) && tokens[i].matches("^\\d+\\*")) {
String token = tokens[i].substring(0, tokens[i].length() - 1);
try {
- int portion = Integer.parseInt(token);
- portions += portion;
+ portions += Integer.parseInt(token);
} catch (NumberFormatException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("NumberFormatException parsing " + tokens[i]);
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutUtil.java Sat Mar 4 08:34:56 2006
@@ -31,7 +31,6 @@
import org.apache.myfaces.tobago.component.ComponentUtil;
import org.apache.myfaces.tobago.component.UIForm;
import org.apache.myfaces.tobago.component.UICell;
-import org.apache.myfaces.tobago.component.UIPanel;
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
import org.apache.myfaces.tobago.renderkit.RendererBase;
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java Sat Mar 4 08:34:56 2006
@@ -78,7 +78,7 @@
final ValueBindingComparator that = (ValueBindingComparator) o;
- if (! super.equals(o)) {
+ if (!super.equals(o)) {
return false;
}
if (facesContext != null ? !facesContext.equals(that.facesContext) : that.facesContext != null) {
Added: incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/LICENSE.txt
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/LICENSE.txt?rev=383154&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/LICENSE.txt (added)
+++ incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/LICENSE.txt Sat Mar 4 08:34:56 2006
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
Added: incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/NOTICE.txt
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/NOTICE.txt?rev=383154&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/NOTICE.txt (added)
+++ incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/NOTICE.txt Sat Mar 4 08:34:56 2006
@@ -0,0 +1,2 @@
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
Modified: incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/faces-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/faces-config.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/faces-config.xml (original)
+++ incubator/tobago/trunk/tobago-core/src/main/resources/META-INF/faces-config.xml Sat Mar 4 08:34:56 2006
@@ -29,9 +29,6 @@
<view-handler>
org.apache.myfaces.tobago.application.ViewHandlerImpl
</view-handler>
- <variable-resolver>
- org.apache.myfaces.tobago.el.VariableResolverImpl
- </variable-resolver>
<message-bundle>
org.apache.myfaces.tobago.context.TobagoResourceBundle
</message-bundle>
Modified: incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd (original)
+++ incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd Sat Mar 4 08:34:56 2006
@@ -18,7 +18,7 @@
<!ENTITY % Boolean "(true|false|yes|no)">
-<!ELEMENT tobago-config (theme-config, resource-dir+, load-themes-from-classpath?, mapping-rule*, ajax-enabled?)>
+<!ELEMENT tobago-config (theme-config, resource-dir+, load-theme-resources-from-classpath?, mapping-rule*, ajax-enabled?)>
<!ELEMENT theme-config (default-theme, supported-theme*)>
<!ELEMENT default-theme (#PCDATA)>
@@ -30,7 +30,7 @@
<!ELEMENT resource-dir (#PCDATA)>
-<!ELEMENT load-themes-from-classpath (#PCDATA)>
+<!ELEMENT load-theme-resources-from-classpath (#PCDATA)>
<!ELEMENT mapping-rule (request-uri, forward-uri, attribute*)>
<!ELEMENT request-uri (#PCDATA)>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml Sat Mar 4 08:34:56 2006
@@ -32,18 +32,6 @@
<finalName>tobago-example-addressbook</finalName>
<plugins>
<plugin>
- <groupId>org.apache.myfaces.tobago</groupId>
- <artifactId>maven-theme-plugin</artifactId>
- <version>${version}</version>
- <executions>
- <execution>
- <goals>
- <goal>resources</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
@@ -58,31 +46,8 @@
<dependencies>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
- <artifactId>tobago-theme-scarborough</artifactId>
- <version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.tobago</groupId>
- <artifactId>tobago-theme-speyside</artifactId>
- <version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-richmond</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.tobago</groupId>
- <artifactId>tobago-theme-standard</artifactId>
- <version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml Sat Mar 4 08:34:56 2006
@@ -26,6 +26,6 @@
</theme-config>
<resource-dir>tobago-resource</resource-dir>
- <resource-dir>tobago</resource-dir>
-
+ <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
+ <load-theme-resources-from-classpath>true</load-theme-resources-from-classpath>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml Sat Mar 4 08:34:56 2006
@@ -52,9 +52,20 @@
<load-on-startup>1</load-on-startup>
</servlet>
+ <servlet>
+ <servlet-name>ResourceServlet</servlet-name>
+ <servlet-class>org.apache.myfaces.tobago.servlet.ResourceServlet</servlet-class>
+ </servlet>
+
+
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>ResourceServlet</servlet-name>
+ <url-pattern>/org/apache/myfaces/tobago/renderkit/*</url-pattern>
</servlet-mapping>
<!-- Welcome File List -->
Modified: incubator/tobago/trunk/tobago-example/tobago-example-blank/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-blank/pom.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-blank/pom.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-blank/pom.xml Sat Mar 4 08:34:56 2006
@@ -30,18 +30,7 @@
<build>
<finalName>tobago-example-blank</finalName>
<plugins>
- <plugin>
- <groupId>org.apache.myfaces.tobago</groupId>
- <artifactId>maven-theme-plugin</artifactId>
- <version>${version}</version>
- <executions>
- <execution>
- <goals>
- <goal>resources</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
@@ -52,6 +41,7 @@
<url>http://localhost:8080/manager</url>
</configuration>
</plugin>
+
</plugins>
</build>
<dependencies>
@@ -59,29 +49,21 @@
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-scarborough</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-speyside</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-richmond</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-standard</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml Sat Mar 4 08:34:56 2006
@@ -26,6 +26,5 @@
</theme-config>
<resource-dir>tobago-resource</resource-dir>
- <resource-dir>tobago</resource-dir>
-
+ <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/web.xml Sat Mar 4 08:34:56 2006
@@ -58,6 +58,12 @@
<load-on-startup>2</load-on-startup>
</servlet>
+ <servlet>
+ <servlet-name>ResourceServlet</servlet-name>
+ <servlet-class>org.apache.myfaces.tobago.servlet.ResourceServlet</servlet-class>
+ </servlet>
+
+
<!-- servlet-mapping -->
<servlet-mapping>
@@ -69,6 +75,12 @@
<servlet-name>TemplateServlet</servlet-name>
<url-pattern>*.view</url-pattern>
</servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>ResourceServlet</servlet-name>
+ <url-pattern>/org/apache/myfaces/tobago/renderkit/*</url-pattern>
+ </servlet-mapping>
+
<!-- mime -->
<mime-mapping>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml?rev=383154&r1=383153&r2=383154&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-demo/pom.xml Sat Mar 4 08:34:56 2006
@@ -31,17 +31,20 @@
<build>
<finalName>tobago-example-demo</finalName>
<plugins>
- <!--may be removed after solving http://issues.apache.org/jira/browse/MYFACES-1106-->
+
<plugin>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>maven-theme-plugin</artifactId>
<version>${version}</version>
<executions>
<execution>
- <goals><goal>resources</goal></goals>
+ <goals>
+ <goal>resources</goal>
+ </goals>
</execution>
</executions>
</plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
@@ -52,6 +55,7 @@
<!--url>http://mononoke:8080/manager</url-->
</configuration>
</plugin>
+
</plugins>
</build>
<dependencies>
@@ -59,29 +63,21 @@
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-scarborough</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-speyside</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-richmond</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-theme-standard</artifactId>
<version>${version}</version>
- <classifier>THEME</classifier>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tobago</groupId>