From: <dat...@us...> - 2003-02-17 18:36:33
|
Update of /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki In directory sc8-pr-cvs1:/tmp/cvs-serv5418/src/org/tcdi/opensource/wiki Modified Files: Tag: christian Wiki.java WikiData.java WikiPage.java Log Message: All changes since moving the wiki cvs from Eric's server to SF. Index: Wiki.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/Wiki.java,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** Wiki.java 18 Sep 2002 18:57:12 -0000 1.7.2.1 --- Wiki.java 17 Feb 2003 18:36:28 -0000 1.7.2.2 *************** *** 25,28 **** --- 25,33 ---- package org.tcdi.opensource.wiki; + import java.io.ByteArrayInputStream; + import java.io.FileInputStream; + import java.io.InputStream; + import java.util.*; + import org.opendoors.instant.vlh.VLHProvider; import org.opendoors.intf.QueueListener; [...1179 lines suppressed...] + } ! try { ! indexPage(page); ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! /** ! * Description of the Method ! * ! * @param user Description of the Parameter ! */ ! public void updateUser(WikiUser user) { ! _userStore.put(user.getIdentifier(), user); ! } } Index: WikiData.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/WikiData.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** WikiData.java 30 Sep 2001 08:28:27 -0000 1.1.1.1 --- WikiData.java 17 Feb 2003 18:36:28 -0000 1.1.1.1.2.1 *************** *** 1,41 **** ! /** ! * The contents of this file are subject to the Mozilla Public ! * License Version 1.1 (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.mozilla.org/MPL/ ! * ! * Software distributed under the License is distributed on an "AS ! * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or ! * implied. See the License for the specific language governing ! * rights and limitations under the License. ! * ! * The Original Code is Wiki. ! * ! * The Initial Developer of the Original Code is Technology Concepts ! * and Design, Inc. ! * Copyright (C) 2000 Technology Concepts and Design, Inc. All ! * Rights Reserved. ! * ! * Contributor(s): Lane Sharman (OpenDoors Software) ! * Justin Wells (Semiotek Inc.) ! * Eric B. Ridge (Technology Concepts and Design, Inc.) ! * ! * Alternatively, the contents of this file may be used under the ! * terms of the GNU General Public License Version 2 or later (the ! * "GPL"), in which case the provisions of the GPL are applicable ! * instead of those above. If you wish to allow use of your ! * version of this file only under the terms of the GPL and not to ! * allow others to use your version of this file under the MPL, ! * indicate your decision by deleting the provisions above and ! * replace them with the notice and other provisions required by ! * the GPL. If you do not delete the provisions above, a recipient ! * may use your version of this file under either the MPL or the ! * GPL. ! * ! * ! * This product includes sofware developed by OpenDoors Software. ! * ! * This product includes software developed by Justin Wells and Semiotek Inc. ! * for use in the WebMacro ServletFramework (http://www.webmacro.org). */ package org.tcdi.opensource.wiki; --- 1,25 ---- ! /** ! * The contents of this file are subject to the Mozilla Public License Version ! * 1.1 (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.mozilla.org/MPL/ ! * Software distributed under the License is distributed on an "AS IS" basis, ! * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for ! * the specific language governing rights and limitations under the License. ! * The Original Code is Wiki. The Initial Developer of the Original Code is ! * Technology Concepts and Design, Inc. Copyright (C) 2000 Technology Concepts ! * and Design, Inc. All Rights Reserved. Contributor(s): Lane Sharman ! * (OpenDoors Software) Justin Wells (Semiotek Inc.) Eric B. Ridge (Technology ! * Concepts and Design, Inc.) Alternatively, the contents of this file may be ! * used under the terms of the GNU General Public License Version 2 or later ! * (the "GPL"), in which case the provisions of the GPL are applicable instead ! * of those above. If you wish to allow use of your version of this file only ! * under the terms of the GPL and not to allow others to use your version of ! * this file under the MPL, indicate your decision by deleting the provisions ! * above and replace them with the notice and other provisions required by the ! * GPL. If you do not delete the provisions above, a recipient may use your ! * version of this file under either the MPL or the GPL. This product includes ! * sofware developed by OpenDoors Software. This product includes software ! * developed by Justin Wells and Semiotek Inc. for use in the WebMacro ! * ServletFramework (http://www.webmacro.org). */ package org.tcdi.opensource.wiki; *************** *** 44,162 **** /** ! * A WikiData object contains an individual piece of data (usually just a java.lang.String) and ! * has a type. ! * ! * WikiData is usually used as an array from the WikiPage object. ! * ! * @author Eric B. Ridge */ ! public class WikiData implements Serializable ! { ! /** ! * @deprecated these constants have been replaced by constants in WikiDataTypes. Their values should be ignored ! */ ! public static final int TYPE_UNKNOWN = -1; ! ! /** ! * @deprecated these constants have been replaced by constants in WikiDataTypes. Their values should be ignored ! */ ! public static final int TYPE_PAGE_REFERENCE = 0; ! /** ! * @deprecated these constants have been replaced by constants in WikiDataTypes. Their values should be ignored ! */ ! public static final int TYPE_PLAIN_TEXT = 1; ! ! /** ! * @deprecated these constants have been replaced by constants in WikiDataTypes. Their values should be ignored ! */ ! public static final int TYPE_USER = 1000; ! ! private Object _text; ! private int _type = WikiDataTypes.PLAIN_TEXT; ! static final long serialVersionUID = 0L; ! ! ! // ! // constructors ! // ! ! /** ! * Empty constructor. Does nothing. ! */ ! public WikiData () { ; } ! ! /** ! * Constructor to set data and type ! * ! * @param text the data of this object ! * @param type this object's type ! */ ! public WikiData (Object text, int type) ! { ! _text = text; ! _type = type; ! } ! ! // ! // get methods ! // ! ! /** ! * @return the data from this object ! */ ! public Object getData () { return _text; } ! ! /** ! * @return this object's type ! */ ! public int getType () { return _type; } ! ! // ! // set methods ! // ! ! /** ! * Set the data for this object ! * @param new_text the data to set ! */ ! public void setData (Object data) { _text = data; } ! /** ! * Set the type for this object ! * @param new_type the type of this object ! */ ! public void setType (int new_type) { _type = new_type; } ! ! ! // ! // other methods ! // ! ! /** ! * is this data object a reference to another page? ! */ ! public boolean isPageReference () { return _type == WikiDataTypes.PAGE_REFERENCE; } - /** - * is this data object plain text? - */ - public boolean isText () { return _type == WikiDataTypes.PLAIN_TEXT; } - - /** - * is this data object of the type specified? - * - * @param t the type to test for - * - * @return true if object is of specified type - */ - public boolean isOfType (int type) { return _type == type; } - - - /** - * Overloaded to return the toString() value of the internal data structure - */ - public String toString () { return _text.toString (); } - } --- 28,180 ---- /** ! * A WikiData object contains an individual piece of data (usually just a ! * java.lang.String) and has a type. WikiData is usually used as an array from ! * the WikiPage object. ! * ! *@author Eric B. Ridge ! *@created 20. September 2002 */ ! public class WikiData implements Serializable { ! /** ! *@deprecated these constants have been replaced by constants in ! * WikiDataTypes. Their values should be ignored ! */ ! public final static int TYPE_UNKNOWN = -1; ! /** ! *@deprecated these constants have been replaced by constants in ! * WikiDataTypes. Their values should be ignored ! */ ! public final static int TYPE_PAGE_REFERENCE = 0; ! /** ! *@deprecated these constants have been replaced by constants in ! * WikiDataTypes. Their values should be ignored ! */ ! public final static int TYPE_PLAIN_TEXT = 1; ! /** ! *@deprecated these constants have been replaced by constants in ! * WikiDataTypes. Their values should be ignored ! */ ! public final static int TYPE_USER = 1000; ! ! private Object _text; ! private int _type = WikiDataTypes.PLAIN_TEXT; ! ! final static long serialVersionUID = 0L; ! ! ! // ! // constructors ! // ! ! /** ! * Empty constructor. Does nothing. ! */ ! public WikiData() { ! ; ! } ! ! ! /** ! * Constructor to set data and type ! * ! *@param text the data of this object ! *@param type this object's type ! */ ! public WikiData(Object text, int type) { ! _text = text; ! _type = type; ! } ! ! ! // ! // get methods ! // ! ! /** ! *@return the data from this object ! */ ! public Object getData() { ! return _text; ! } ! ! ! /** ! *@return this object's type ! */ ! public int getType() { ! return _type; ! } ! ! ! // ! // set methods ! // ! ! /** ! * Set the data for this object ! * ! *@param data The new data value ! */ ! public void setData(Object data) { ! _text = data; ! } ! ! ! /** ! * Set the type for this object ! * ! *@param new_type the type of this object ! */ ! public void setType(int new_type) { ! _type = new_type; ! } ! ! ! // ! // other methods ! // ! ! /** ! * is this data object a reference to another page? ! * ! *@return The pageReference value ! */ ! public boolean isPageReference() { ! return _type == WikiDataTypes.PAGE_REFERENCE; ! } ! ! ! /** ! * is this data object plain text? ! * ! *@return The text value ! */ ! public boolean isText() { ! return _type == WikiDataTypes.PLAIN_TEXT; ! } ! ! ! /** ! * is this data object of the type specified? ! * ! *@param type Description of the Parameter ! *@return true if object is of specified type ! */ ! public boolean isOfType(int type) { ! return _type == type; ! } ! ! ! /** ! * Overloaded to return the toString() value of the internal data structure ! * ! *@return Description of the Return Value ! */ ! public String toString() { ! return _text != null ? _text.toString() : ""; ! } } Index: WikiPage.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/tcdi/opensource/wiki/WikiPage.java,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** WikiPage.java 18 Sep 2002 18:53:55 -0000 1.1.1.1.2.1 --- WikiPage.java 17 Feb 2003 18:36:28 -0000 1.1.1.1.2.2 *************** *** 24,30 **** */ package org.tcdi.opensource.wiki; import java.util.*; - import java.io.Serializable; import org.tcdi.opensource.util.*; --- 24,30 ---- */ package org.tcdi.opensource.wiki; + import java.io.Serializable; import java.util.*; import org.tcdi.opensource.util.*; *************** *** 36,39 **** --- 36,43 ---- * * + * + * + * + * *<li> date it was created * <li> author who created reated it *************** *** 460,463 **** --- 464,468 ---- public void setWikiData(WikiData[] data) { _parsedData = data; + updateOutgoingLinks(_parsedData); } *************** *** 494,497 **** --- 499,514 ---- public String toString() { return _title; + } + + + private void updateOutgoingLinks(WikiData[] data) { + System.out.println("Recreating outgoing links for page " + this.getTitle()); + _outgoingLinks = new String[0]; + for (int i = 0; i < data.length; i++) { + if ((data[i].getType() == WikiDataTypes.PAGE_REFERENCE) || + (data[i].getType() == WikiDataTypes.URL)) { + addOutgoingLink(data[i].toString()); + } + } } } |