You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by an...@apache.org on 2006/08/02 19:31:02 UTC
svn commit: r428059 - in
/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html:
Relation.java Relation.jwc RelationBean.java
Author: andyhot
Date: Wed Aug 2 10:31:00 2006
New Revision: 428059
URL: http://svn.apache.org/viewvc?rev=428059&view=rev
Log:
TAPESTRY-199: Include title and add component to support all kinds of relations and placeholder for the data
Added:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.jwc
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RelationBean.java
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java?rev=428059&r1=428058&r2=428059&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.java Wed Aug 2 10:31:00 2006
@@ -19,7 +19,7 @@
/**
* Works with the {@link Shell} component to define and append a
- * relationship between docuements (typically a stylesheet) to
+ * relationship between documents (typically a stylesheet) to
* the HTML response.
*
* @author andyhot
Added: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.jwc?rev=428059&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.jwc (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Relation.jwc Wed Aug 2 10:31:00 2006
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2004, 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.
+-->
+
+<!DOCTYPE component-specification PUBLIC
+ "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+
+<component-specification class="org.apache.tapestry.html.Relation"
+ allow-body="no"
+ allow-informal-parameters="no">
+
+ <description>
+ Creates a relationship between two documents (typically the current html
+ document and an external stylesheet).
+ </description>
+
+ <parameter name="href" required="yes">
+ <description>
+ The target URL of the related resource. Can either be a String or an IAsset.
+ </description>
+ </parameter>
+
+ <parameter name="rel"
+ default-value="literal:stylesheet">
+ <description>
+ Defines the relationship between the current document and the targeted document.
+ </description>
+ </parameter>
+
+ <parameter name="rev">
+ <description>
+ Defines the relationship between the targeted document and the current document.
+ </description>
+ </parameter>
+
+ <parameter name="type"
+ default-value="literal:text/css">
+ <description>
+ Specifies the MIME type of the target URL.
+ </description>
+ </parameter>
+
+ <parameter name="title">
+ <description>
+ Title of the relation.
+ </description>
+ </parameter>
+
+ <parameter name="media">
+ <description>
+ Specifies on what device the document will be displayed.
+ </description>
+ </parameter>
+
+</component-specification>
\ No newline at end of file
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RelationBean.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RelationBean.java?rev=428059&r1=428058&r2=428059&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RelationBean.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RelationBean.java Wed Aug 2 10:31:00 2006
@@ -30,6 +30,12 @@
private String _rev;
/** Specifies the MIME type of the target URL. */
private String _type;
+ /** Title of the relation. */
+ private String _title;
+
+ public RelationBean()
+ {
+ }
public String getHref()
{
@@ -80,4 +86,56 @@
{
_type = type;
}
+
+ public String getTitle()
+ {
+ return _title;
+ }
+
+ public void setTitle(String title)
+ {
+ _title = title;
+ }
+
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((_href == null) ? 0 : _href.hashCode());
+ result = prime * result + ((_media == null) ? 0 : _media.hashCode());
+ result = prime * result + ((_rel == null) ? 0 : _rel.hashCode());
+ result = prime * result + ((_rev == null) ? 0 : _rev.hashCode());
+ result = prime * result + ((_title == null) ? 0 : _title.hashCode());
+ result = prime * result + ((_type == null) ? 0 : _type.hashCode());
+ return result;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+ final RelationBean other = (RelationBean) obj;
+ if (_href == null) {
+ if (other._href != null) return false;
+ } else if (!_href.equals(other._href)) return false;
+ if (_media == null) {
+ if (other._media != null) return false;
+ } else if (!_media.equals(other._media)) return false;
+ if (_rel == null) {
+ if (other._rel != null) return false;
+ } else if (!_rel.equals(other._rel)) return false;
+ if (_rev == null) {
+ if (other._rev != null) return false;
+ } else if (!_rev.equals(other._rev)) return false;
+ if (_title == null) {
+ if (other._title != null) return false;
+ } else if (!_title.equals(other._title)) return false;
+ if (_type == null) {
+ if (other._type != null) return false;
+ } else if (!_type.equals(other._type)) return false;
+ return true;
+ }
+
+
}