[Bedework-commit] bedework r1331 - in releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model: . component property

svnadmin at bedework.org svnadmin at bedework.org
Wed Apr 11 23:42:49 EDT 2007


Author: douglm
Date: 2007-04-11 23:42:46 -0400 (Wed, 11 Apr 2007)
New Revision: 1331

Added:
   releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/component/VVenue.java
Modified:
   releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Component.java
   releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Property.java
   releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/property/Attach.java
Log:
vvenue related changes

Modified: releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Component.java
===================================================================
--- releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Component.java	2007-04-11 16:38:25 UTC (rev 1330)
+++ releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Component.java	2007-04-12 03:42:46 UTC (rev 1331)
@@ -65,6 +65,8 @@
 
     public static final String VALARM = "VALARM";
 
+    public static final String VVENUE = "VVENUE";
+
     public static final String EXPERIMENTAL_PREFIX = "X-";
 
     private String name;

Modified: releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Property.java
===================================================================
--- releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Property.java	2007-04-11 16:38:25 UTC (rev 1330)
+++ releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/Property.java	2007-04-12 03:42:46 UTC (rev 1331)
@@ -167,6 +167,27 @@
 
     public static final String EXPERIMENTAL_PREFIX = "X-";
 
+    /**
+     * the following are vvenue only properties.
+     */
+    public static final String COUNTRY = "COUNTRY";
+
+    public static final String EXTENDED_ADDRESS = "EXTENDED-ADDRESS";
+
+    public static final String LOCALITY = "LOCALITY";
+
+    public static final String LOCATION_TYPE = "LOCATION-TYPE";
+
+    public static final String NAME = "NAME";
+
+    public static final String POSTALCODE = "POSTALCODE";
+
+    public static final String REGION = "REGION";
+
+    public static final String STREET_ADDRESS = "STREET-ADDRESS";
+
+    public static final String TEL = "TEL";
+
     private String name;
 
     private ParameterList parameters;

