You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/12/06 11:10:34 UTC
[13/51] [partial] ISIS-188: moving modules into core
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/TextString.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/TextString.java b/framework/applib/src/main/src-archived/old-valueholders/TextString.java
deleted file mode 100644
index ab670d7..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/TextString.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.BusinessObject;
-import org.apache.isis.application.Title;
-import org.apache.isis.application.value.ValueParseException;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * Value object representing an unformatted text string of unbounded length.
- * <p>
- * This object <i>does </i> support value listeners.
- * </p>
- */
-public class TextString extends BusinessValueHolder {
- private final static Logger logger = Logger.getLogger(TextString.class);
- private static final long serialVersionUID = 1L;
- private int maximumLength = 0;
- private int minimumLength = 0;
- private String text;
-
- /**
- * Creates an empty TextString.
- */
- public TextString() {
- this((BusinessObject) null);
- }
-
- /**
- * Creates a TextString containing the specified text.
- */
- public TextString(final String text) {
- this(null, text);
- }
-
- /**
- * Creates a TextString containing a copy of the text in the specified TextString.
- */
- public TextString(final TextString textString) {
- this(null, textString);
- }
-
- /**
- * Creates an empty TextString.
- */
- public TextString(final BusinessObject parent) {
- super(parent);
- this.clear();
- }
-
- /**
- * Creates a TextString containing the specified text.
- */
- public TextString(final BusinessObject parent, final String text) {
- super(parent);
- setValue(text);
- }
-
- /**
- * Creates a TextString containing a copy of the text in the specified TextString.
- */
- public TextString(final BusinessObject parent, final TextString textString) {
- super(parent);
- setValue(textString);
- }
-
- public String asEncodedString() {
- return isEmpty() ? "NULL" : text;
- }
-
- /**
- *
- */
- private void checkForInvalidCharacters() {
- if (text == null) {
- return;
- }
-
- for (int i = 0; i < text.length(); i++) {
- if (isCharDisallowed(text.charAt(i))) {
- throw new RuntimeException(getClass() + " cannot contain the character code 0x"
- + Integer.toHexString(text.charAt(i)));
- }
- }
- }
-
- /**
- * clears the value (sets to null) and notifies any listeners.
- */
- public void clear() {
- setValuesInternal(null, true);
- }
-
- /**
- * Returns true if the specified text is found withing this object.
- */
- public boolean contains(final String text) {
- return contains(text, Case.SENSITIVE);
- }
-
- /**
- * Returns true if the specified text is found withing this object. If caseSensitive is false then
- * differences in case are ignored.
- */
- public boolean contains(final String text, final Case caseSensitive) {
- ensureAtLeastPartResolved();
- if (this.text == null) {
- return false;
- }
-
- if (caseSensitive == Case.SENSITIVE) {
- return this.text.indexOf(text) >= 0;
- } else {
- return this.text.toLowerCase().indexOf(text.toLowerCase()) >= 0;
- }
- }
-
- public void copyObject(final BusinessValueHolder object) {
- if (!(object instanceof TextString)) {
- throw new IllegalArgumentException("Can only copy the value of a TextString object");
- }
-
- TextString textString = (TextString) object;
- setValue(textString);
- }
-
- /**
- * Returns true if the specified text is found at the end of this object's text.
- */
- public boolean endsWith(final String text) {
- return endsWith(text, Case.SENSITIVE);
- }
-
- /**
- * Returns true if the specified text is found at the end of this object's text. If caseSensitive is false
- * then differences in case are ignored.
- */
- public boolean endsWith(final String text, final Case caseSensitive) {
- ensureAtLeastPartResolved();
- if (this.text == null) {
- return false;
- }
-
- if (caseSensitive == Case.SENSITIVE) {
- return this.text.endsWith(text);
- } else {
- return this.text.toLowerCase().endsWith(text.toLowerCase());
- }
- }
-
- /**
- * @deprecated replaced by isSameAs
- */
- public boolean equals(final Object object) {
- ensureAtLeastPartResolved();
- if (object instanceof TextString) {
- TextString other = (TextString) object;
-
- if (this.text == null) {
- return other.text == null;
- }
-
- return this.text.equals(other.text);
- }
-
- return super.equals(object);
- }
-
- protected Logger getLogger() {
- return logger;
- }
-
- public int getMaximumLength() {
- return maximumLength;
- }
-
- public int getMinimumLength() {
- return minimumLength;
- }
-
- public String getObjectHelpText() {
- return "A TextString object.";
- }
-
- /**
- * disallow CR, LF and TAB
- */
- protected boolean isCharDisallowed(final char c) {
- return c == '\n' || c == '\r' || c == '\t';
- }
-
- /**
- * Returns true if this object's text has no characters in it.
- */
- public boolean isEmpty() {
- ensureAtLeastPartResolved();
- return text == null || text.length() == 0;
- }
-
- /**
- * delegates the comparsion to the <code>isSameAs(TextString)</code> method if specified object is a
- * <code>TextString</code> else returns false.
- *
- * @see BusinessValueHolder#isSameAs(BusinessValueHolder)
- */
- public boolean isSameAs(final BusinessValueHolder object) {
- if (object instanceof TextString) {
- return isSameAs((TextString) object);
- } else {
- return false;
- }
- }
-
- /**
- * Returns true if the specified text is the same as (for all characters) the object's text.
- */
- public boolean isSameAs(final String text) {
- return isSameAs(text, Case.SENSITIVE);
- }
-
- /**
- * Returns true if the specified text is the same as (for all characters) the object's text. If
- * caseSensitive is false then differences in case are ignored.
- */
- public boolean isSameAs(final String text, final Case caseSensitive) {
- ensureAtLeastPartResolved();
- if (this.text == null) {
- return false;
- }
-
- if (caseSensitive == Case.SENSITIVE) {
- return this.text.equals(text);
- } else {
- return this.text.equalsIgnoreCase(text);
- }
- }
-
- /**
- * Returns true if the specified text is the same as (for all characters) the object's text.
- */
- public boolean isSameAs(final TextString text) {
- return isSameAs(text, Case.SENSITIVE);
- }
-
- /**
- * Returns true if the specified text is the same as (for all characters) the object's text. If
- * caseSensitive is false then differences in case are ignored.
- */
- public boolean isSameAs(final TextString text, final Case caseSensitive) {
- ensureAtLeastPartResolved();
- if (this.text == null) {
- return this.text == text.text;
- }
-
- if (caseSensitive == Case.SENSITIVE) {
- return this.text.equals(text.text);
- } else {
- return this.text.equalsIgnoreCase(text.text);
- }
- }
-
- // TODO remove this method from interface
- public boolean isValid() {
- return false;
- }
-
- public void parseUserEntry(final String text) throws ValueParseException {
- setValue(text);
- }
-
- /**
- * Reset this string so it set to null (therefore equivalent to clear())
- *
- * @see #clear()
- */
- public void reset() {
- setValue((String) null);
- }
-
- public void restoreFromEncodedString(final String data) {
- if (data == null || data.equals("NULL")) {
- setValuesInternal(null, false);
- } else {
- setValuesInternal(data, false);
- checkForInvalidCharacters();
- }
- }
-
- public void setMaximumLength(final int maximumLength) {
- this.maximumLength = maximumLength;
- }
-
- public void setMinimumLength(final int minimumLength) {
- this.minimumLength = minimumLength;
- }
-
- /**
- * Sets this object text to be same as the specified text.
- */
- public void setValue(final String text) {
- setValuesInternal(text, true);
- checkForInvalidCharacters();
- }
-
- /**
- * Sets this object text to be same as the specified text.
- */
- public void setValue(final TextString text) {
- if (text == null || text.isEmpty()) {
- clear();
- } else {
- setValuesInternal(text.text, true);
- }
- }
-
- private void setValuesInternal(final String value, final boolean notify) {
- if (notify) {
- ensureAtLeastPartResolved();
- }
- this.text = value;
- // computeWhetherIsEmptyAndStringValue();
- if (notify) {
- parentChanged();
- }
- }
-
- /**
- * Returns true if the specified text is found at the beginning of this object's text.
- */
- public boolean startsWith(final String text) {
- return startsWith(text, Case.SENSITIVE);
- }
-
- /**
- * Returns true if the specified text is found at the beginning of this object's text. If caseSensitive is
- * false then differences in case are ignored.
- */
- public boolean startsWith(final String text, final Case caseSensitive) {
- ensureAtLeastPartResolved();
- if (this.text == null) {
- return false;
- }
-
- if (caseSensitive == Case.SENSITIVE) {
- return this.text.startsWith(text);
- } else {
- return this.text.toLowerCase().startsWith(text.toLowerCase());
- }
- }
-
- public String stringValue() {
- return isEmpty() ? "" : text;
- }
-
- public Title title() {
- return new Title(stringValue());
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/TextStringTests.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/TextStringTests.java b/framework/applib/src/main/src-archived/old-valueholders/TextStringTests.java
deleted file mode 100644
index 0e6af17..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/TextStringTests.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-public class TextStringTests extends ValueTestCase {
- public static void main(final String[] args) {
- junit.textui.TestRunner.run(TextStringTests.class);
- }
-
- public void testInvalidCharacters() {
- try {
- TextString t = new TextString();
- t.setValue("Hello\nYou");
- fail("Exception expected");
- } catch (RuntimeException expected) {}
- try {
- new TextString("Hello\nYou");
- fail("Exception expected");
- } catch (RuntimeException expected) {}
- }
-
- public void testValidCharacters() {
- String text = "Hello You";
- TextString t = new TextString(text);
- assertEquals(text, t.title().toString());
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/Time.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/Time.java b/framework/applib/src/main/src-archived/old-valueholders/Time.java
deleted file mode 100644
index d3f7d42..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/Time.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.ApplicationException;
-import org.apache.isis.application.BusinessObject;
-import org.apache.isis.application.Clock;
-import org.apache.isis.application.Title;
-import org.apache.isis.application.value.ValueParseException;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * Value object representing a time value.
- * <p>
- * NOTE: this class currently does not support about listeners
- * </p>
- */
-
-/*
- * other methods to implement
- *
- * comparision methods
- *
- * sameHourAs() hour ==hour sameMinuteAs() minutes = minutes sameTimeAs(hour, min) hour == hour & minutes ==
- * minutes
- *
- * withinNextTimePeriod(int hours, int minutes); withinTimePeriod(Date d, int hours, int minutes);
- * withinPreviousTimePeriod(int hours, int minutes); d.hour >= this.hour >= d.hour + hours & d.minutes >=
- * this.minutes >= d.minutes + minutes
- */
-public class Time extends Magnitude {
- private static Clock clock;
- private static final DateFormat ISO_LONG = new SimpleDateFormat("HH:mm");
- private static final DateFormat ISO_SHORT = new SimpleDateFormat("HHmm");
- private static final Logger LOG = Logger.getLogger(Time.class);
- private static final DateFormat LONG_FORMAT = DateFormat.getTimeInstance(DateFormat.LONG);
- private static final DateFormat MEDIUM_FORMAT = DateFormat.getTimeInstance(DateFormat.MEDIUM);
- public static final int MINUTE = 60;
- public static final int HOUR = 60 * MINUTE;
- public static final int DAY = 24 * HOUR;
- private static final long serialVersionUID = 1L;
- private static final DateFormat SHORT_FORMAT = DateFormat.getTimeInstance(DateFormat.SHORT);
- private static final TimeZone timeZone;
- private final static long zero;
-
- static {
- timeZone = TimeZone.getTimeZone("GMT");
- ISO_LONG.setTimeZone(timeZone);
- ISO_SHORT.setTimeZone(timeZone);
- LONG_FORMAT.setTimeZone(timeZone);
- MEDIUM_FORMAT.setTimeZone(timeZone);
- SHORT_FORMAT.setTimeZone(timeZone);
-
- ISO_LONG.setLenient(false);
- ISO_SHORT.setLenient(false);
- LONG_FORMAT.setLenient(false);
- MEDIUM_FORMAT.setLenient(false);
- SHORT_FORMAT.setLenient(false);
-
- Calendar cal = Calendar.getInstance();
- cal.setTimeZone(timeZone);
- // set to 1-Jan-1970 00:00:00 (the epoch)
- cal.set(Calendar.MILLISECOND, 0);
- cal.set(Calendar.SECOND, 0);
- cal.set(Calendar.MINUTE, 0);
- cal.set(Calendar.HOUR_OF_DAY, 0);
- cal.clear(Calendar.AM_PM);
- cal.clear(Calendar.HOUR);
- cal.set(Calendar.DAY_OF_MONTH, 1);
- cal.set(Calendar.MONTH, 0);
- cal.set(Calendar.YEAR, 1970);
- zero = cal.getTime().getTime();
-
- LOG.debug("locale " + Locale.getDefault());
- LOG.debug("short fomat " + SHORT_FORMAT.format(new Date()));
- LOG.debug("medium fomat " + MEDIUM_FORMAT.format(new Date()));
- LOG.debug("long fomat " + LONG_FORMAT.format(new Date()));
- }
-
- static long getZero() {
- return zero / 1000;
- }
-
- public static void setClock(final Clock clock) {
- Time.clock = clock;
- }
-
- private java.util.Date date;
-
- /*
- * Create a Time object for storing a time with the time set to the current time.
- */
- public Time() {
- this((BusinessObject) null);
- }
-
- /*
- * Create a Time object for storing a time with the time set to the specified hours and minutes.
- */
- public Time(final int hour, final int minute) {
- this(null, hour, minute);
- }
-
- /*
- * Create a Time object for storing a time with the time set to the specified time.
- */
- public Time(final Time time) {
- this(null, time);
- }
-
- /*
- * Create a Time object for storing a time with the time set to the current time.
- */
- public Time(final BusinessObject parent) {
- super(parent);
- if (clock == null) {
- throw new ApplicationException("Clock not set up");
- }
- setValue(new java.util.Date(clock.getTime()));
- }
-
- /*
- * Create a Time object for storing a time with the time set to the specified hours and minutes.
- */
- public Time(final BusinessObject parent, final int hour, final int minute) {
- super(parent);
- setValue(hour, minute);
- }
-
- /*
- * Create a Time object for storing a time with the time set to the specified time.
- */
- public Time(final BusinessObject parent, final Time time) {
- super(parent);
- date = time.date;
- }
-
- /**
- * Add the specified hours and minutes to this time value.
- */
- public void add(final int hours, final int minutes) {
- Calendar cal = Calendar.getInstance();
-
- cal.setTime(date);
- cal.add(Calendar.MINUTE, minutes);
- cal.add(Calendar.HOUR_OF_DAY, hours);
- setValuesInternal(cal, true);
- }
-
- public Calendar calendarValue() {
- ensureAtLeastPartResolved();
- if (date == null) {
- return null;
- }
-
- Calendar c = Calendar.getInstance();
- c.setTimeZone(timeZone);
- c.setTime(date);
-
- return c;
- }
-
- private void checkTime(final int hour, final int minute, final int second) {
- if ((hour < 0) || (hour > 23)) {
- throw new IllegalArgumentException("Hour must be in the range 0 - 23 inclusive");
- }
-
- if ((minute < 0) || (minute > 59)) {
- throw new IllegalArgumentException("Minute must be in the range 0 - 59 inclusive");
- }
-
- if ((second < 0) || (second > 59)) {
- throw new IllegalArgumentException("Second must be in the range 0 - 59 inclusive");
- }
- }
-
- public void clear() {
- setValuesInternal((Date) null, true);
- }
-
- public void copyObject(final BusinessValueHolder object) {
- if (object == null) {
- clear();
- } else if (!(object instanceof Time)) {
- throw new IllegalArgumentException("Can only copy the value of a Date object");
- } else {
- setValue((Time) object);
- }
- }
-
- /**
- * Returns a Calendar object with the irrelevant field (determined by this objects type) set to zero.
- */
- private Calendar createCalendar() {
- Calendar cal = Calendar.getInstance();
- cal.setTimeZone(timeZone);
-
- // clear all aspects of the time that are not used
- cal.set(Calendar.MILLISECOND, 0);
- cal.set(Calendar.SECOND, 0);
- cal.set(Calendar.DAY_OF_MONTH, 1);
- cal.clear(Calendar.AM_PM);
- cal.clear(Calendar.HOUR);
- cal.set(Calendar.MONTH, 0);
- cal.set(Calendar.YEAR, 1970);
-
- return cal;
- }
-
- public java.util.Date dateValue() {
- ensureAtLeastPartResolved();
- return (date == null) ? null : date;
- }
-
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof Time)) {
- return false;
- }
- Time object = (Time) obj;
- if (object.isEmpty() && isEmpty()) {
- return true;
- }
- return object.date.equals(date);
- }
-
- /**
- * @deprecated replaced by dateValue
- * @see #dateValue
- */
- public java.util.Date getDate() {
- ensureAtLeastPartResolved();
- return date;
- }
-
- public int getHour() {
- ensureAtLeastPartResolved();
- Calendar c = Calendar.getInstance();
- c.setTimeZone(timeZone);
- c.setTime(date);
- return c.get(Calendar.HOUR);
- }
-
- public int getMinute() {
- ensureAtLeastPartResolved();
- Calendar c = Calendar.getInstance();
- c.setTimeZone(timeZone);
- c.setTime(date);
- return c.get(Calendar.MINUTE);
- }
-
- /**
- * Return true if the date is blank
- */
- public boolean isEmpty() {
- ensureAtLeastPartResolved();
- return date == null;
- }
-
- /**
- * returns true if the time of this object has the same value as the specified time
- */
- public boolean isEqualTo(final Magnitude time) {
- ensureAtLeastPartResolved();
- if (time instanceof Time) {
- return (date == null) ? false : (date.equals(((Time) time).date));
- } else {
- throw new IllegalArgumentException("Parameter must be of type Time");
- }
- }
-
- /**
- * returns true if the time of this object is earlier than the specified time
- */
- public boolean isLessThan(final Magnitude time) {
- ensureAtLeastPartResolved();
- if (time instanceof Time) {
- return (date != null) && !time.isEmpty() && date.before(((Time) time).date);
- } else {
- throw new IllegalArgumentException("Parameter must be of type Time");
- }
- }
-
- /**
- * The number of seconds since midnight.
- */
- public long longValue() {
- ensureAtLeastPartResolved();
- return date.getTime() / 1000;
- }
-
- public void parseUserEntry(final String entry) throws ValueParseException {
- if (entry.trim().equals("")) {
- clear();
- } else {
- String text = entry.trim();
-
- String str = text.toLowerCase();
- Calendar cal = createCalendar();
-
- if (str.equals("now")) {} else if (str.startsWith("+")) {
- int hours;
-
- hours = Integer.valueOf(str.substring(1)).intValue();
- cal.setTime(date);
- cal.add(Calendar.HOUR_OF_DAY, hours);
- } else if (str.startsWith("-")) {
- int hours;
-
- hours = Integer.valueOf(str.substring(1)).intValue();
- cal.setTime(date);
- cal.add(Calendar.HOUR_OF_DAY, -hours);
- } else {
- DateFormat[] formats = new DateFormat[] { LONG_FORMAT, MEDIUM_FORMAT, SHORT_FORMAT, ISO_LONG, ISO_SHORT };
-
- for (int i = 0; i < formats.length; i++) {
- try {
- cal.setTime(formats[i].parse(text));
-
- break;
- } catch (ParseException e) {
- if ((i + 1) == formats.length) {
- throw new ValueParseException("Invalid time '" + text + "' for locale " + Locale.getDefault(), e);
- }
- }
- }
- }
-
- setValuesInternal(cal, true);
- }
- }
-
- /**
- * Reset this time so it contains the current time.
- *
- *
- */
- public void reset() {
- setValue(new Date(clock.getTime()));
- }
-
- public void restoreFromEncodedString(final String data) {
- if (data == null || data.equals("NULL")) {
- setValuesInternal((Date) null, false);
- } else {
- int hour = Integer.valueOf(data.substring(0, 2)).intValue();
- int minute = Integer.valueOf(data.substring(2)).intValue();
- setValue(hour, minute);
- setValuesInternal(hour, minute, false);
- }
- }
-
- public String asEncodedString() {
- Calendar cal = calendarValue();
-
- if (cal == null) {
- return "NULL";
- } else {
- StringBuffer data = new StringBuffer(4);
- int hour = cal.get(Calendar.HOUR_OF_DAY);
- data.append((hour <= 9) ? "0" : "");
- data.append(hour);
-
- int minute = cal.get(Calendar.MINUTE);
- data.append((minute <= 9) ? "0" : "");
- data.append(minute);
-
- return data.toString();
- }
- }
-
- /*
- * Sets this object's time to be the same as the specified hour, minute and second.
- */
- public void setValue(final int hour, final int minute) {
- setValuesInternal(hour, minute, true);
- }
-
- public void setValue(final java.util.Date date) {
- if (date == null) {
- setValuesInternal((Date) null, true);
- } else {
- Calendar cal = Calendar.getInstance();
-
- cal.setTime(date);
- setValuesInternal(cal, true);
- }
- }
-
- public void setValue(final long time) {
- Calendar cal = Calendar.getInstance();
-
- cal.setTime(new Date(time * 1000));
- setValuesInternal(cal, true);
- }
-
- public void setValue(final Time time) {
- if (time == null || time.date == null) {
- setValuesInternal((Date) null, true);
- } else {
- setValuesInternal(new Date(time.date.getTime()), true);
- }
- }
-
- private void setValuesInternal(final int hour, final int minute, final boolean notify) {
- checkTime(hour, minute, 0);
-
- Calendar cal = createCalendar();
- cal.setTimeZone(timeZone);
- cal.set(Calendar.HOUR_OF_DAY, hour);
- cal.set(Calendar.MINUTE, minute);
- setValuesInternal(cal, notify);
- }
-
- private void setValuesInternal(final Calendar cal, final boolean notify) {
- cal.set(Calendar.MILLISECOND, 0);
- cal.set(Calendar.SECOND, 0);
- cal.set(Calendar.DAY_OF_MONTH, 1);
- cal.set(Calendar.MONTH, 0);
- cal.set(Calendar.YEAR, 1970);
- setValuesInternal(cal.getTime(), notify);
- }
-
- private void setValuesInternal(final java.util.Date date, final boolean notify) {
- if (notify) {
- ensureAtLeastPartResolved();
- }
- this.date = date;
- if (notify) {
- parentChanged();
- }
- }
-
- public Title title() {
- ensureAtLeastPartResolved();
- return new Title((date == null) ? "" : SHORT_FORMAT.format(date));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/TimePeriod.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/TimePeriod.java b/framework/applib/src/main/src-archived/old-valueholders/TimePeriod.java
deleted file mode 100644
index ccf5575..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/TimePeriod.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.BusinessObject;
-import org.apache.isis.application.Title;
-import org.apache.isis.application.value.ValueParseException;
-
-
-public class TimePeriod extends BusinessValueHolder {
- private final Time end = new Time();
- private final Time start = new Time();
-
- public TimePeriod() {
- this((BusinessObject) null);
- }
-
- public TimePeriod(final TimePeriod existing) {
- this(null, existing);
- }
-
- public TimePeriod(final BusinessObject parent) {
- super(parent);
- clear();
- }
-
- public TimePeriod(final BusinessObject parent, final TimePeriod existing) {
- super(parent);
- setValue(existing);
- }
-
- public void clear() {
- clearInternal(true);
- }
-
- private void clearInternal(final boolean notify) {
- if (notify) {
- ensureAtLeastPartResolved();
- }
- start.clear();
- end.clear();
- if (notify) {
- parentChanged();
- }
- }
-
- public void copyObject(final BusinessValueHolder object) {
- if (!(object instanceof TimePeriod)) {
- throw new IllegalArgumentException("Can only copy the value of a TimePeriod object");
- }
-
- TimePeriod tp = (TimePeriod) object;
-
- if (tp.isEmpty()) {
- clear();
- } else {
- setValue(tp);
- }
- }
-
- public boolean endsAfter(final TimePeriod arg) {
- ensureAtLeastPartResolved();
- if (end.isGreaterThan(arg.getEnd())) {
- return true;
- } else {
- return false;
- }
- }
-
- public boolean entirelyContains(final TimePeriod arg) {
- ensureAtLeastPartResolved();
- return arg.getStart().isBetween(start, end) && arg.getEnd().isBetween(start, end);
- }
-
- public Time getEnd() {
- ensureAtLeastPartResolved();
- return end;
- }
-
- public Time getStart() {
- ensureAtLeastPartResolved();
- return start;
- }
-
- public boolean isEmpty() {
- ensureAtLeastPartResolved();
- return (start.isEmpty()) && (end.isEmpty());
- }
-
- public boolean isEqualTo(final TimePeriod arg) {
- ensureAtLeastPartResolved();
- if (start.isEqualTo(arg.getStart()) && end.isEqualTo(arg.getEnd())) {
- return true;
- } else {
- return false;
- }
- }
-
- public boolean isSameAs(final BusinessValueHolder object) {
- ensureAtLeastPartResolved();
- if (object instanceof TimePeriod) {
- TimePeriod tp = (TimePeriod) object;
-
- return (start.isEqualTo(tp.getStart())) && (end.isEqualTo(tp.getEnd()));
- } else {
- return false;
- }
- }
-
- public TimePeriod leadDifference(final TimePeriod arg) {
- TimePeriod lead = new TimePeriod();
-
- if (this.startsBefore(arg)) {
- lead.getStart().setValue(start);
- lead.getEnd().setValue(arg.getStart());
- } else {
- lead.getStart().setValue(arg.getStart());
- lead.getEnd().setValue(start);
- }
-
- return lead;
- }
-
- public TimePeriod overlap(final TimePeriod arg) {
- TimePeriod overlap = new TimePeriod();
- overlap.clear();
-
- if (this.overlaps(arg)) {
- if (arg.getStart().isGreaterThan(start)) {
- overlap.getStart().setValue(arg.getStart());
- } else {
- overlap.getStart().setValue(this.start);
- }
-
- if (arg.getEnd().isLessThan(end)) {
- overlap.getEnd().setValue(arg.getEnd());
- } else {
- overlap.getEnd().setValue(this.end);
- }
- }
-
- // N.B. If no overlap currently creates empty TimePeriod.
- return overlap;
- }
-
- public boolean overlaps(final TimePeriod arg) {
- ensureAtLeastPartResolved();
- if (end.isGreaterThan(arg.getStart()) && start.isLessThan(arg.getEnd())) {
- return true;
- } else {
- return false;
- }
- }
-
- public void parseUserEntry(final String text) throws ValueParseException {
- if (text.trim().equals("")) {
- clear();
- } else {
- int tilde = text.indexOf("~");
-
- Time st = new Time();
- Time et = new Time();
- if (tilde >= 0) {
- st.parseUserEntry(text.substring(0, tilde).trim());
- et.parseUserEntry(text.substring(tilde + 1).trim());
- } else {
- // Not sure how to specify the type of the Exception
- throw new ValueParseException("No tilde found", new Exception());
- }
-
- if (et.isLessThan(st)) {
- throw new ValueParseException("End time before start time", new Exception());
- }
- setValue(st, et);
- }
- }
-
- public void reset() {
- ensureAtLeastPartResolved();
- start.reset();
- end.reset();
- parentChanged();
- }
-
- public void restoreFromEncodedString(final String data) {
- if (data == null || data.equals("NULL")) {
- clearInternal(false);
- } else {
- start.restoreFromEncodedString(data.substring(0, 3));
- end.restoreFromEncodedString(data.substring(4, 7));
- }
- }
-
- public String asEncodedString() {
- ensureAtLeastPartResolved();
- if (start.isEmpty() || end.isEmpty()) {
- return "NULL";
- } else {
- StringBuffer data = new StringBuffer(8);
- data.append(start.asEncodedString());
- data.append(end.asEncodedString());
-
- return data.toString();
- }
- }
-
- public void setValue(final Time start, final Time end) {
- ensureAtLeastPartResolved();
- this.start.setValue(start);
- this.end.setValue(end);
- parentChanged();
- }
-
- public void setValue(final TimePeriod t) {
- setValue(t.getStart(), t.getEnd());
- }
-
- public boolean startsBefore(final TimePeriod arg) {
- ensureAtLeastPartResolved();
- if (start.isLessThan(arg.getStart())) {
- return true;
- } else {
- return false;
- }
- }
-
- public TimePeriod tailDifference(final TimePeriod arg) {
- TimePeriod tail = new TimePeriod();
-
- if (this.endsAfter(arg)) {
- tail.getStart().setValue(arg.getEnd());
- tail.getEnd().setValue(end);
- } else {
- tail.getStart().setValue(end);
- tail.getEnd().setValue(arg.getEnd());
- }
-
- return tail;
- }
-
- public Title title() {
- Title t = new Title(getStart() == null ? "" : getStart().title().toString());
- t.append("~");
- t.append(getEnd() == null ? "" : getEnd().title().toString());
-
- return t;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/TimePeriodTest.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/TimePeriodTest.java b/framework/applib/src/main/src-archived/old-valueholders/TimePeriodTest.java
deleted file mode 100644
index 651ec7e..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/TimePeriodTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.value.ValueParseException;
-
-import java.util.Locale;
-
-
-public class TimePeriodTest extends ValueTestCase {
- static {
- Locale.setDefault(Locale.UK);
- }
-
- private TimePeriod tp1;
- private TimePeriod tp2;
- private TimePeriod tp3;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- tp1 = new TimePeriod();
- tp2 = new TimePeriod();
- tp3 = new TimePeriod();
- }
-
- protected void tearDown() throws Exception {
- tp1 = null;
- }
-
- public void testClear() {
- tp1.clear();
- assertTrue(tp1.title().toString().equals("~"));
- assertTrue(tp1.isEmpty());
- }
-
- public void testOverlaps() throws Exception {
- tp1.parseUserEntry("09:00 ~ 17:00");
- tp2.parseUserEntry("11:00 ~ 18:00");
- assertTrue(tp1.overlaps(tp2));
- assertTrue(tp1.startsBefore(tp2));
- assertFalse(tp2.startsBefore(tp1));
- assertTrue(tp2.endsAfter(tp1));
- assertFalse(tp1.endsAfter(tp2));
- tp3 = tp1.overlap(tp2);
- assertTrue(tp3.title().toString().equals("11:00 ~ 17:00"));
- tp3 = tp1.leadDifference(tp2);
- assertTrue(tp3.title().toString().equals("09:00 ~ 11:00"));
- tp3 = tp2.leadDifference(tp1);
- assertTrue(tp3.title().toString().equals("09:00 ~ 11:00"));
- tp3 = tp1.tailDifference(tp2);
- assertTrue(tp3.title().toString().equals("17:00 ~ 18:00"));
- tp3 = tp2.tailDifference(tp1);
- assertTrue(tp3.title().toString().equals("17:00 ~ 18:00"));
-
- tp1.parseUserEntry("09:00 ~ 13:00");
- tp2.parseUserEntry("14:00 ~ 18:00");
- assertFalse(tp1.overlaps(tp2));
- assertFalse(tp2.overlaps(tp1));
-
- tp1.parseUserEntry("09:00 ~ 13:00");
- tp2.parseUserEntry("13:00 ~ 18:00");
- assertFalse(tp1.overlaps(tp2));
- assertFalse(tp2.overlaps(tp1));
-
- tp1.parseUserEntry("~17:00");
- tp2.parseUserEntry("15:15~");
-
- // May want to revise code to make following assertion true.
- assertFalse(tp2.overlaps(tp1));
- tp3 = tp1.overlap(tp2);
- assertTrue(tp3.title().toString().equals("~"));
- }
-
- public void testParse() throws Exception {
- tp1.parseUserEntry("09:00 ~ 17:00");
- assertEquals(Time.HOUR * 9, tp1.getStart().longValue());
- assertEquals(Time.HOUR * 17, tp1.getEnd().longValue());
- tp1.parseUserEntry("11:00 ~ 13:15");
- assertEquals("11:00 ~ 13:15", tp1.title().toString());
- tp1.parseUserEntry("7:00~19:12");
- assertEquals("07:00 ~ 19:12", tp1.title().toString());
-
- try {
- tp1.parseUserEntry("hgjuiy");
- fail();
- } catch (ValueParseException expected) {}
-
- try {
- tp1.parseUserEntry("8:16 09:00");
- fail();
- } catch (ValueParseException expected) {}
-
- try {
- tp1.parseUserEntry("rtyu~ghjk");
- fail();
- } catch (ValueParseException expected) {}
-
- try {
- tp1.parseUserEntry("13:05 ~ 13:01");
- fail();
- } catch (ValueParseException e) {
- assertTrue(e.getMessage().equals("End time before start time"));
- }
-
- tp1.parseUserEntry("13:05~");
- assertTrue(tp1.title().toString().equals("13:05 ~"));
- tp1.parseUserEntry("~19:15 ");
- assertTrue(tp1.title().toString().equals("~ 19:15"));
- }
-
- public void testSaveAndRestore() throws Exception {
- tp1.parseUserEntry("09:00 ~ 17:00");
-
- String s = tp1.asEncodedString();
- assertTrue(s.equals("09001700"));
- tp2.restoreFromEncodedString(s);
- assertTrue(tp2.title().toString().equals("09:00 ~ 17:00"));
- assertTrue(tp2.isSameAs(tp1));
- }
-
- public void testSaveStringLength() {
- tp1.reset();
- assertTrue(tp1.asEncodedString().length() == 8);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/TimeStamp.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/TimeStamp.java b/framework/applib/src/main/src-archived/old-valueholders/TimeStamp.java
deleted file mode 100644
index 024881e..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/TimeStamp.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.ApplicationException;
-import org.apache.isis.application.BusinessObject;
-import org.apache.isis.application.Clock;
-import org.apache.isis.application.Title;
-import org.apache.isis.application.value.ValueParseException;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-
-/**
- * Value object representing a date and time value.
- * <p>
- * NOTE: this class currently does not support about listeners
- * </p>
- */
-public class TimeStamp extends Magnitude {
- // TODO check the ISO representations
- private static final DateFormat ISO_LONG = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
- // private static final DateFormat ISO_SHORT = new SimpleDateFormat("yyyyMMdd'T'HHmmssSSS");
-
- private boolean isNull = true;
- private java.util.Date date;
- private static Clock clock;
-
- public static void setClock(final Clock clock) {
- TimeStamp.clock = clock;
- }
-
- /**
- * Create a Time object for storing a timeStamp set to the current time.
- */
- public TimeStamp() {
- this((BusinessObject) null);
- }
-
- /**
- * Create a Time object for storing a timeStamp set to the specified time.
- */
- public TimeStamp(final TimeStamp timeStamp) {
- this(null, timeStamp);
- }
-
- /**
- * Create a Time object for storing a timeStamp set to the current time.
- */
- public TimeStamp(final BusinessObject parent) {
- super(parent);
- if (clock == null) {
- throw new ApplicationException("Clock not set up");
- }
- reset();
- }
-
- /**
- * Create a Time object for storing a timeStamp set to the specified time.
- */
- public TimeStamp(final BusinessObject parent, final TimeStamp timeStamp) {
- super(parent);
- date = timeStamp.date;
- isNull = timeStamp.isNull;
- }
-
- public void clear() {
- setValuesInternal(date, true, true);
- }
-
- public void copyObject(final BusinessValueHolder object) {
- if (!(object instanceof TimeStamp)) {
- throw new IllegalArgumentException("Can only copy the value of a TimeStamp object");
- }
- TimeStamp ts = (TimeStamp) object;
- setValuesInternal(ts.date, ts.isNull, true);
- }
-
- /**
- * Returns a Calendar object with the irrelevant field (determined by this objects type) set to zero.
- */
- private Calendar createCalendar() {
- Calendar cal = Calendar.getInstance();
- return cal;
- }
-
- public java.util.Date dateValue() {
- ensureAtLeastPartResolved();
- return isNull ? null : date;
- }
-
- /**
- * Return true if the time stamp is blank
- */
- public boolean isEmpty() {
- ensureAtLeastPartResolved();
- return isNull;
- }
-
- /**
- * returns true if the time stamp of this object has the same value as the specified time
- */
- public boolean isEqualTo(final Magnitude timeStamp) {
- ensureAtLeastPartResolved();
- if (timeStamp instanceof TimeStamp) {
- if (isNull) {
- return timeStamp.isEmpty();
- }
-
- return this.date.equals(((TimeStamp) timeStamp).date);
- } else {
- throw new IllegalArgumentException("Parameter must be of type Time");
- }
- }
-
- /**
- * returns true if the timeStamp of this object is earlier than the specified timeStamp
- */
- public boolean isLessThan(final Magnitude timeStamp) {
- ensureAtLeastPartResolved();
- if (timeStamp instanceof TimeStamp) {
- return !isNull && !timeStamp.isEmpty() && date.before(((TimeStamp) timeStamp).date);
- } else {
- throw new IllegalArgumentException("Parameter must be of type Time");
- }
- }
-
- public long longValue() {
- ensureAtLeastPartResolved();
- return date.getTime();
- }
-
- public void parseUserEntry(final String text) throws ValueParseException {}
-
- /**
- * Reset this time so it contains the current time.
- */
- public void reset() {
- setValuesInternal(new Date(clock.getTime()), false, true);
- }
-
- private void setValuesInternal(final java.util.Date value, final boolean isNull, final boolean notify) {
- if (notify) {
- ensureAtLeastPartResolved();
- }
- this.date = value;
- this.isNull = isNull;
- if (notify) {
- parentChanged();
- }
- }
-
- public Title title() {
- ensureAtLeastPartResolved();
- return new Title(isNull ? "" : ISO_LONG.format(date));
- }
-
- public Calendar calendarValue() {
- ensureAtLeastPartResolved();
- if (isNull) {
- return null;
- }
-
- Calendar c = Calendar.getInstance();
- c.setTime(date);
-
- return c;
- }
-
- public void restoreFromEncodedString(final String data) {
- if (data == null || data.equals("NULL")) {
- setValuesInternal(date, true, false);
- } else {
- int year = Integer.valueOf(data.substring(0, 4)).intValue();
- int month = Integer.valueOf(data.substring(4, 6)).intValue();
- int day = Integer.valueOf(data.substring(6, 8)).intValue();
- int hour = Integer.valueOf(data.substring(8, 10)).intValue();
- int minute = Integer.valueOf(data.substring(10, 12)).intValue();
- int second = Integer.valueOf(data.substring(12, 14)).intValue();
- int millisecond = Integer.valueOf(data.substring(14, 17)).intValue();
-
- Calendar cal = createCalendar();
-
- cal.set(Calendar.DAY_OF_MONTH, day);
- cal.set(Calendar.MONTH, month - 1);
- cal.set(Calendar.YEAR, year);
- cal.set(Calendar.HOUR_OF_DAY, hour);
- cal.set(Calendar.MINUTE, minute);
- cal.set(Calendar.SECOND, second);
- cal.set(Calendar.MILLISECOND, millisecond);
- setValuesInternal(cal.getTime(), false, true);
- }
- }
-
- public String asEncodedString() {
- if (isEmpty()) {
- return "NULL";
- } else {
- Calendar cal = calendarValue();
- StringBuffer data = new StringBuffer(8);
- String year = String.valueOf(cal.get(Calendar.YEAR));
- data.append("0000".substring(0, 4 - year.length()));
- data.append(year);
-
- int month = cal.get(Calendar.MONTH) + 1;
- data.append((month <= 9) ? "0" : "");
- data.append(month);
-
- int day = cal.get(Calendar.DAY_OF_MONTH);
- data.append((day <= 9) ? "0" : "");
- data.append(day);
-
- int hour = cal.get(Calendar.HOUR_OF_DAY);
- data.append((hour <= 9) ? "0" : "");
- data.append(hour);
-
- int minute = cal.get(Calendar.MINUTE);
- data.append((minute <= 9) ? "0" : "");
- data.append(minute);
-
- int second = cal.get(Calendar.SECOND);
- data.append((second <= 9) ? "0" : "");
- data.append(second);
-
- int millisecond = cal.get(Calendar.MILLISECOND);
- data.append((millisecond <= 99) ? "0" : "");
- data.append((millisecond <= 9) ? "0" : "");
- data.append(millisecond);
-
- return data.toString();
- }
- }
-
- public String toString() {
- return title() + " " + longValue() + " [TimeStamp]";
- }
-
- public void setValue(final TimeStamp ts) {
- if ((ts == null)) {
- this.clear();
- } else {
- setValuesInternal(ts.date, ts.isNull, true);
- }
- }
-
- public void setValue(final java.util.Date date) {
- setValuesInternal(date, date == null, true);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/TimeTests.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/TimeTests.java b/framework/applib/src/main/src-archived/old-valueholders/TimeTests.java
deleted file mode 100644
index 5625a43..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/TimeTests.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.value.ValueParseException;
-
-
-public class TimeTests extends ValueTestCase {
- private Time t;
-
- public void testTimeConstructors() {
- assertEquals("Two identically created objects", t.dateValue(), new Time(10, 40).dateValue());
- assertEquals("One object created from another", t.dateValue(), new Time(t).dateValue());
- }
-
- public void testSetTime() {
- Time t2 = new Time();
- t2.setValue(10, 40);
- assertEquals("Set with values", t.dateValue(), t2.dateValue());
- Time t3 = new Time();
- t3.setValue(10, 40);
- assertEquals("Set with values", t.dateValue(), t3.dateValue());
- }
-
- public void testGetHour() {
- assertEquals(10, t.getHour());
- }
-
- public void testGetMinute() {
- assertEquals(40, t.getMinute());
- }
-
- public void testZero() {
- assertEquals("Zero value", 0, Time.getZero());
- }
-
- public void testGetValue() {
- Time t2 = new Time(0, 0);
- assertEquals("new zero value time", 0, t2.longValue());
-
- t2 = new Time();
- t2.setValue(0, 0);
- assertEquals("set to zero", 0, t2.longValue());
-
- Time t3 = new Time(0, 1);
- assertEquals(t2.longValue() + 60, t3.longValue());
-
- assertEquals(10 * 3600 + 40 * 60, t.longValue());
- }
-
- public void testClear() {
- assertTrue("After creation should not be empty", !t.isEmpty());
- t.clear();
- assertTrue("After clear should be empty", t.isEmpty());
- }
-
- public void testDefaultTime() throws InterruptedException {
- Time t1 = new Time();
- assertEquals("temp", t1.dateValue(), new Time().dateValue());
- }
-
- public void testParseTime() throws ValueParseException {
- t.parseUserEntry("0:00");
- assertEquals("00:00", 0, t.longValue());
-
- t.parseUserEntry("0:01");
- assertEquals("00:00", 60, t.longValue());
-
- t.parseUserEntry("11:35 AM");
- assertEquals("11:35", 11 * 3600 + 35 * 60, t.longValue());
-
- t.parseUserEntry("12:50");
- assertEquals("12:50", 12 * 3600 + 50 * 60, t.longValue());
-
- t.parseUserEntry("14:45");
- assertEquals("14:45", 14 * 3600 + 45 * 60, t.longValue());
-
- t.parseUserEntry("22:55");
- assertEquals("22:55", 22 * 3600 + 55 * 60, t.longValue());
- t.parseUserEntry("23:00");
- assertEquals("23:00", 23 * 3600, t.longValue());
-
- t.parseUserEntry("23:59");
- assertEquals("23:59", 23 * 3600 + 59 * 60, t.longValue());
- }
-
- public void testIsEqualsTo() {
- Time t2 = new Time(0, 0);
- t.clear();
-
- assertTrue("When object is empty and is compared with non-empty", !t2.isEqualTo(t));
- assertTrue("When object is non-empty and is compared with empty", !t.isEqualTo(t2));
- t2.clear();
- assertTrue("When both objects are empty", !t.isEqualTo(t2));
-
- t.setValue(1, 15);
- t2.setValue(1, 00);
- assertTrue("When times are different", !t.isEqualTo(t2));
-
- t2.setValue(1, 15);
- assertTrue("When times are same", t.isEqualTo(t2));
- }
-
- public void testParseAdd() throws ValueParseException {
- assertEquals("10:40", 10 * 3600 + 40 * 60, t.longValue());
-
- t.parseUserEntry("+1");
- assertEquals("11:40", 11 * 3600 + 40 * 60, t.longValue());
-
- t.parseUserEntry("+1");
- assertEquals("12:40", 12 * 3600 + 40 * 60, t.longValue());
-
- t.parseUserEntry("+22");
- assertEquals("10:40", 10 * 3600 + 40 * 60, t.longValue());
-
- }
-
- public void testSave() throws Exception {
- assertEquals("1040", t.asEncodedString());
-
- t.setValue(6, 25);
- assertEquals("0625", t.asEncodedString());
-
- t.setValue(23, 55);
- assertEquals("2355", t.asEncodedString());
- }
-
- public void testSaveEmpty() throws Exception {
- t.clear();
- assertEquals("NULL", t.asEncodedString());
- }
-
- public void testRestore() {
- t.restoreFromEncodedString("0805");
- assertEquals(8 * 3600 + 5 * 60, t.longValue());
-
- t.restoreFromEncodedString("2359");
- assertEquals(23 * 3600 + 59 * 60, t.longValue());
- }
-
- public void testRestoreEmpty() {
- t.restoreFromEncodedString("NULL");
- assertTrue(t.isEmpty());
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- t = new Time(10, 40);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/URLString.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/URLString.java b/framework/applib/src/main/src-archived/old-valueholders/URLString.java
deleted file mode 100644
index 82afca7..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/URLString.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.BusinessObject;
-import org.apache.isis.application.Title;
-import org.apache.isis.application.value.ValueParseException;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-
-/**
- * value object to represent an URL.
- * <p>
- * NOTE: this class currently does not support about listeners
- * </p>
- */
-public class URLString extends BusinessValueHolder {
- private String urlString;
-
- public URLString() {
- this(null, "");
- }
-
- public URLString(final String urlString) {
- this(null, urlString);
- }
-
- public URLString(final URLString urlString) {
- this(null, urlString);
- }
-
- public URLString(final BusinessObject parent) {
- this(parent, "");
- }
-
- public URLString(final BusinessObject parent, final String urlString) {
- super(parent);
- this.urlString = urlString;
- }
-
- public URLString(final BusinessObject parent, final URLString urlString) {
- super(parent);
- this.urlString = new String(urlString.toString());
- }
-
- public void clear() {
- setValuesInternal(null, true);
- }
-
- /**
- * Copies the specified object's contained data to this instance. param object the object to copy the data
- * from
- */
- public void copyObject(final BusinessValueHolder object) {
- if (!(object instanceof URLString)) {
- throw new IllegalArgumentException("Can only copy the value of a URLString object");
- }
- setValue((URLString) object);
- }
-
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof URLString)) {
- return false;
- }
- URLString object = (URLString) obj;
- if (object.isEmpty() && isEmpty()) {
- return true;
- }
- return object.urlString.equals(urlString);
- }
-
- public String getObjectHelpText() {
- return "A URLString object.";
- }
-
- public boolean isEmpty() {
- ensureAtLeastPartResolved();
- return urlString == null;
- }
-
- /**
- * Compares the url string to see if the contain the same text if the specified object is a
- * <code>URLString</code> object else returns false.
- *
- * @see BusinessValueHolder#isSameAs(BusinessValueHolder)
- */
- public boolean isSameAs(final BusinessValueHolder object) {
- ensureAtLeastPartResolved();
- if (object instanceof URLString) {
- URLString other = (URLString) object;
- if (urlString == null) {
- return other.urlString == null;
- }
- return urlString.equals(other.urlString);
- } else {
- return false;
- }
-
- }
-
- public void parseUserEntry(final String urlString) throws ValueParseException {
- try {
- new URL(urlString);
- setValue(urlString);
- } catch (MalformedURLException e) {
- throw new ValueParseException("Invalid URL", e);
- }
- }
-
- /**
- * Reset this url string so it contains an empty string, i.e. "".
- */
- public void reset() {
- setValue("");
- }
-
- public void restoreFromEncodedString(final String data) {
- if (data == null || data.equals("NULL")) {
- setValuesInternal(null, false);
- } else {
- setValuesInternal(data, false);
- }
- }
-
- public String asEncodedString() {
- return isEmpty() ? "NULL" : urlString;
- }
-
- public void setValue(final String urlString) {
- setValuesInternal(urlString, true);
- }
-
- public void setValue(final URLString urlString) {
- setValuesInternal(urlString.urlString, true);
- }
-
- private void setValuesInternal(final String value, final boolean notify) {
- if (notify) {
- ensureAtLeastPartResolved();
- }
- this.urlString = value;
- if (notify) {
- parentChanged();
- }
- }
-
- public String stringValue() {
- ensureAtLeastPartResolved();
- return urlString;
- }
-
- public Title title() {
- ensureAtLeastPartResolved();
- return new Title(urlString);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/ValueTestCase.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/ValueTestCase.java b/framework/applib/src/main/src-archived/old-valueholders/ValueTestCase.java
deleted file mode 100644
index 0189d6f..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/ValueTestCase.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.system.TestClock;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-
-public abstract class ValueTestCase extends TestCase {
- protected void setUp() throws Exception {
- Logger.getRootLogger().setLevel(Level.OFF);
- // new MockObjectSpecificationLoader();
- new TestClock();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/WholeNumber.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/WholeNumber.java b/framework/applib/src/main/src-archived/old-valueholders/WholeNumber.java
deleted file mode 100644
index 7fda051..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/WholeNumber.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.BusinessObject;
-import org.apache.isis.application.Title;
-import org.apache.isis.application.value.ValueParseException;
-
-import java.text.NumberFormat;
-import java.text.ParseException;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * Value object to represent an integral number.
- * <p>
- * This object <i>does</i> support value listeners.
- * </p>
- */
-public class WholeNumber extends Magnitude {
- private static final NumberFormat FORMAT = NumberFormat.getNumberInstance();
- static {
- FORMAT.setParseIntegerOnly(true);
- }
- private int whole;
- private boolean isNull;
-
- /**
- * Creates a WholeNumber with zero value;
- */
- public WholeNumber() {
- this((BusinessObject) null);
- }
-
- /**
- * Creates a WholeNumber with the specified value;
- */
- public WholeNumber(final int whole) {
- this(null, whole);
- }
-
- /**
- * Creates a WholeNumber with parsed value from the specified text;
- *
- * @deprecated
- */
- public WholeNumber(final String text) {
- super(null);
- try {
- parseUserEntry(text);
- // isNull = false;
- } catch (ValueParseException ignore) {}
- }
-
- /**
- * Creates a WholeNumber with the same value as the specified object;
- */
- public WholeNumber(final WholeNumber wholeNumber) {
- this(null, wholeNumber);
- }
-
- /**
- * Creates a WholeNumber with zero value;
- */
- public WholeNumber(final BusinessObject parent) {
- super(parent);
- clear();
- }
-
- /**
- * Creates a WholeNumber with the specified value;
- */
- public WholeNumber(final BusinessObject parent, final int whole) {
- super(parent);
- setValue(whole);
- }
-
- /**
- * Creates a WholeNumber with the same value as the specified object;
- */
- public WholeNumber(final BusinessObject parent, final WholeNumber wholeNumber) {
- super(parent);
- setValue(wholeNumber);
- }
-
- public WholeNumber(final BusinessObject object, final long l) {
- this(object, (int) l);
- }
-
- /**
- * Adds the specified amount to this value.
- */
- public void add(final int whole) {
- if (this.isEmpty()) {
- return;
- }
- setValue(this.intValue() + whole);
- }
-
- /**
- * Adds the specified value to this value.
- */
- public void add(final WholeNumber whole) {
- if (whole == null || whole.isEmpty()) {
- return;
- }
- add(whole.whole);
- }
-
- public void clear() {
- setValuesInternal(0, true, true);
- }
-
- /**
- * returns the difference between this obect and the value: 0 means they are equal.
- */
- public int compareTo(final int value) {
- return intValue() - value;
- }
-
- public void copyObject(final BusinessValueHolder object) {
- if (!(object instanceof WholeNumber)) {
- throw new IllegalArgumentException("Can only copy the value of a WholeNumber object");
- }
- // isNull = ((WholeNumber) object).isNull;
- // whole = ((WholeNumber) object).whole;
- WholeNumber wholeNumber = (WholeNumber) object;
- setValue(wholeNumber);
- }
-
- /**
- * Divides this value by the specified amount.
- */
- public void divide(final int whole) {
- setValue(intValue() / whole);
- }
-
- /**
- * Divides this value by the specified amount.
- */
- public void divide(final double whole) {
- setValue((int) (intValue() / whole));
- }
-
- /**
- * Divides this value by the specified amount.
- */
- public void divide(final WholeNumber number) {
- if (number == null || number.isEmpty()) {
- return;
- }
- divide(number.whole);
- }
-
- /**
- * Returns this value as an double.
- */
- public double doubleValue() {
- ensureAtLeastPartResolved();
- return (double) whole;
- }
-
- public boolean equals(final Object object) {
- ensureAtLeastPartResolved();
- if (object instanceof WholeNumber) {
- return ((WholeNumber) object).whole == whole;
- }
- return super.equals(object);
- }
-
- /**
- * Returns this value as an float.
- */
- public float floatValue() {
- ensureAtLeastPartResolved();
- return (float) whole;
- }
-
- /**
- * Returns this value as an int.
- *
- * @deprecated
- * @see #intValue
- */
- public int getInt() {
- ensureAtLeastPartResolved();
- return whole;
- }
-
- public String getObjectHelpText() {
- return "A Whole Number object.";
- }
-
- /**
- * Returns this value as an int.
- */
- public int intValue() {
- ensureAtLeastPartResolved();
- return whole;
- }
-
- public boolean isEmpty() {
- ensureAtLeastPartResolved();
- return isNull;
- }
-
- /**
- * returns true if the number of this object has the same value as the specified number
- */
- public boolean isEqualTo(final Magnitude number) {
- ensureAtLeastPartResolved();
- if (number instanceof WholeNumber) {
- if (isNull) {
- return number.isEmpty();
- }
- return ((WholeNumber) number).whole == whole;
- } else {
- throw new IllegalArgumentException("Parameter must be of type WholeNumber");
- }
- }
-
- /**
- * Returns true if this value is less than the specified value.
- */
- public boolean isLessThan(final Magnitude value) {
- ensureAtLeastPartResolved();
- if (value instanceof WholeNumber) {
- return !isNull && !value.isEmpty() && whole < ((WholeNumber) value).whole;
- } else {
- throw new IllegalArgumentException("Parameter must be of type WholeNumber");
- }
- }
-
- /**
- * Returns true if this value is less than 0.
- */
- public boolean isNegative() {
- ensureAtLeastPartResolved();
- return whole < 0;
- }
-
- /**
- * Returns true if this value is 0.
- */
- public boolean isZero() {
- ensureAtLeastPartResolved();
- return whole == 0;
- }
-
- /**
- * Returns this value as an long.
- */
- public long longValue() {
- ensureAtLeastPartResolved();
- return (long) whole;
- }
-
- /**
- * Multiply this value by the specified amount.
- */
- public void multiply(final int whole) {
- setValue((int) (this.whole * whole));
- }
-
- /**
- * Multiply this value by the specified amount.
- */
- public void multiply(final WholeNumber number) {
- multiply(number.whole);
- }
-
- public void parseUserEntry(final String text) throws ValueParseException {
- if (text.trim().equals("")) {
- clear();
- } else {
- try {
- setValue(FORMAT.parse(text).intValue());
- } catch (ParseException e) {
- throw new ValueParseException("Invalid number", e);
- }
- }
- }
-
- /**
- * Reset this whole number so it contains 0.
- */
- public void reset() {
- setValue(0);
- }
-
- /**
- * Sets this value to be the specified value.
- */
- public void set(final int whole) {
- setValue(whole);
- }
-
- /**
- * Sets this value to be the same and specified value.
- *
- * @deprecated replaced by setValue
- */
- public void set(final WholeNumber value) {
- setValue(value.whole);
- }
-
- /**
- * Sets this value to be the specified value.
- *
- * @deprecated replaced by setValue
- */
- public void setInt(final int whole) {
- setValue(whole);
- }
-
- public void setValue(final int whole) {
- setValuesInternal(whole, false, true);
- }
-
- public void setValue(final WholeNumber value) {
- if (value.isEmpty()) {
- clear();
- } else {
- setValuesInternal(value.whole, value.isNull, true);
- }
- }
-
- private void setValuesInternal(final int value, final boolean isNull, final boolean notify) {
- if (notify) {
- ensureAtLeastPartResolved();
- }
- this.whole = value;
- this.isNull = isNull;
- if (notify) {
- parentChanged();
- }
- }
-
- /**
- * Returns this value as an short.
- */
- public short shortValue() {
- ensureAtLeastPartResolved();
- return (short) whole;
- }
-
- /**
- * Substracts the specified amount from this value.
- */
- public void subtract(final int whole) {
- add(-whole);
- }
-
- /**
- * Subtracts the specified amount from this value.
- */
- public void subtract(final WholeNumber number) {
- subtract(number.whole);
- }
-
- /**
- * if non-null, makes the value positive.
- */
- public void abs() {
- if (this.isEmpty()) {
- return;
- }
- setValue(Math.abs(this.intValue()));
- }
-
- public Title title() {
- ensureAtLeastPartResolved();
- return new Title(isNull ? "" : FORMAT.format(whole));
- }
-
- public void restoreFromEncodedString(final String data) {
- if (data == null || data.equals("NULL")) {
- setValuesInternal(0, true, false);
- } else {
- setValuesInternal(Integer.valueOf(data).intValue(), false, false);
- }
- }
-
- public String asEncodedString() {
- return isEmpty() ? "NULL" : String.valueOf(intValue());
- }
-
- protected Logger getLogger() {
- return logger;
- }
-
- private final static Logger logger = Logger.getLogger(WholeNumber.class);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/WholeNumberTests.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/WholeNumberTests.java b/framework/applib/src/main/src-archived/old-valueholders/WholeNumberTests.java
deleted file mode 100644
index ad2ac1c..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/WholeNumberTests.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.LogManager;
-
-
-public class WholeNumberTests extends ValueTestCase {
-
- public static void main(final String[] args) {
- LogManager.getLoggerRepository().setThreshold(Level.OFF);
- TestRunner.run(new TestSuite(WholeNumberTests.class));
- }
-
- public void testEquals() throws NoSuchMethodException {
- WholeNumber one = new WholeNumber(189);
- WholeNumber two = new WholeNumber(189);
- WholeNumber three = new WholeNumber(1890);
-
- assertEquals(one, two);
- assertEquals(two, one);
- assertTrue(!one.equals(three));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/main/src-archived/old-valueholders/XmlString.java
----------------------------------------------------------------------
diff --git a/framework/applib/src/main/src-archived/old-valueholders/XmlString.java b/framework/applib/src/main/src-archived/old-valueholders/XmlString.java
deleted file mode 100644
index 9b013e6..0000000
--- a/framework/applib/src/main/src-archived/old-valueholders/XmlString.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.isis.application.valueholder;
-
-import org.apache.isis.application.BusinessObject;
-
-
-public class XmlString extends MultilineTextString {
-
- public XmlString() {
- this(null);
- }
-
- public XmlString(final BusinessObject parent) {
- super(parent);
- }
-
- /**
- * Determines if the user can change this type of object: no in the case of XmlValues.
- */
- public boolean userChangeable() {
- return false;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/framework/applib/src/site/apt/index.apt b/framework/applib/src/site/apt/index.apt
deleted file mode 100644
index b869c46..0000000
--- a/framework/applib/src/site/apt/index.apt
+++ /dev/null
@@ -1,34 +0,0 @@
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-
-Application Library
-
- <Apache Isis> works using convention-over-configuration; you write
- your domain objects following a set of conventions, and these are interpreted
- by the framework in order to render, persist, remote or otherwise interact
- with your domain model.
-
- These conventions are together known as the <Apache Isis Programming Model>.
- The <Apache Isis Application Library> - or AppLib - constitutes those elements
- of the programming model that are declarative (such as annotations and
- interfaces). It also contains the <<<DomainObjectContainer>>> interface,
- which is normally injected into your domain objects and represents the
- only point of coupling from your domain into the framework.
-
- See the AppLib guide ({{{./docbkx/html/guide/isis-applib.html}HTML}}
- or {{{./docbkx/pdf/isis-applib.pdf}PDF}}) for further details.
-
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/site/apt/jottings.apt
----------------------------------------------------------------------
diff --git a/framework/applib/src/site/apt/jottings.apt b/framework/applib/src/site/apt/jottings.apt
deleted file mode 100644
index c5d1200..0000000
--- a/framework/applib/src/site/apt/jottings.apt
+++ /dev/null
@@ -1,24 +0,0 @@
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-
-
-
-Jottings
-
- This page is to capture any random jottings relating to this module prior
- to being moved into formal documentation.
-
http://git-wip-us.apache.org/repos/asf/isis/blob/dbb64345/framework/applib/src/site/site.xml
----------------------------------------------------------------------
diff --git a/framework/applib/src/site/site.xml b/framework/applib/src/site/site.xml
deleted file mode 100644
index c6037e2..0000000
--- a/framework/applib/src/site/site.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project>
-
- <body>
- <breadcrumbs>
- <item name="AppLib" href="index.html"/>
- </breadcrumbs>
-
- <menu name="Application Library">
- <item name="About" href="index.html" />
- </menu>
-
- <menu name="Documentation">
- <item name="${docbkxGuideTitle} (PDF)" href="docbkx/pdf/${docbkxGuideName}.pdf" />
- <item name="${docbkxGuideTitle} (HTML)" href="docbkx/html/guide/${docbkxGuideName}.html" />
- <!--
- to incorporate into docbkx
- <item name="Recognised Types" href="recognised-types.html" />
- <item name="Recognised Methods" href="recognised-methods.html" />
- <item name="Recognised Annotations" href="recognised-annotations.html" />
- <item name="Services" href="services.html" />
- <item name="Fixtures" href="fixtures.html" />
- <item name="Developing Domain Objects" href="developing-domain-objects.html" />
- -->
- </menu>
-
- <menu name="Maven Reports" ref="reports"/>
- </body>
-</project>