Added: releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/component/VVenue.java
===================================================================
--- releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/component/VVenue.java	                        (rev 0)
+++ releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/component/VVenue.java	2007-04-12 03:42:46 UTC (rev 1331)
@@ -0,0 +1,187 @@
+/*
+ * $Id: VTimeZone.java,v 1.20 2006/11/05 05:07:57 fortuna Exp $ [Apr 5, 2004]
+ *
+ * Copyright (c) 2004, Ben Fortuna
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  o Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *  o Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ *  o Neither the name of Ben Fortuna nor the names of any other contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package net.fortuna.ical4j.model.component;
+
+import net.fortuna.ical4j.model.Property;
+import net.fortuna.ical4j.model.PropertyList;
+import net.fortuna.ical4j.model.ValidationException;
+import net.fortuna.ical4j.util.PropertyValidator;
+import net.fortuna.ical4j.util.Strings;
+
+/**
+ * Defines an iCalendar VVENUE component.
+ *
+ * <pre>
+ * 4.  Venue Component
+ *
+ *    Component Name: "VVENUE"
+ *
+ *    Purpose: Provide a grouping of component properties that describe an
+ *    event venue.
+ *
+ *    Format Definition: A "VVENUE" calendar component is defined by the
+ *    following notation:
+ *      venuec  = "BEGIN" ":" "VVENUE" CRLF
+ *              venueprop
+ *              "END" ":" "VVENUE" CRLF
+ *
+ *      venueprop  = *(
+ *
+ *                ; the following are all REQUIRED,
+ *                ; but MUST NOT occur more than once
+ *
+ *                uid
+ *
+ *                ; the following are optional,
+ *                ; but MUST NOT occur more than once
+ *
+ *                name / description / street-address / extended-address /
+ *                locality / region / country / postal-code / tzid / geo /
+ *                location-type / categories
+ *
+ *                ; the following are optional,
+ *                ; and MAY occur more than once
+ *
+ *                tel / url
+ *              )
+ *
+ *    Description: A "VVENUE" calendar component is a grouping of component
+ *    properties that represent a venue where an event occurs.  This
+ *    extends the "LOCATION" property of "VEVENT" and "TODO" components,
+ *    providing the ability to specify detailed information about the event
+ *    venue.
+ *
+ * </pre>
+ *
+ * @author Ben Fortuna
+ * @author Mike Douglass
+ */
+public class VVenue extends CalendarComponent {
+
+    //private static final long serialVersionUID = 5629679741050917815L;
+
+    /**
+     * Default constructor.
+     */
+    public VVenue() {
+        super(VVENUE);
+    }
+
+    /**
+     * Constructs a new instance containing the specified properties.
+     * @param properties a list of properties
+     */
+    public VVenue(final PropertyList properties) {
+        super(VVENUE, properties);
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public final String toString() {
+        StringBuffer b = new StringBuffer();
+        b.append(BEGIN);
+        b.append(':');
+        b.append(getName());
+        b.append(Strings.LINE_SEPARATOR);
+        b.append(getProperties());
+        b.append(END);
+        b.append(':');
+        b.append(getName());
+        b.append(Strings.LINE_SEPARATOR);
+        return b.toString();
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see net.fortuna.ical4j.model.Component#validate(boolean)
+     */
+    public final void validate(final boolean recurse)
+            throws ValidationException {
+
+        /*
+         * ; 'uiid' is required, but MUST NOT occur more ; than once uiid /
+         */
+        PropertyValidator.getInstance().assertOne(Property.UID,
+                getProperties());
+
+        /*
+         *                ; the following are optional,
+         *                ; but MUST NOT occur more than once
+         *
+         *                name / description / street-address / extended-address /
+         *                locality / region / country / postal-code / tzid / geo /
+         *                location-type / categories /
+         *                dtstamp / created / last-modified
+         */
+        PropertyValidator.getInstance().assertOneOrLess(Property.NAME,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.DESCRIPTION,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.STREET_ADDRESS,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.EXTENDED_ADDRESS,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.LOCALITY,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.REGION,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.COUNTRY,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.POSTALCODE,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.TZID,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.GEO,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.LOCATION_TYPE,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.CATEGORIES,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.DTSTAMP,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.CREATED,
+                getProperties());
+        PropertyValidator.getInstance().assertOneOrLess(Property.LAST_MODIFIED,
+                getProperties());
+
+        /*
+         * ; the following is optional, ; and MAY occur more than once tel / url / x-prop
+         */
+
+        if (recurse) {
+            validateProperties();
+        }
+    }
+}


Property changes on: releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/component/VVenue.java
___________________________________________________________________
Name: svn:eol-style
   + LF

Modified: releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/property/Attach.java
===================================================================
--- releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/property/Attach.java	2007-04-11 16:38:25 UTC (rev 1330)
+++ releases/external/ical4j-1.0-beta1-bedework-3.3/net/fortuna/ical4j/model/property/Attach.java	2007-04-12 03:42:46 UTC (rev 1331)
@@ -61,52 +61,52 @@
 
 /**
  * Defines an ATTACH iCalendar component property.
- * 
+ *
  * <pre>
  *       4.8.1.1 Attachment
- *       
+ *
  *          Property Name: ATTACH
- *       
+ *
  *          Purpose: The property provides the capability to associate a document
  *          object with a calendar component.
- *       
+ *
  *          Value Type: The default value type for this property is URI. The
  *          value type can also be set to BINARY to indicate inline binary
  *          encoded content information.
- *       
+ *
  *          Property Parameters: Non-standard, inline encoding, format type and
  *          value data type property parameters can be specified on this
  *          property.
- *        
+ *
  *          Conformance: The property can be specified in a &quot;VEVENT&quot;, &quot;VTODO&quot;,
  *          &quot;VJOURNAL&quot; or &quot;VALARM&quot; calendar components.
- *       
+ *
  *          Description: The property can be specified within &quot;VEVENT&quot;, &quot;VTODO&quot;,
  *          &quot;VJOURNAL&quot;, or &quot;VALARM&quot; calendar components. This property can be
  *          specified multiple times within an iCalendar object.
- *       
+ *
  *          Format Definition: The property is defined by the following notation:
- *       
+ *
  *            attach     = &quot;ATTACH&quot; attparam &quot;:&quot; uri  CRLF
- *       
+ *
  *            attach     =/ &quot;ATTACH&quot; attparam &quot;;&quot; &quot;ENCODING&quot; &quot;=&quot; &quot;BASE64&quot;
  *                          &quot;;&quot; &quot;VALUE&quot; &quot;=&quot; &quot;BINARY&quot; &quot;:&quot; binary
- *       
+ *
  *            attparam   = *(
- *       
+ *
  *                       ; the following is optional,
  *                       ; but MUST NOT occur more than once
- *       
+ *
  *                       (&quot;;&quot; fmttypeparam) /
- *       
+ *
  *                       ; the following is optional,
  *                       ; and MAY occur more than once
- *       
+ *
  *                       (&quot;;&quot; xparam)
- *       
+ *
  *                       )
  * </pre>
- * 
+ *
  * @author benf
  */
 public class Attach extends Property {
@@ -233,7 +233,7 @@
                 BinaryDecoder decoder = DecoderFactory.getInstance()
                         .createBinaryDecoder(
                                 (Encoding) getParameter(Parameter.ENCODING));
-                binary = decoder.decode(getBinary());
+                binary = decoder.decode(aValue.getBytes());
             }
             catch (UnsupportedEncodingException uee) {
                 log.error("Error encoding binary data", uee);



More information about the Bedework-commit mailing list