You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(11) |
Mar
(106) |
Apr
(146) |
May
(79) |
Jun
(233) |
Jul
(218) |
Aug
(160) |
Sep
(155) |
Oct
(80) |
Nov
(176) |
Dec
(115) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(77) |
Feb
(106) |
Mar
(10) |
Apr
(54) |
May
(29) |
Jun
(29) |
Jul
(65) |
Aug
(80) |
Sep
|
Oct
(42) |
Nov
(45) |
Dec
(33) |
| 2006 |
Jan
(49) |
Feb
(52) |
Mar
(8) |
Apr
(3) |
May
(108) |
Jun
(43) |
Jul
(13) |
Aug
(1) |
Sep
(58) |
Oct
(66) |
Nov
(70) |
Dec
(115) |
| 2007 |
Jan
(26) |
Feb
(3) |
Mar
(17) |
Apr
(1) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
| 2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: lochmann <loc...@us...> - 2006-02-12 19:07:39
|
Update of /cvsroot/cobricks/cobricks2/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16954/web/images Added Files: nouser.png Log Message: Social Networks. --- NEW FILE: nouser.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/cobricks/cobricks2/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19169 Modified Files: Activities.html CWall_MeetingView.html CWall_RFID_Component.html CWall_doc.html Category_doc.html Cobricks2_doc.html Cobricks_Mailinglist_Howto.html Comparable.html Context_doc.html Core_doc.html Course_UnivISSync.html Course_doc.html Current_events.html Docs.html Einstieg_TUM.html Env_doc.html Env_doc_TUM.html INSTALL.html Ideas.html Item_BSCW_doc.html Item_RSS.html Item_Search.html Item_display_doc.html Item_doc.html Item_storage.html LogBrowser.html Main_Page.html Meeting_Mirror.html Meeting_Mirror_related.html Message_doc.html Migration_doc.html Portal_Jetspeed.html Portal_doc.html UML_Class_Diagramm_of_UserCard.html UML_class_diagramm_for_CircleControllButton.html UML_class_diagramm_of_CategoryBar.html UML_class_diagramm_of_CategoryIcon.html UML_class_diagramm_of_CategorySourceWS.html UML_class_diagramm_of_CommunityView.html UML_class_diagramm_of_both_PositioningStrategies.html User_FOAF.html User_doc.html Voting_doc.html index.html Added Files: Project_wiki.html Projects.html Wikibild.png Wikilanguage.html Log Message: Index: CWall_MeetingView.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/docs/CWall_MeetingView.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CWall_MeetingView.html 13 Dec 2005 09:08:50 -0000 1.4 +++ CWall_MeetingView.html 10 Feb 2006 12:00:01 -0000 1.5 @@ -1,39 +1,11 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta name="KEYWORDS" content="CWall MeetingView,CWall doc,Meeting Mirror,UML Class Diagramm of UserCard,UML class diagramm of CategoryBar,UML class diagramm of CategoryIcon,UML class diagramm for CircleControllButton,UML class diagramm of CategorySourceWS,UML class diagramm of both PositioningStrategies,UML class diagramm of CommunityView" /> -<meta name="robots" content="index,follow" /> -<link rel="shortcut icon" href="http://131.159.24.138/favicon.ico" /> -<link title="Creative Commons" type="application/rdf+xml" href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=creativecommons" rel="meta" /> -<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html" /> - - <title>CWall MeetingView - CobricksWiki</title> - <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/wiki/mw/stylesheets/monobook/main.css"; /*]]>*/</style> - <link rel="stylesheet" type="text/css" media="print" href="commonPrint.css"/> - <!--[if IE]><style type="text/css" media="all">@import "/wiki/mw/stylesheets/monobook/IEFixes.css";</style> - <script type="text/javascript" src="/wiki/mw/stylesheets/IEFixes.js"></script> - <meta http-equiv="imagetoolbar" content="no" /><![endif]--> - <script src="http://131.159.24.138/wiki/mw/index.php?title=-&action=raw&gen=js" type="text/javascript"></script> - <script type="text/javascript" src="wikibits.js"></script> - <style type="text/css">/*<![CDATA[*/ @import "/wiki/mw/index.php?title=-&action=raw&gen=css"; - /*]]>*/</style> - - </head> - <body class="ns-0"> - <div id="globalWrapper"> - <div id="column-content"> - <div id="content"> - - <a name="top" id="contentTop"></a> - <h1 class="firstHeading">CWall MeetingView</h1> - <div id="bodyContent"> - <h3 id="siteSub">From CobricksWiki</h3> - <div id="contentSub"></div> - - - - <!-- start content --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<title>CobricksWiki</title> +<link rel="stylesheet" type="text/css" href="style.css"/> +</head> +<body class="ns-0"> +<!-- start content --> <p><strong> Meeting View </strong> </p><p>View for CWall implemented in package org.cobricks.cwall.meeting </p><p>(also see <a href="CWall_doc.html" title ="CWall doc">CWall documentation</a>) @@ -124,16 +96,16 @@ </p> </div> </td></tr></table> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=1" title ="CWall MeetingView">edit</a>]</div><a name="Screen_Layout"></a><h2> Screen Layout </h2> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=2" title ="CWall MeetingView">edit</a>]</div><a name="CommunityView"></a><h3> CommunityView </h3> +<a name="Screen_Layout"></a><h2> Screen Layout </h2> +<a name="CommunityView"></a><h3> CommunityView </h3> <p>The CommunityView class is the very center of the meetingmirror. If you want to understand how the meetingmirror is working you need to understand this class. It Controlls most interactionevents like MouseEvents, and holds the informations about the states (like if the view is in searchmode, or if it has a CategoryBar, which UserIcons are displayed and so on) </p><p><a href="UML_class_diagramm_of_CommunityView.html" title ="UML class diagramm of CommunityView">UML class diagramm of CommunityView</a> </p><p><br /> If an RFID Reader is connected look here for further information how the CommunityView/MeetingMirror works: <a href="CWall_MeetingView.html#Modifications_of_the_meeting_mirror" title ="CWall MeetingView">Modifications of the meeting mirror</a> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=3" title ="CWall MeetingView">edit</a>]</div><a name="User_icons"></a><h3> User icons </h3> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=4" title ="CWall MeetingView">edit</a>]</div><a name="User_Card"></a><h3> User Card </h3> +<a name="User_icons"></a><h3> User icons </h3> +<a name="User_Card"></a><h3> User Card </h3> <p>The UserCard is responsible for displaying the information about an User on the screen and to allow the User in front of it to interact with it. At the moment every User can change the Category membership of any user. But this can be changed if the Methode UserCard.isUserRegistered() has been implemented with i.e. RFID. </p><p><a href="UML_Class_Diagramm_of_UserCard.html" title ="UML Class Diagramm of UserCard">UML Class Diagramm of UserCard</a> </p><p>To change the appeareance of the UserCard you can use the following settings in the properties.txt file. @@ -169,7 +141,7 @@ </p><p><br /> </p><p>While an RFID reader is connected, look here for more information: <a href="CWall_MeetingView.html#UserCard_RFID" title ="CWall MeetingView">UserCard RFID</a> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=5" title ="CWall MeetingView">edit</a>]</div><a name="Category_Bar"></a><h3> Category Bar </h3> +<a name="Category_Bar"></a><h3> Category Bar </h3> <p>The CategoryBar contains certain Categorys defined in the properties.txt and displays them on the screen. The User can interact with it, by searching for a certain Category, or highlighting the Users currently displayed on the screed which are members of the selected Category. </p><p><a href="UML_class_diagramm_of_CategoryBar.html" title ="UML class diagramm of CategoryBar">UML class diagramm of CategoryBar</a> </p><p><a href="UML_class_diagramm_of_CategoryIcon.html" title ="UML class diagramm of CategoryIcon">UML class diagramm of CategoryIcon</a> @@ -236,7 +208,7 @@ </pre> <p>searchicon is the small icon displayed within an activated (clicked) CategoryIcon which will start a search for that Category if clicked. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=6" title ="CWall MeetingView">edit</a>]</div><a name="CircleControllButton"></a><h3> CircleControllButton </h3> +<a name="CircleControllButton"></a><h3> CircleControllButton </h3> <p>The CircleControllButton is controlling the speed and direction of the searchresult circle. It also displays the numbers of searchresults and the name of the initiated search. </p><p><a href="UML_class_diagramm_for_CircleControllButton.html" title ="UML class diagramm for CircleControllButton">UML class diagramm for CircleControllButton</a> </p><p>To change the appeareance of the CircleControllButton you can use the following settings in the properties.txt file. @@ -321,24 +293,24 @@ </pre> <p>String which is used to display the Results </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=7" title ="CWall MeetingView">edit</a>]</div><a name="Search_Dialog"></a><h3> Search Dialog </h3> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=8" title ="CWall MeetingView">edit</a>]</div><a name="Search_mode_.2F_results"></a><h3> Search mode / results </h3> +<a name="Search_Dialog"></a><h3> Search Dialog </h3> +<a name="Search_mode_.2F_results"></a><h3> Search mode / results </h3> <p>Kurz: Bedienung </p><p>Konfiguration </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=9" title ="CWall MeetingView">edit</a>]</div><a name="Implementation"></a><h2> Implementation </h2> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=10" title ="CWall MeetingView">edit</a>]</div><a name="Category_Source"></a><h3> Category Source </h3> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=11" title ="CWall MeetingView">edit</a>]</div><a name="CateorySourceWS"></a><h4> CateorySourceWS </h4> +<a name="Implementation"></a><h2> Implementation </h2> +<a name="Category_Source"></a><h3> Category Source </h3> +<a name="CateorySourceWS"></a><h4> CateorySourceWS </h4> <p>CategorySourceWS is an so far uncomplete implementation of the CategorySource interface, which handles the data of Categorys using the WebService. To complete the implementation, a block of code needs to be uncommented which tries to initiate the CategoryManagerStub, which is not working correctly at the moment. </p><p><a href="UML_class_diagramm_of_CategorySourceWS.html" title ="UML class diagramm of CategorySourceWS">UML class diagramm of CategorySourceWS</a> </p><p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=12" title ="CWall MeetingView">edit</a>]</div><a name="Positioning_Strategies"></a><h3> Positioning Strategies </h3> +<a name="Positioning_Strategies"></a><h3> Positioning Strategies </h3> <p><a href="UML_class_diagramm_of_both_PositioningStrategies.html" title ="UML class diagramm of both PositioningStrategies">UML class diagramm of both PositioningStrategies</a> </p><p>Positioning Strategy for RFID identified Icons: <a href="CWall_MeetingView.html#Online_users_-_new_positioning_strategy" title ="">Online users - new positioning strategy</a> </p><p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=13" title ="CWall MeetingView">edit</a>]</div><a name="RandomizedPositioningStrategy"></a><h4> RandomizedPositioningStrategy </h4> +<a name="RandomizedPositioningStrategy"></a><h4> RandomizedPositioningStrategy </h4> <p>Calculates the random points for the given number of icons on the given screen without overlapping. </p><p>First the space around the already placed icons gets devided into rectangles. @@ -378,11 +350,11 @@ <p>However, not always all the icons can be placed using real randomization, because it places the icons too inefficient. In case of a 3 time failure to place all icons with this strategy, it calls the SpaceSavingPositioningStrategy class </p><p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=14" title ="CWall MeetingView">edit</a>]</div><a name="RandomizedPositioningStrategy_-_RFID_Reader_connected"></a><h5> RandomizedPositioningStrategy - RFID Reader connected </h5> +<a name="RandomizedPositioningStrategy_-_RFID_Reader_connected"></a><h5> RandomizedPositioningStrategy - RFID Reader connected </h5> <p>In case of an connected RFID reader there is an additional check in this strategy. The new calculated coordinates of the icons to be displayed are not allowed to lie within the given rfid dimension! </p><p>In case they do, new coordinates will be calculated. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=15" title ="CWall MeetingView">edit</a>]</div><a name="SpaceSavingPositioningStrategy"></a><h4> SpaceSavingPositioningStrategy </h4> +<a name="SpaceSavingPositioningStrategy"></a><h4> SpaceSavingPositioningStrategy </h4> <p>Devides the display into equal rectangles in number higher or equal to the number of icons to display. Then randomly assings each icon to one of the rectangles. After that each icon gets randomly placed within his assinged @@ -390,7 +362,7 @@ that can fit into the screen without overlapping by keeping maximum possible randomization </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=16" title ="CWall MeetingView">edit</a>]</div><a name="Source_Definitions"></a><h2> Source Definitions </h2> +<a name="Source_Definitions"></a><h2> Source Definitions </h2> <p>The Meeting View retrieves its data using Source interfaces. Currently, there is an interface named org.cobricks.cwall.meeting.UserSource for retrieving user data. A class implementing the UserSource interface has to be specified in the view properties. </p><p>Currently, the following implementations of UserSource are available: </p> @@ -398,13 +370,13 @@ </li><li> org.cobricks.cwall.meeting.UserSourceWS - get the user data from a Cobricks server (via SOAP/WebServices) </li><li> org.cobricks.cwall.meeting.UserSourceBSCW - get the user data from a BSCW server </li></ul> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=17" title ="CWall MeetingView">edit</a>]</div><a name="UserSourceDB"></a><h3> UserSourceDB </h3> +<a name="UserSourceDB"></a><h3> UserSourceDB </h3> <p>TBD </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=18" title ="CWall MeetingView">edit</a>]</div><a name="UserSourceWS"></a><h3> UserSourceWS </h3> +<a name="UserSourceWS"></a><h3> UserSourceWS </h3> <p>TBD </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=19" title ="CWall MeetingView">edit</a>]</div><a name="UserSourceBSCW"></a><h3> UserSourceBSCW </h3> +<a name="UserSourceBSCW"></a><h3> UserSourceBSCW </h3> <p>Get the user data from a BSCW workspace using the X-BSCW API. See <a href="http://www.bscw.de/" class='external' title="http://www.bscw.de/">http://www.bscw.de/</a> for more information on BSCW and <a href="http://bscw.fit.fraunhofer.de/api/" class='external' title="http://bscw.fit.fraunhofer.de/api/">http://bscw.fit.fraunhofer.de/api/</a> for more information on the X-BSCW API. </p><p>Currently, the following user attributes are loaded from BSCW: </p> @@ -432,7 +404,7 @@ cwall.view.mm.bscw.user=USER cwall.view.mm.bscw.pw=PW </pre> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=20" title ="CWall MeetingView">edit</a>]</div><a name="Usage"></a><h4> Usage </h4> +<a name="Usage"></a><h4> Usage </h4> <p>You can start the MeetingMirror client with a BSCW UserSource from the command line version easily by typing </p> <pre> @@ -441,11 +413,11 @@ </pre> <p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=21" title ="CWall MeetingView">edit</a>]</div><a name="CWall_PDA"></a><h2> CWall PDA </h2> +<a name="CWall_PDA"></a><h2> CWall PDA </h2> <p>The CWall PDA client is a stand-alone C# application. Itâs implemented for use in a Windows CE environment. </p><p>CWall PDA loads user information from Cobricks-2 platform and saves these information in an own database. The PDA user can search for other users by specifying several search attributes and bookmark them in a special list. In addition to displaying information it is also possible to interact with the CWall to influence which users are displayed in details view or to bookmark the currently shown users of the CWall. It is also possible to edit the own data and update the Cobricks-2 platform. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=22" title ="CWall MeetingView">edit</a>]</div><a name="Installation"></a><h3> Installation </h3> +<a name="Installation"></a><h3> Installation </h3> <p>You have to install the Cobricks-2 Platform, the Meeting Mirror IRDA-Server and the CWall PDA application. </p><p><strong>Cobricks-2 Platform</strong> </p><p>Please go to <a href="http://www.cobricks.de" class='external' title="http://www.cobricks.de">http://www.cobricks.de</a> and use the Link to Wiki to read more about the installation of the Cobricks-2 platform. @@ -628,7 +600,7 @@ <p>server: The Cobricks-2 platform server name. </p><p>port: The Cobricks-2 platform server port. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=23" title ="CWall MeetingView">edit</a>]</div><a name="CWall_PDA_packages"></a><h3>CWall PDA packages</h3> +<a name="CWall_PDA_packages"></a><h3>CWall PDA packages</h3> <p>See the following sections for information how the application is implemented. </p><p>The program is realized with the MVC pattern. The form component and all supported views act as the View. The user database represents the Model. The Controller is integrated in the views because of the small business logic. </p><p>The C# classes are grouped into several packages. @@ -802,7 +774,7 @@ </p><p><small ><strong>UML class diagramm: CobricksUser</strong></small > </p><p><a href="http://131.159.24.138/wiki/mw/index.php/Image:Classdiagram_cobuser.jpg" class="image" title="Image:Classdiagram_cobuser.jpg"><img src="Classdiagram_cobuser.jpg" alt="Image:Classdiagram_cobuser.jpg" /></a> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=24" title ="CWall MeetingView">edit</a>]</div><a name="Future_Work.2FExtentions"></a><h3>Future Work/Extentions</h3> +<a name="Future_Work.2FExtentions"></a><h3>Future Work/Extentions</h3> <p>In this chapter we want to list some further steps and future extentions for the CWall PDA project . </p> <ul><li> Synchronisation via Bluetooth: an option to enable synchronisation with the Cobricks2 database for pocket pc users without wireless lan. @@ -815,7 +787,7 @@ </li></ul> <p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=25" title ="CWall MeetingView">edit</a>]</div><a name="User_Manual"></a><h3>User Manual</h3> +<a name="User_Manual"></a><h3>User Manual</h3> <p><strong>Starting the Application</strong> </p><p>Start the application by using the shortcut which is created in the menu âProgrammeâ or go the directory â/Programme/PDACobricksâ and start from there the application. </p><p>After having started the application you will see the Welcome-View(see figure 1). @@ -892,15 +864,15 @@ When you are satisfied with your new profile you can send it to the Cobricks-2 platform by pushing the âUpdateâ button. With the âZurückâ button you will go back to the previous View. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=26" title ="CWall MeetingView">edit</a>]</div><a name="CWall_RFID"></a><h2> CWall RFID </h2> +<a name="CWall_RFID"></a><h2> CWall RFID </h2> <p><em>As soon as we finished the RFID Project, we will document the whole project. Until this time, this chapter will continually be changed.</em> </p><p>This part of the Meeting Mirror was implemented to work with RFID reader of the German company FEIG ELECTRONIC GmbH. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=27" title ="CWall MeetingView">edit</a>]</div><a name="Motivation"></a><h3> Motivation </h3> +<a name="Motivation"></a><h3> Motivation </h3> <p>This component of the Meeting Mirror is an option for users to identify themselves by rfid (radio frequency identification). The identification is used to get interesting information by users. Therefore a simple matching is implemented. Results of the matching are displayed like the anomynous search on the wide screen. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=28" title ="CWall MeetingView">edit</a>]</div><a name="Installation_2"></a><h3> Installation </h3> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=29" title ="CWall MeetingView">edit</a>]</div><a name="Connecting_the_RFID-Reader"></a><h4> Connecting the RFID-Reader </h4> +<a name="Installation_2"></a><h3> Installation </h3> +<a name="Connecting_the_RFID-Reader"></a><h4> Connecting the RFID-Reader </h4> <p>The Java class library ID OBIDISC4J from FEIG ELECTRONIC GmbH represents yet another component for simplifying the development of application programs in Java for OBID i-scan and OBID classic-pro readers. </p><p>The Java class library ID OBIDISC4J currently supports Windows and Linux (for x86 oricessors only). The library is based on the C++ class library ID FEDM as we´ll as the native function libraries ID FECOM, ID FEUSB(for Windos Versions only), ID FETCP and IC FEISC. </p><p>For further information please read the dokumentation of the reader software. @@ -951,7 +923,7 @@ </li></ul> <p>Copy the OBID4ISCJ.jar file to the directory: <JAVA_HOME>\jre\lib\ext. Alternately you can select any other directory, as long as you tell this to the Java Classpath. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=30" title ="CWall MeetingView">edit</a>]</div><a name="Settings"></a><h4> Settings </h4> +<a name="Settings"></a><h4> Settings </h4> <p>The following settings have to be done in localproperties.txt, to configure the rfid-reader interface, if they should be different to the following: </p> <pre> @@ -977,7 +949,7 @@ <p>Next settings describe the maximum tablesize, the reader tries to read from tags (it should be two to the power of minimum seven; 2^7) and the time, an user will be kept online, after his tag was lastly recognized by the reader. The sleeptime is the intervall, the reading-thread will be restarted. If your setting shell be different, you have to change them in your localproperties.txt. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=31" title ="CWall MeetingView">edit</a>]</div><a name="Eclipse.2C_ANT.2C_build.xml_and_build.properties"></a><h4> Eclipse, ANT, build.xml and build.properties </h4> +<a name="Eclipse.2C_ANT.2C_build.xml_and_build.properties"></a><h4> Eclipse, ANT, build.xml and build.properties </h4> <p>In order to show ant, where it can find the driver of the rfid reader, you have to set the parameter 'rfid.home' in the build.properties: </p> <pre> @@ -999,28 +971,28 @@ </pre> <p>Please do not delete the classes from cvs! </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=32" title ="CWall MeetingView">edit</a>]</div><a name="RFID_component"></a><h3> RFID component </h3> +<a name="RFID_component"></a><h3> RFID component </h3> <p>The rfid component is an extension of the meeting mirror to get a list of users, standing actually in front of it. The rfid module (org.cobricks.cwall.meeting.rfid.*) is a thread, which sends requests to a rfid-reader in certain time intervals. The rfid reader answers to these requests with a list of perceived tags/rfids. The rfid thread compares the list of tags with the list of users, got from the cobricks database. After that the thread creates a new list of users, which are online and makes it available for the meeting mirror application. </p><p>The rfid reader is connected to either a serial RS232-interface, an USB or a TCP/IP interface (Up to now only the serial interface was tested with a LongRange reader of FEIG Electronics GmbH (www.feig.de), model ID ISC.LR200). </p><p>The exact functionality shell be shown in the following sections. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=33" title ="CWall MeetingView">edit</a>]</div><a name="UML_class_diagram"></a><h4> UML class diagram </h4> +<a name="UML_class_diagram"></a><h4> UML class diagram </h4> <p>tbd </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=34" title ="CWall MeetingView">edit</a>]</div><a name="Reader_thread"></a><h4> Reader thread </h4> +<a name="Reader_thread"></a><h4> Reader thread </h4> <p>tbd </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=35" title ="CWall MeetingView">edit</a>]</div><a name="Modification_of_the_database"></a><h4> Modification of the database </h4> +<a name="Modification_of_the_database"></a><h4> Modification of the database </h4> <p>tbd </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=36" title ="CWall MeetingView">edit</a>]</div><a name="Modifications_of_the_meeting_mirror"></a><h3> Modifications of the meeting mirror </h3> +<a name="Modifications_of_the_meeting_mirror"></a><h3> Modifications of the meeting mirror </h3> <p>The connection of an rfid reader causes some changes in the meetingmirror: </p><p>In the properties you can define, if the reader should be activated or not. </p> <pre> cwall.view.mm.rfid.activate=false </pre> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=37" title ="CWall MeetingView">edit</a>]</div><a name="Community_view"></a><h4> Community view </h4> +<a name="Community_view"></a><h4> Community view </h4> <p>As you know, the CommunityView is the point of controll of most interactionevents. </p><p>There is something new, if an reader is connected: </p> @@ -1032,7 +1004,7 @@ </li><li> ClickEvent on not-identified User: <a href="CWall_MeetingView.html#UserCard_RFID" title ="CWall MeetingView">UserCard RFID</a> </li></ul> </li></ul> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=38" title ="CWall MeetingView">edit</a>]</div><a name="Online_users_-_new_positioning_strategy"></a><h4> Online users - new positioning strategy </h4> +<a name="Online_users_-_new_positioning_strategy"></a><h4> Online users - new positioning strategy </h4> <p>The new strategy positions the icons of the online users (identified by RFID Reader) on a given rfid dimension. The strategy calculates, knowing the dimension of the icons, how many icons fit into rfid_home_dim.width and into rfid_home_dim.height. So we know how many icons fit into the dimension at all. If there are too many users online, the dimension of the icons will be reduced. </p><p>The strategy takes the coordinates so that the icons will be placed one after another. @@ -1055,10 +1027,10 @@ </pre> <p>These icons, which are displayed in that seperate area, are not in the permanent change of all displayed icons. This is guaranteed by a function in the PrioritySchedulingStrategy. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=39" title ="CWall MeetingView">edit</a>]</div><a name="UserCard_RFID"></a><h4> UserCard RFID </h4> +<a name="UserCard_RFID"></a><h4> UserCard RFID </h4> <p>The UserCard now also shows the lastseenDate of the User. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit&section=40" title ="CWall MeetingView">edit</a>]</div><a name="Automatic_Matching"></a><h3> Automatic Matching </h3> +<a name="Automatic_Matching"></a><h3> Automatic Matching </h3> <p>While there is an ClickEvent on an rfid-identifed UserIcon, the Automatic Matching starts. </p><p>So the user standing infront of the screen is able to look for other useres, who have for example the same interests. </p><p><br /> @@ -1073,82 +1045,5 @@ Retrieved from "<a href="CWall_MeetingView.html">http://131.159.24.138/wiki/mw/index.php/CWall_MeetingView</a>"</div> - <!-- end content --> - <div class="visualClear"></div> - </div> - </div> - </div> - <div id="column-one"> - <div id="p-cactions" class="portlet"> - <h5>Views</h5> - <ul> - <li id="ca-nstab-main" class="selected"><a href="CWall_MeetingView.html">Article</a></li><li id="ca-talk" class="new"><a href="http://131.159.24.138/wiki/mw/index.php?title=Talk:CWall_MeetingView&action=edit">Discussion</a></li><li id="ca-edit" class=""><a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=edit">Edit</a></li><li id="ca-history"><a href="http://131.159.24.138/wiki/mw/index.php?title=CWall_MeetingView&action=history">History</a></li> - </ul> - </div> - <div class="portlet" id="p-personal"> - <h5>Personal tools</h5> - <div class="pBody"> - <ul> - <li id="pt-login"><a href="http://131.159.24.138/wiki/mw/index.php?title=Special:Userlogin&returnto=CWall_MeetingView">Log in</a></li> - </ul> - </div> - </div> - <div class="portlet" id="p-logo"> - <a title="Main Page" style="background-image: url(/wiki/mw/stylesheets/images/wiki.png);" href="Main_Page.html"></a> - </div> - <div class="portlet" id="p-nav"> - <h5>Navigation</h5> - <div class="pBody"> - <ul> - <li id="n-mainpage"><a href="Main_Page.html">Main Page</a></li> - <li id="n-portal"><a href="http://131.159.24.138/wiki/mw/index.php/CobricksWiki:Community_Portal">Community portal</a></li> - <li id="n-currentevents"><a href="Current_events.html">Current events</a></li> - <li id="n-recentchanges"><a href="http://131.159.24.138/wiki/mw/index.php/Special:Recentchanges">Recent changes</a></li> - <li id="n-randompage"><a href="http://131.159.24.138/wiki/mw/index.php/Special:Randompage">Random page</a></li> - <li id="n-help"><a href="http://131.159.24.138/wiki/mw/index.php/Help:Contents">Help</a></li> - - </ul> - </div> - </div> - <div id="p-search" class="portlet"> - <h5>Search</h5> - <div class="pBody"> - <form name="searchform" action="http://131.159.24.138/wiki/mw/index.php/Special:Search" id="searchform"> - <input accesskey="f" id="searchInput" name="search" type="text" /> - <input value="Go" type="submit" name="go" class="searchButton" /> <input value="Search" type="submit" name="fulltext" class="searchButton" /> - </form> - </div> - </div> - <div class="portlet" id="p-tb"> - <h5>Toolbox</h5> - <div class="pBody"> - <ul> - <li id="t-whatlinkshere"><a href="http://131.159.24.138/wiki/mw/index.php?title=Special:Whatlinkshere&target=CWall_MeetingView">What links here</a></li> - <li id="t-recentchangeslinked"><a href="http://131.159.24.138/wiki/mw/index.php?title=Special:Recentchangeslinked&target=CWall_MeetingView">Related changes</a></li> - - - - - <li id="t-specialpages"><a href="http://131.159.24.138/wiki/mw/index.php/Special:Specialpages">Special pages</a></li> - </ul> - </div> - </div> - - </div><!-- end of the left (by default at least) column --> - <div class="visualClear"></div> - <div id="footer"> - <div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="poweredby_mediawiki_88x31.png" alt="MediaWiki" /></a></div> - <div id="f-copyrightico"><a href="http://www.gnu.org/copyleft/fdl.html"><img src="gnu-fdl.png" alt='GNU Free Documentation License 1.2' /></a></div> - <ul id="f-list"> - <li id="f-lastmod"> This page was last modified 09:26, 4 Nov 2005.</li> - <li id="f-viewcount">This page has been accessed 895 times.</li> - - <li id="f-copyright">Content is available under <a href="http://www.gnu.org/copyleft/fdl.html" class='external' title="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License 1.2</a>.</li> - <li id="f-about"><a href="http://131.159.24.138/wiki/mw/index.php/CobricksWiki:About" title ="CobricksWiki:About">About CobricksWiki</a></li> - <li id="f-disclaimer"><a href="http://131.159.24.138/wiki/mw/index.php/CobricksWiki:General_disclaimer" title ="CobricksWiki:General disclaimer">Disclaimers</a></li> - </ul> - </div> - </div> - <!-- Served by atschlichter43 in 1.06 secs. --> - </body> -</html> +<!-- end content --> +</body></html> Index: Cobricks2_doc.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/docs/Cobricks2_doc.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Cobricks2_doc.html 13 Dec 2005 09:08:50 -0000 1.6 +++ Cobricks2_doc.html 10 Feb 2006 12:00:02 -0000 1.7 @@ -1,39 +1,11 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta name="KEYWORDS" content="Cobricks2 doc" /> -<meta name="robots" content="index,follow" /> -<link rel="shortcut icon" href="http://131.159.24.138/favicon.ico" /> -<link title="Creative Commons" type="application/rdf+xml" href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=creativecommons" rel="meta" /> -<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html" /> - - <title>Cobricks2 doc - CobricksWiki</title> - <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/wiki/mw/stylesheets/monobook/main.css"; /*]]>*/</style> - <link rel="stylesheet" type="text/css" media="print" href="commonPrint.css"/> - <!--[if IE]><style type="text/css" media="all">@import "/wiki/mw/stylesheets/monobook/IEFixes.css";</style> - <script type="text/javascript" src="/wiki/mw/stylesheets/IEFixes.js"></script> - <meta http-equiv="imagetoolbar" content="no" /><![endif]--> - <script src="http://131.159.24.138/wiki/mw/index.php?title=-&action=raw&gen=js" type="text/javascript"></script> - <script type="text/javascript" src="wikibits.js"></script> - <style type="text/css">/*<![CDATA[*/ @import "/wiki/mw/index.php?title=-&action=raw&gen=css"; - /*]]>*/</style> - - </head> - <body class="ns-0"> - <div id="globalWrapper"> - <div id="column-content"> - <div id="content"> - - <a name="top" id="contentTop"></a> - <h1 class="firstHeading">Cobricks2 doc</h1> - <div id="bodyContent"> - <h3 id="siteSub">From CobricksWiki</h3> - <div id="contentSub"></div> - - - - <!-- start content --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<title>CobricksWiki</title> +<link rel="stylesheet" type="text/css" href="style.css"/> +</head> +<body class="ns-0"> +<!-- start content --> <p><strong>Cobricks-2 Community Bricks and Web Application Server Overview</strong> </p> <table border="0" id="toc"><tr id="toctitle"><td align="center"> @@ -150,11 +122,11 @@ </div> </div> </td></tr></table> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=1" title ="Cobricks2 doc">edit</a>]</div><a name="Overview_and_Basic_Requirements"></a><h2> Overview and Basic Requirements </h2> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=2" title ="Cobricks2 doc">edit</a>]</div><a name="Purpose"></a><h3> Purpose </h3> +<a name="Overview_and_Basic_Requirements"></a><h2> Overview and Basic Requirements </h2> +<a name="Purpose"></a><h3> Purpose </h3> <p>Cobricks-2 is a modular and extensible toolkit for building and operating platforms for (virtual) communities. A platform for virtual communities is a software installation configured and prepared to serve the needs of a particular community, i.e. an instantiation of a generic software product. The toolkit comes with a Web based user interface and a content management functionality and portal container for managing the user interface. In the basic setup the core platform is executed as a Web application in a Web application server. In addition to the Web user interface Cobricks-2 supports a Web Services interface to the functionality and data of the platform. Via this interface it is possible to access the platform from clients and (external) agents, to integrate the platform with other applications, and to connect different Cobricks-2 platforms. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=3" title ="Cobricks2 doc">edit</a>]</div><a name="Communities"></a><h4> Communities </h4> +<a name="Communities"></a><h4> Communities </h4> <p>In general a community is a group of people who share some interest, identify with a common idea or more generally belong to a common context. Thus, a community can be seen as a descriptive identity for a set of people. </p><p>Early sociological work points out, that communities always need a locality and interaction [Hillery 1955]. While the demand for a common physical locality is no longer seen necessary (due to electronic communication and virtual places), the demand for interaction or possibility to interact is still valid. In practical terms this possibility to interact implies the existence of a common communication medium, of common protocols and awareness of the existence and of the membership in the community. </p><p>The interaction in communities is said to serve a goal that is characteristic for communities: collaboration towards common goals or mutual support. A community is not just a set of people who have something in common and who have the possibility to communicate, but of people who are willing to help each other, who are collaborating to the advantage of all. This collaboration is often presented as a will to exchange knowledge â which leads us to communities of practice â but can also be found in collaboration to maintain sport facilities and set up sports events in sport clubs. @@ -169,16 +141,16 @@ To achieve the (spontaneous, unorganized) mutual collaboration, the main activities in communities are communication among members and finding people to communicate with. Communication includes exchange of information (indirect communication) and generating and sharing of knowledge. Hence, community support can be seen as âcommunication and matchmaking supportâ. </p><p>For more information on the characterisation of community and on community support see for example <a href="http://www.communixx.de/" class='external' title="http://www.communixx.de/">http://www.communixx.de/</a> or the additional material at <a href="http://www.cobricks.org/" class='external' title="http://www.cobricks.org/">http://www.cobricks.org/</a> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=4" title ="Cobricks2 doc">edit</a>]</div><a name="Community_Support"></a><h4> Community Support </h4> +<a name="Community_Support"></a><h4> Community Support </h4> <p>Community support systems are software applications with functionality to support the information flow between the community members (providing a communication medium), and to support finding other members (matchmaking support). </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=5" title ="Cobricks2 doc">edit</a>]</div><a name="Community.2C_Community_Support_System.2C_Community_Platform"></a><h5> Community, Community Support System, Community Platform </h5> +<a name="Community.2C_Community_Support_System.2C_Community_Platform"></a><h5> Community, Community Support System, Community Platform </h5> <p>A community is a descriptive identity for a set of people and usually stands for this set of people. Hence, a community is a group of people with a commonality who interact to collaborate in the context of this commonality. An online community is a community whose members mainly interact through electronic communication. </p><p>A community support system is software with functionality to support communities. </p><p>A community platform is a particular instance of a community support system, installed and configured to support a particular community or set of communities. Community platform are usually realized as client server systems with Web browsers as client software. Client computers and client software are usually not considered part of the community platform. An exception from this is, if proprietary client software or hardware is used. </p><p>Hence, Cobricks-2 is a community support system that can be used to set up community platforms for supporting (online) communities. However, you will often find that the term (online) community is used synonymous with the term community platform. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=6" title ="Cobricks2 doc">edit</a>]</div><a name="Basic_Support_Concepts_.E2.80.93_Users_and_Context"></a><h5> Basic Support Concepts â Users and Context </h5> +<a name="Basic_Support_Concepts_.E2.80.93_Users_and_Context"></a><h5> Basic Support Concepts â Users and Context </h5> <p>While providing means for publishing and categorizing information is important for community support, this is not the most characteristic concept. The core of a community support medium is to draw attention to users, by capturing and visualizing electronic user representations, and by capturing and visualizing links between users and between users and content, messages or categorizing concepts. A central issue in community support systems therefore is the user representation and the representation of relations between users and other data concepts on the platform. </p><p>In [Koch 2003]1 we argue that for modular and customizable community support only a very small number of different data concepts are needed on a platform: @@ -191,7 +163,7 @@ </li></ul> <p>The Cobricks-2 platform follows this approach. See Section 1.3.1 for more information. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=7" title ="Cobricks2 doc">edit</a>]</div><a name="Tool_vs._Medium"></a><h5> Tool vs. Medium </h5> +<a name="Tool_vs._Medium"></a><h5> Tool vs. Medium </h5> <p>Current community support solutions mainly encapsulate data structures in (support) tools and provide the user with tool specific user interfaces. These tools and their user interfaces often predefine how the basic support medium can and should be used. </p><p>In contrast to the tool centric approach, Cobricks-2 follows a medium centric approach. The basic support medium (data concepts and channels/processes that distribute the data) is not hidden inside tools but provided in the open. </p><p>This approach has several advantages @@ -199,7 +171,7 @@ <ul><li> it allows us to focus on core concepts/media of community support </li><li> it provides a platform that later can easily be (deeply) integrated with existing tools (like portals, content management systems, identity management solutions, or in the way of contextual collaboration with productivity applications) </li></ul> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=8" title ="Cobricks2 doc">edit</a>]</div><a name="Community_Management"></a><h5> Community Management </h5> +<a name="Community_Management"></a><h5> Community Management </h5> <p>In addition to the medium centric functional focus on users and on relations, community support also has to provide means for community management. </p><p>Communities usually are rather unstructured and unorganized sets of people. Making a community / community platform work involves several prerequisites, the technology for the communication medium only being one. Explicit moderation and different means for supporting intrinsic and extrinsic motivation are needed in addition to the basic functionality. </p><p>Support for community management includes @@ -211,8 +183,8 @@ <p>The Cobricks-2 system provides means for community management already built into the core of the system. </p><p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=9" title ="Cobricks2 doc">edit</a>]</div><a name="Cobricks-2_Use_Cases"></a><h4> Cobricks-2 Use Cases </h4> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=10" title ="Cobricks2 doc">edit</a>]</div><a name="Use_Cases"></a><h5> Use Cases </h5> +<a name="Cobricks-2_Use_Cases"></a><h4> Cobricks-2 Use Cases </h4> +<a name="Use_Cases"></a><h5> Use Cases </h5> <p>Following the motivation in the previous section, the main purpose of Cobricks-2 is to provide means for supporting direct and indirect communication in communities (of practice) - direct exchange of messages, indirect exchange of information and user representation in the system (for matchmaking) focus on user presentation and relations @@ -220,7 +192,7 @@ </p><p>The functionality is mainly directed towards authenticated users (community members). Other user classes are anonymous users (mainly for browsing in a sub-set of the information), community administrators and platform administrators. Finally, a platform build from Cobricks-2 should also be accessible by user agents or other Cobricks-2 platforms. </p><p><a href="http://131.159.24.138/wiki/mw/index.php/Image:Cobricks2_doc_usecases.jpg" class="image" title="Cobricks-2 Use Cases"><img src="Cobricks2_doc_usecases.jpg" alt="Cobricks-2 Use Cases" /></a> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=11" title ="Cobricks2 doc">edit</a>]</div><a name="Target_Scenarios"></a><h5> Target Scenarios </h5> +<a name="Target_Scenarios"></a><h5> Target Scenarios </h5> <p>Cobricks-2 can be used to build: </p> <ul><li> individual (interactive) web sites for companies or departments @@ -230,8 +202,8 @@ <p>The product can be used out of the box but is mainly targeted to be customized for a special usage scenario. </p><p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=12" title ="Cobricks2 doc">edit</a>]</div><a name="Requirements"></a><h3> Requirements </h3> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=13" title ="Cobricks2 doc">edit</a>]</div><a name="Functional_Requirements"></a><h4> Functional Requirements </h4> +<a name="Requirements"></a><h3> Requirements </h3> +<a name="Functional_Requirements"></a><h4> Functional Requirements </h4> <p>One source for the functional requirements is the discussion of community support functionality in Section 1.1. This leads to requirements for particular functionality: </p> <ul><li> User Representation and Context / Relationship support: The platform provides basic support for user representation and for handling and presenting relationship of users with other users and content @@ -258,7 +230,7 @@ </li></ul> <ul><li> Connecting platforms: Different Cobricks-2 platforms can be connected for exchanging community content and for reusing user profile information. Especially the integration of external user directories (identity management solutions) should be very strong and support different directories (LDAP, Liberty Alliance, IDRepository). </li></ul> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=14" title ="Cobricks2 doc">edit</a>]</div><a name="Interface_.26_Software_Requirements"></a><h4> Interface & Software Requirements </h4> +<a name="Interface_.26_Software_Requirements"></a><h4> Interface & Software Requirements </h4> <p>In addition to the functional requirements listed above we have defined some additional (non functional) requirements: </p> <ul><li> The platform should be usable out-of-the-box, i.e. after installing and initializing the software (and the databases for persistent storage) the user interface of a default platform should be available. @@ -274,8 +246,8 @@ <p>More details on these interface and software requirements, together with some design constraints and documentation requirements can be found in the documentation of the Development Environment of Cobricks-2 (separate document). </p><p><br /> </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=15" title ="Cobricks2 doc">edit</a>]</div><a name="Toolkit_Overview"></a><h3> Toolkit Overview </h3> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=16" title ="Cobricks2 doc">edit</a>]</div><a name="Data_Concepts"></a><h4> Data Concepts </h4> +<a name="Toolkit_Overview"></a><h3> Toolkit Overview </h3> +<a name="Data_Concepts"></a><h4> Data Concepts </h4> <p>Following the discussion in the section on community support, the Cobricks-2 platform is based on simple but extensible and customizable data concepts providing a community support medium: </p> <ul><li> user @@ -288,15 +260,15 @@ </p><p>Detailed information on the data concepts can be found in the chapters on the components covering each concept. We will just give a brief overview here. </p><p>In general the data concepts are modelled as frames with slots (objects with (object) attributes). Sometimes we also describe the data objects as set of attribute value pairs. The models (classes) for the data objects are described in ontologies, i.e. the attribute names and the possible values for the attributes. Objects are identified via (concept specific) integer identifiers or via global URIs. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=17" title ="Cobricks2 doc">edit</a>]</div><a name="User"></a><h5> User </h5> +<a name="User"></a><h5> User </h5> <p>The concept of a âuserâ describes digital user representations. This is a set of attribute value pairs identified by a (local) identifier, a user login. As with all other data concepts there can be different classes of users which are defined in an ontology. The ontology does not only define the user classes and the relationships among user classes, but also defines which attributes can be set for a user, and what (data) type the values of the attributes have. (As with all other data concepts it is possible to use attributes with names not defined in the model in user objects of any class â however, there is no special support for these additional attributes and they default to string values.) </p><p>Attributes of user objects can define relationships with other users or other data concepts of the platform. An example for this is a buddy list attribute that stores a set of references to other user objects. Relations like this are (at least virtually) modelled as context objects (see next section), but can still be accessed from the user object directly. See the chapter on the Context Component for more information about how this is handled in the platform. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=18" title ="Cobricks2 doc">edit</a>]</div><a name="Context_.28Relation.29"></a><h5> Context (Relation) </h5> +<a name="Context_.28Relation.29"></a><h5> Context (Relation) </h5> <p>The core concepts of community support are users and contexts. Thereby, contexts are relations of users (or other data concepts) to 1) other users, 2) content (items or messages), 3) categorizing concepts (categories), or 4) external resources (identified by URIs). Since context is of major importance for community support, it is modelled as a separate data concept. As with users, contexts are sets of attribute value pairs that are grouped into context classes. The context classes describe the actual type of relationship and define which attributes (and attribute value types) the context will have. </p><p>It is possible to completely separate the management of context from the management of users and other data concepts. However, it is more intuitive to manage some contexts with the concepts they are mainly bound to. Therefore, the context management will not explicitly store all contexts but derive some dynamically from other contents with the help of other components. That is why we speak of virtual context information sometimes. In addition to this it is also possible to derive context information in a really dynamic manner based on rules. See description of the Context Component for more information on this issue. </p> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=19" title ="Cobricks2 doc">edit</a>]</div><a name="Item"></a><h5> Item </h5> +<a name="Item"></a><h5> Item </h5> <p>Items are content objects that are published by users. As users, item entities are basically built from a set of attribute value pairs identified by a local or a global entifier. There are several (hierarchically structured) item classes available, that define what attributes an item should have and what type the attribute values have. An item instance is associated to one of these item classes or item types. </p><p>The core attribute of an item is the âcontentâ. This attribute get special handling and can be of four different types: text, xml, binary, URI. </p><p>Items can have attachments and simple annotations/ratings. Additionally, it is possible to relate items to each other. Item to user relations are usually done using item attributes with value type user â or in the other direction by using user attributes with value type item. @@ -305,7 +277,7 @@ <ul><li> Item classes: announcement, project, publication, web-page </li><li> Item instances: a particular announcement, project, publication, web-page </li></ul> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=20" title ="Cobricks2 doc">edit</a>]</div><a name="Category"></a><h5> Category </h5> +<a name="Category"></a><h5> Category </h5> <p>Categories are focal points to cluster entities of users or items. Hence, the main task of a category is to hold a set of items (item references since items may belong to a set of categories at once) or to be associated to a set of users (users are said to select categories as interests or to be member of a category â there are different classes of membership). </p><p>Since it is a very generic clustering object, there might be several classes of categories. For the beginning categories again are defined as attribute value pairs. In the most simple version there is just a title and an entifier attribute. For more complex versions additional attributes (defining how a category reacts) can be defined. </p><p>Examples: @@ -313,11 +285,11 @@ <ul><li> Category classes: InterestCategories (no members possible), SharedBuddyLists (interestCategories with members and admin roles), PrivateFolders (no members), WebFolder </li><li> Category objects: âcourse.program.informaticsâ, âteaching-staffâ, âkochm-publicationsâ, â/course/info/â </li></ul> -<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://131.159.24.138/wiki/mw/index.php?title=Cobricks2_doc&action=edit&section=21" title ="Cobricks2 doc">edit</a>]</div><a name="Messages"></a><h5> Messages </h5> +<a name="Messages"></a><h5> Messages </h5> <p>Messages are the second type of content objects on the platform. Messages are published (sent) by users with the intention to deliver them to a specified set of other users. This set of recipients can be defined explicitly (by a set of recipient addresses) or implicitly (by a set of attributes the recipients must match). Whil... [truncated message content] |
|
From: Michael K. <ko...@us...> - 2006-02-10 11:49:51
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15824/cobricks/item/db Modified Files: item_attrs.xml Log Message: Index: item_attrs.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/db/item_attrs.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- item_attrs.xml 3 Feb 2006 15:50:43 -0000 1.2 +++ item_attrs.xml 10 Feb 2006 11:49:40 -0000 1.3 @@ -4,7 +4,6 @@ <column name="itemid" type="int" notnull="true"/> <column name="aname" type="string(100)"/> - <column name="avalueprefix" type="varchar(100)"/> <column name="avalue" type="text"/> <index name="item_attrs_itemid"> |
|
From: Michael K. <ko...@us...> - 2006-02-10 11:36:25
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11203 Modified Files: MultipartFilter.java PortalManager.java PortalManagerImpl.java PortalPage.java PortalPresenter.java PortalServlet.java PortalServletAdaptor.java PortalStats.java itemontology.xml Added Files: PortalCache.java PortalObject.java PortalObjectFile.java Removed Files: PageCache.java Log Message: changed web object support in Portal Component to make binary objects possible Index: PortalManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManager.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- PortalManager.java 2 Feb 2006 11:39:26 -0000 1.19 +++ PortalManager.java 10 Feb 2006 11:36:15 -0000 1.20 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -45,23 +45,31 @@ throws PortalCompletedException; public void printPage(PortalRequest portalRequest, PrintWriter out); - public PortalPage getPage(String pagePath, String pageName); - public PortalPage getPage(int itemid); + public PortalObject getObject(String pagePath, String pageName); + public PortalObject getObject(int itemid); - public int getPageItemId(String pagePath, String pageName); + public void saveFileToFilesystem(String pagepath, String pagename, + byte barr[]); + + public int getObjectItemId(String pagePath, String pageName); - public int createPage(String pagePath, String pageName, - Map attrs, User creator) + public int createObject(String pagePath, String pageName, + Map attrs, User creator) throws CobricksException; - public void updatePage(int itemid, Map attrs, User updater) + public void updateObject(int itemid, Map attrs, User updater) throws CobricksException; - public void deletePage(int itemid, String lang, User user) + public void deleteObject(int itemid, String lang, User user) throws CobricksException; public PortalStats getPortalStats(); + public void storeBinary(int itemid, String filename, String lang, + byte barr[]); + public String[] getBinaryLangs(int itemid); + public byte[] getBinary(int itemid, String lang, StringBuffer fname); + public List getPageUpdateHistory(int itemid, Date fromdate); public void addPageUpdateHistory(int itemid, int userid, String hostname, Date accdate); @@ -79,7 +87,7 @@ public void deleteFolder(int cid, User user) throws CobricksException; - public List searchPages(String searchExp, boolean searchInTitle); + public List searchObjects(String searchExp, boolean searchInTitle); public void writeLogEntry(String userlogin, String msg); Index: PortalStats.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalStats.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PortalStats.java 14 Oct 2004 05:52:12 -0000 1.6 +++ PortalStats.java 10 Feb 2006 11:36:15 -0000 1.7 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -16,7 +16,7 @@ import java.net.URL; import java.util.*; -import org.apache.log4j.*; +import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.ComponentDirectory; Index: itemontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/itemontology.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- itemontology.xml 1 Feb 2006 20:36:21 -0000 1.18 +++ itemontology.xml 10 Feb 2006 11:36:15 -0000 1.19 @@ -1,6 +1,6 @@ <itemontology> -<class name="portalpage" parent="item" javaclassname="org.cobricks.portal.PortalPage"> +<class name="portalobject" parent="item" javaclassname="org.cobricks.portal.PortalObject"> <description lang="de">Portalobjekt</description> <attr name="name" type="string(30)"/> <attr name="mimetype" type="string(20)"/> @@ -10,15 +10,19 @@ <attr name="readroles" type="string[]" /> <attr name="writeroles" type="string[]" /> </class> - -<class name="portalpagehtml" parent="portalpage"> + +<class name="portalfile" parent="portalobject" javaclassname="org.cobricks.portal.PortalObjectFile"> +<description lang="de">Portalobjekt</description> +</class> + +<class name="portalpage" parent="portalobject" javaclassname="org.cobricks.portal.PortalPage"> <description lang="de">Portalseite</description> <attr name="fullcontext" type="boolean"> <default>true</default> </attr> </class> -<class name="wikipage" parent="portalpagehtml"> +<class name="wikipage" parent="portalpage"> <description lang="de">Wikiseite</description> <attr name="content" type="text" multilanguage="true" versioned="true" /> </class> Index: PortalServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServlet.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- PortalServlet.java 2 Feb 2006 17:18:00 -0000 1.45 +++ PortalServlet.java 10 Feb 2006 11:36:15 -0000 1.46 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -15,6 +15,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.net.URL; +import java.net.URLConnection; import java.util.Date; import java.util.HashMap; import java.util.Iterator; @@ -109,6 +110,8 @@ this.addTarget("create", "performCreatePage", "", false); this.addTarget("update", "performUpdatePage", "", false); this.addTarget("delete", "performDeletePage", "", false); + this.addTarget("createbin", "performCreateObj", "", false); + this.addTarget("updatebin", "performUpdateObj", "", false); this.addTarget("createfolder", "performCreateFolder", "", false); this.addTarget("updatefolder", "performUpdateFolder", "", false); this.addTarget("deletefolder", "performDeleteFolder", "", false); @@ -329,17 +332,17 @@ attrs.put("fullcontext", fullcontext); } - //Set the itemclass + // Set the itemclass String itemclass = prequest.getRequestParameter("itemclass"); if(itemclass == null) { - itemclass = "portalpagehtml"; + itemclass = "portalpage"; } attrs.put("itemclass", itemclass); try { int itemid = - portalManager.createPage(pagepath, pagename, attrs, - portalUser.getUser()); + portalManager.createObject(pagepath, pagename, attrs, + portalUser.getUser()); String hostname = request.getRemoteHost(); if (hostname == null) @@ -378,7 +381,7 @@ } try { - portalManager.deletePage(itemid, lang, portalUser.getUser()); + portalManager.deleteObject(itemid, lang, portalUser.getUser()); } catch (Exception e) { logger.error(LogUtil.ex("Failed deleting page.", e)); prequest.setReturnCode(2102); @@ -413,7 +416,7 @@ HttpServletRequest request = prequest.getHttpServletRequest(); - PortalPage page = portalManager.getPage(itemid); + PortalObject page = portalManager.getObject(itemid); Map attrs = new HashMap(); String lang[] = prequest.getRequestParameterValues("plang"); @@ -487,7 +490,7 @@ } else { attrs.put("newContentVersion", "false"); } - portalManager.updatePage(itemid, attrs, portalUser.getUser()); + portalManager.updateObject(itemid, attrs, portalUser.getUser()); String hostname = request.getRemoteHost(); if (hostname == null) @@ -508,6 +511,188 @@ /** * */ + public String performCreateObj(PortalRequest prequest, PrintWriter out) + throws PortalCompletedException + { + logger.debug("performCreateBin()"); + + // check access rights + PortalUser portalUser = prequest.getPortalUser(); + if (!userManager.getAccessControl().checkPermission(portalUser + .getUserId(), "page", "create", null)) { + prequest.setReturnCode(2000); + return "noaccess"; + } + + // get the uploaded file + HttpServletRequest request = prequest.getHttpServletRequest(); + Object upload = request.getAttribute("_file"); + if (upload == null) { + logger.warn("no file uploaded"); + prequest.setReturnCode(2101); + return "error"; + } + if (!(upload instanceof FileItem)) { + logger.warn("no file uploaded - "+upload.getClass().getName()); + prequest.setReturnCode(2101); + return "error"; + } + + FileItem uploadFile = (FileItem)upload; + String contentType = uploadFile.getContentType(); + int size = (int)uploadFile.getSize(); + byte[] data = uploadFile.get(); + + // get mandatory parameters from HTTP request + String pagepath = prequest.getRequestParameter("ppath"); + String pagename = prequest.getRequestParameter("pname"); + String uploadFileName = uploadFile.getName(); + String mimetype = + URLConnection.guessContentTypeFromName(uploadFileName); + logger.info("!!! filename="+uploadFileName+", mime="+mimetype); + if (pagename == null || pagename.trim().length()<1) { + pagename = uploadFileName; + } + else if (pagename.indexOf(".")<1) { + String tmps = uploadFile.getName(); + int pos = tmps.lastIndexOf("."); + if (pos >= 0) { + pagename += tmps.substring(pos); + } + } + String lang = prequest.getRequestParameter("plang"); + + // get optional parameters from HTTP request + String storedb = prequest.getRequestParameter("storedb"); + + if (storedb != null) { + // store the binary object in the database + // and create an item for it + Map attrs = new HashMap(); + attrs.put("mimetype", mimetype); + attrs.put("title", pagename); + // set the itemclass + String itemclass = prequest.getRequestParameter("itemclass"); + if(itemclass == null) { + itemclass = "portalfile"; + } + attrs.put("itemclass", itemclass); + try { + int itemid = + portalManager.createObject(pagepath, pagename, attrs, + portalUser.getUser()); + // store object + if (itemid > 0) { + logger.info("!!! storing "+data.length+" bytes"); + portalManager.storeBinary(itemid, pagename, lang, data); + } + + String hostname = request.getRemoteHost(); + if (hostname == null) + hostname = request.getRemoteAddr(); + portalManager. + addPageUpdateHistory(itemid, portalUser.getUserId(), + hostname, new Date()); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed creating object.", e)); + prequest.setReturnCode(2101); + return "error"; + } + } else { + // store the binary object as file in the webspace + portalManager.saveFileToFilesystem(pagepath, pagename, data); + } + + prequest.setReturnCode(1101); + return "success"; + } + + + /** + * + */ + public String performUpdateObj(PortalRequest prequest, PrintWriter out) + throws PortalCompletedException + { + logger.debug("performUpdateBin()"); + + // check access rights + PortalUser portalUser = prequest.getPortalUser(); + if (!userManager.getAccessControl().checkPermission(portalUser + .getUserId(), "page", "update", null)) { + prequest.setReturnCode(2000); + return "noaccess"; + } + + // get the uploaded file + HttpServletRequest request = prequest.getHttpServletRequest(); + Object upload = request.getAttribute("_file"); + if (upload == null) { + logger.warn("no file uploaded"); + prequest.setReturnCode(2101); + return "error"; + } + if (!(upload instanceof FileItem)) { + logger.warn("no file uploaded - "+upload.getClass().getName()); + prequest.setReturnCode(2101); + return "error"; + } + + FileItem uploadFile = (FileItem)upload; + String contentType = uploadFile.getContentType(); + int size = (int)uploadFile.getSize(); + byte[] data = uploadFile.get(); + + // get mandatory parameters from HTTP request + String itemidstring = prequest.getRequestParameter("itemid"); + int itemid = 0; + try { + itemid = Integer.parseInt(itemidstring); + } catch (Exception e) { } + String pagename = prequest.getRequestParameter("pname"); + if (pagename == null || pagename.trim().length()<1) { + pagename = uploadFile.getName(); + } + else if (pagename.indexOf(".")<1) { + String tmps = uploadFile.getName(); + int pos = tmps.lastIndexOf("."); + if (pos >= 0) { + pagename += tmps.substring(pos+1); + } + } + String lang = prequest.getRequestParameter("plang"); + + // store the binary object in the database + // and update the item for it + Map attrs = new HashMap(); + try { + // TBD + + // store object + if (itemid > 0) { + portalManager.storeBinary(itemid, pagename, lang, data); + } + + String hostname = request.getRemoteHost(); + if (hostname == null) + hostname = request.getRemoteAddr(); + portalManager. + addPageUpdateHistory(itemid, portalUser.getUserId(), + hostname, new Date()); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed updating object.", e)); + prequest.setReturnCode(2101); + return "error"; + } + + prequest.setReturnCode(1101); + return "success"; + } + + + /** + * + */ public String performCreateFolder(PortalRequest prequest, PrintWriter out) throws PortalCompletedException { Index: MultipartFilter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/MultipartFilter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MultipartFilter.java 2 Feb 2006 11:39:26 -0000 1.3 +++ MultipartFilter.java 10 Feb 2006 11:36:15 -0000 1.4 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -30,7 +30,7 @@ import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUpload; import org.apache.commons.fileupload.FileUploadException; -import org.apache.log4j.*; +import org.apache.log4j.Logger; import org.cobricks.core.util.LogUtil; --- NEW FILE: PortalCache.java --- /* * Copyright (c) 2004-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.org). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.portal; import java.util.HashMap; import java.util.Map; import java.util.Iterator; import org.apache.log4j.Logger; /** * Class for caching PortalObject objects. * * @author mic...@ac... * @version $Date: 2006/02/10 11:36:15 $ */ public class PortalCache { static Logger logger = Logger.getLogger(PortalCache.class); Map pathCache = null; Map itemidCache = null; boolean active = true; /** * */ public PortalCache() { pathCache = new HashMap(); itemidCache = new HashMap(); } public void inactivate() { active = false; } public PortalObject getObject(String path, String name) { if (!active) return null; String key = path+"/"+name; return (PortalObject)pathCache.get(key); } public PortalObject getObject(int itemid) { if (!active) return null; // tbd: when this works with the itemmanager, then rely on // itemmanager cache ... return (PortalObject)itemidCache.get(new Integer(itemid)); } public void setObject(PortalObject p) { if (!active) return; String key = p.getPagePath()+"/"+p.getPageName(); pathCache.put(key, p); if (p.getId()>0) { itemidCache.put(new Integer(p.getId()), p); } // page objects cache garbage collection int cacheSize = pathCache.size(); if (cacheSize % 10 == 0) logger.info("Portal objects cache size is "+cacheSize); if (cacheSize > 500) { logger.info("Portal objects cache size is bigger than limit (" +cacheSize+")"); int toDelete = cacheSize - 300; Iterator iter = pathCache.keySet().iterator(); for (int i=0; i<toDelete; i++) { Object key2 = iter.next(); pathCache.remove(key2); } logger.info("Portal objects cache reduced to "+pathCache.size() +" entries"); } } public void removeObject(int itemid) { if (!active) return; itemidCache.remove(new Integer(itemid)); } /** * Clear the cache */ public void clear() { pathCache = new HashMap(); itemidCache = new HashMap(); } } Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- PortalPresenter.java 2 Feb 2006 11:39:26 -0000 1.35 +++ PortalPresenter.java 10 Feb 2006 11:36:15 -0000 1.36 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -193,7 +193,13 @@ pageName = filename; } } - PortalPage page = portalManager.getPage(pagePath, pageName); + PortalObject o = portalManager.getObject(pagePath, pageName); + if (!(o instanceof PortalPage)) { + logger.warn("Wrong type of portal object for " + +pagePath+pageName); + return ""; + } + PortalPage page = (PortalPage)o; Map pc = page.getStringPageContent(lang); if (pc == null || pc.size()<1) return ""; @@ -370,17 +376,22 @@ /** * Return a PortalPage object by the itemid which is given as String */ - public PortalPage getPage(String itemid) + public PortalObject getObject(String itemid) { int id = 0; try { id = Integer.parseInt(itemid); - return portalManager.getPage(id); + return portalManager.getObject(id); } catch (Exception e) { } return null; } + public PortalObject getPage(String itemid) + { + return getObject(itemid); + } + /** * Print some header information for html pages. This function * will be called in the Velocity header files. @@ -415,10 +426,11 @@ { StringBuffer sb = new StringBuffer(""); String lang = portalRequest.getPageLang(); - PortalPage page = portalManager.getPage(portalRequest.getPagePath(), - portalRequest.getPageName()); - if (page!=null) { - List languages = page.getLanguages(); + PortalObject page = portalManager. + getObject(portalRequest.getPagePath(), + portalRequest.getPageName()); + if (page!=null && (page instanceof PortalPage)) { + List languages = ((PortalPage)page).getLanguages(); ListIterator i = languages.listIterator(); while (i.hasNext()) { String tmps = (String)i.next(); @@ -662,7 +674,7 @@ public final String printOption(String label, String labelval, String val) { StringBuffer result = - new StringBuffer("<option value=\"" + labelval + "\">"); + new StringBuffer("<option value=\"" + labelval + "\""); if (labelval.equals(val)) { result.append(" selected=\"true\""); } --- NEW FILE: PortalObject.java --- /* * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.org). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.portal; import java.io.File; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.util.LogUtil; import org.cobricks.user.User; /** * Class for storing portal objects. The class is derived from Item, * since web objects are a special class of item (if they are stored in * the database). If the web object is not available in the database * the itemid in the object will be 0. * * @author mic...@ac... * @version $Date: 2006/02/10 11:36:15 $ */ public class PortalObject extends org.cobricks.item.Item { static Logger logger = Logger.getLogger(PortalObject.class); String pageName = null; String pagePath = null; Set pagePaths = null; String mimetype = null; Map pageTitles = new HashMap(); // lang - pagetitle String possibleLangs[] = {"de","en","fr","en","es"}; /** * */ public PortalObject() { super(); } public PortalObject(String pagePath, String pageName, String defaultLang) { super(); if (defaultLang!=null) this.defaultLanguage = defaultLang; this.pagePath = pagePath; if (pagePath == null) pagePath = "/"; this.pageName = pageName; setMimeTypeFromPageName(pageName); this.initAttrs(); } /** * */ public void postInit() { String mtype = (String)getAttribute("mimetype"); if (mtype != null) { mimetype = mtype; } String name = (String)getAttribute("name"); if (name != null) { pageName = name; if (mimetype == null) setMimeTypeFromPageName(name); } } public void postInit(CoreManager coreManager) { String mtype = (String)getAttribute("mimetype"); if (mtype != null) { mimetype = mtype; } String name = (String)getAttribute("name"); if (name != null) { pageName = name; if (mimetype == null) setMimeTypeFromPageName(name); } pagePaths = new HashSet(); Set folders = (Set)getAttribute("folders"); Iterator i = folders.iterator(); while (i.hasNext()) { Object o = i.next(); if (o instanceof Integer) { PortalManager portalManager = (PortalManager) coreManager. getComponentDirectory().getManager("portalManager"); o = portalManager.getPortalFolder(((Integer)o).intValue()); } PortalFolder pf = (PortalFolder)o; String path = pf.getPath(); pagePaths.add(path); pagePath = path; } } /** * */ public String[] getPagePaths() { String[] result = new String[pagePaths.size()]; Iterator it = pagePaths.iterator(); for (int i=0; i<pagePaths.size(); i++) { result[i] = (String)it.next(); } return result; } public String getPagePath() { if (pagePath == null) { if (pagePaths != null) pagePath = (String)(pagePaths.iterator().next()); } return pagePath; } public void addPagePath(String pagePath) { this.pagePaths.add(pagePath); if (this.pagePath == null) this.pagePath = pagePath; } public void removePagePath(String pagePath) { this.pagePaths.remove(pagePath); if (this.pagePath != null) { if (this.pagePath.equals(pagePath)) { this.pagePath = null; } } } public String getPageName() { if (pageName == null) { pageName = getAttributeAsString("name"); } return pageName; } public void setPageName(String pageName) { this.pageName = pageName; setAttribute("name", pageName); if (this.mimetype == null) setMimeTypeFromPageName(pageName); } public String getMimeType() { return mimetype; } public void setMimeTypeFromPageName(String pageName) { if (mimetype!=null) return; this.mimetype = getMimeTypeFromPageName(pageName); } static public String getMimeTypeFromPageName(String pageName) { String mimetype = URLConnection.guessContentTypeFromName(pageName); // guessContentTypeFromName() did not return a result, we use // simple suffix heuristics if (mimetype == null) { mimetype = "text/html"; String suffix = ""; int pos = pageName.lastIndexOf("."); if (pos > -1) { suffix = pageName.substring(pos+1); suffix = suffix.toLowerCase(); suffix = suffix.trim(); if (suffix.equals("html")) { mimetype = "text/html"; } if (suffix.equals("htm")) { mimetype = "text/html"; } if (suffix.equals("txt")) { mimetype = "text/plain"; } if (suffix.equals("css")) { mimetype = "text/css"; } if (suffix.equals("xml")) { mimetype = "text/xml"; } if (suffix.equals("rdf")) { mimetype = "text/rdf"; } if (suffix.equals("csv")) { mimetype = "text/csv"; } } } return mimetype; } public void setMimeType(String mimetype) { this.mimetype = mimetype; } public String getTitle(String lang) { String title = getAttributeAsString("title_" + lang); // if the page wasn't found in the requested language // check whether there exists a title in another language if (title == null || title.equals("")) { Iterator i = pageTitles.keySet().iterator(); if (i.hasNext()) { String la = (String) i.next(); title = (String) pageTitles.get(la); } } return title; } public void setTitle(String lang, String title) { lang = lang.toLowerCase(); this.setAttribute("title_"+lang,title); pageTitles.put(lang, title); } public Object getPageContent(String lang) { return null; } public void updateFromMap(Map map) { super.updateFromMap(map); initAttrs(); } /** * Initialize the pageTitles attribute from the attrs table */ public void initAttrs() { Iterator i = attrs.keySet().iterator(); while (i.hasNext()) { String aname = (String)i.next(); if (aname.startsWith("title_")) { pageTitles.put(aname.substring(6), (String)attrs.get(aname)); } } } /** * */ public void loadFromFiles(String[] filenames, File dir) { } /** * Check if the content of a given language has been loaded from * the database or from the file system. */ public boolean isFromDatabase(String lang) { return false; } /** * */ public boolean exists() { return true; } /** * */ public String toString() { StringBuffer sb = new StringBuffer("portalobject("); sb.append(pagePath); sb.append(pageName); sb.append(")"); return sb.toString(); } } Index: PortalPage.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPage.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- PortalPage.java 22 Aug 2005 13:52:07 -0000 1.23 +++ PortalPage.java 10 Feb 2006 11:36:15 -0000 1.24 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -12,6 +12,9 @@ package org.cobricks.portal; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -27,31 +30,19 @@ import org.cobricks.user.User; /** - * Class for storing (web) pages. The class is derived from Item, since - * web pages are a special class of item (if they are stored in the - * database). If the page is not available in the database the itemid - * in the object will be 0. + * Class for storing web pages. * * @author mic...@ac... * @version $Date$ */ -public class PortalPage extends org.cobricks.item.Item +public class PortalPage extends PortalObject { static Logger logger = Logger.getLogger(PortalPage.class); - String pageName = null; - String pagePath = null; - Set pagePaths = null; - Map pageContents = new HashMap(); // lang - String content Map pageContentSource = new HashMap(); // lang - "file:*"|"item:*" - Map pageTitles = new HashMap(); // lang - pagetitle - - PortalManager portalManager; - - String possibleLangs[] = {"de","en","fr","en","es"}; /** @@ -64,13 +55,7 @@ public PortalPage(String pagePath, String pageName, String defaultLang) { - super(); - if (defaultLang!=null) - this.defaultLanguage = defaultLang; - this.initPageContent(); - this.pagePath = pagePath; - if (pagePath == null) pagePath = "/"; - this.pageName = pageName; + super(pagePath, pageName, defaultLang); } @@ -79,109 +64,18 @@ */ public void postInit() { - String name = (String)getAttribute("name"); - if (name != null) pageName = name; + super.postInit(); } public void postInit(CoreManager coreManager) { - pagePaths = new HashSet(); - Set folders = (Set)getAttribute("folders"); - Iterator i = folders.iterator(); - while (i.hasNext()) { - Object o = i.next(); - if (o instanceof Integer) { - PortalManager portalManager = (PortalManager) coreManager. - getComponentDirectory().getManager("portalManager"); - o = portalManager.getPortalFolder(((Integer)o).intValue()); - } - PortalFolder pf = (PortalFolder)o; - String path = pf.getPath(); - pagePaths.add(path); - pagePath = path; - } + super.postInit(coreManager); } /** * */ - public String[] getPagePaths() - { - String[] result = new String[pagePaths.size()]; - Iterator it = pagePaths.iterator(); - for (int i=0; i<pagePaths.size(); i++) { - result[i] = (String)it.next(); - } - return result; - } - - public String getPagePath() - { - if (pagePath == null) { - if (pagePaths != null) - pagePath = (String)(pagePaths.iterator().next()); - } - return pagePath; - } - - public void addPagePath(String pagePath) - { - this.pagePaths.add(pagePath); - if (this.pagePath == null) - this.pagePath = pagePath; - } - - public void removePagePath(String pagePath) - { - this.pagePaths.remove(pagePath); - if (this.pagePath != null) { - if (this.pagePath.equals(pagePath)) { - this.pagePath = null; - } - } - } - - public String getPageName() - { - if (pageName == null) { - pageName = getAttributeAsString("name"); - } - return pageName; - } - - public void setPageName(String pageName) - { - this.pageName = pageName; - setAttribute("name", pageName); - } - - - public String getTitle(String lang) - { - String title = getAttributeAsString("title_" + lang); - - // if the page wasn't found in the requested language - // check whether there exists a title in another language - if (title == null || title.equals("")) { - Iterator i = pageTitles.keySet().iterator(); - if (i.hasNext()) { - String la = (String) i.next(); - title = (String) pageTitles.get(la); - } - } - - return title; - } - - public void setTitle(String lang, String title) - { - lang = lang.toLowerCase(); - this.setAttribute("title_"+lang,title); - pageTitles.put(lang, title); - } - - public Object getPageContent(String lang) { return pageContents.get(lang); @@ -246,17 +140,11 @@ } - public void updateFromMap(Map map) - { - super.updateFromMap(map); - initPageContent(); - } - - /** - * Initialize the pageContents attribute from the attrs table + * Initialize the pageTitles and pageContents attributes from + * the attrs table */ - public void initPageContent() + public void initAttrs() { Iterator i = attrs.keySet().iterator(); while (i.hasNext()) { @@ -273,7 +161,7 @@ } } - + /** * */ @@ -339,6 +227,51 @@ /** + * + */ + public void loadFromFiles(String[] filenames, File dir) + { + for (int i=0; i<filenames.length; i++) { + // first load the files contents + StringBuffer content = new StringBuffer(""); + try { + File file = new File(dir, filenames[i]); + BufferedReader in = + new BufferedReader(new FileReader(file)); + while (true) { + String tmps = in.readLine(); + if (tmps == null) break; + content.append(tmps); + content.append("\n"); + } + } catch (Exception e) { + logger.warn("failed loading file " + +filenames[i]+": "+e.getMessage()); + } + // store the contents + String lang = "default"; + if (filenames[i].length()>pageName.length()) + lang = filenames[i].substring(pageName.length()+1); + // store contents if there is not already something + // in the pageContents map (e.g. from loadFromDatabase()) + String contents = (String)this.getPageContent(lang); + if (contents==null || contents.trim().length()<1) { + // if the contents from the database are empty, then + // also get the contents from the file - but keep + // the reference to the database (for updates) + if (this.getPageContent(lang)==null) { + this.setPageContent(lang, content.toString(), + "file:"+dir.toString()+"/" + +filenames[i]); + } else { + this.setPageContent(lang, content.toString(), null); + } + } + } // for (int i=0; ... + } + + + /** * Check if the content of a given language has been loaded from * the database or from the file system. */ --- PageCache.java DELETED --- --- NEW FILE: PortalObjectFile.java --- /* * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.org). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.portal; import java.io.File; import java.io.FileInputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.util.IOUtil; import org.cobricks.core.util.LogUtil; import org.cobricks.user.User; /** * * @author mic...@ac... * @version $Date: 2006/02/10 11:36:15 $ */ public class PortalObjectFile extends PortalObject { static Logger logger = Logger.getLogger(PortalObjectFile.class); Map objContents = new HashMap(); // lang - byte[] content Map objContentSource = new HashMap(); // lang - "file:*"|"item:*" /** * */ public PortalObjectFile() { super(); } public PortalObjectFile(String pagePath, String pageName, String defaultLang) { super(pagePath, pageName, defaultLang); } /** * */ public void postInit() { super.postInit(); } public void postInit(CoreManager coreManager) { super.postInit(coreManager); } /** * */ public Object getPageContent(String lang) { Object o = objContents.get(lang); if (o == null && objContents.size()>0) o = ((objContents.values()).iterator()).next(); return o; } public void setPageContent(String lang, Object content) { if (content instanceof byte[]) { objContents.put(lang, content); objContentSource.put(lang, "item"); } } public void setPageContent(String lang, Object content, Object source) { if (source!=null && source.equals("item")) setPageContent(lang, content); else { // just update the local caches - for pages from file system objContents.put(lang, content); if (source != null) objContentSource.put(lang, source); } } /** * */ public void loadFromFiles(String[] filenames, File dir) { for (int i=0; i<filenames.length; i++) { try { File file = new File(dir, filenames[i]); String lang = "default"; if (filenames[i].length()>pageName.length()) lang = filenames[i].substring(pageName.length()+1); try { byte[] content = IOUtil.readFully(new FileInputStream(file)); this.setPageContent(lang, content, "file:"+dir.toString()+"/" +filenames[i]); } catch(Exception e) { logger.warn(LogUtil.ex("Failed loading file "+file, e)); } } catch (Exception e) { logger.warn("failed loading file " +filenames[i]+": "+e.getMessage()); } } // for (int i=0; ... } /** * Check if the content of a given language has been loaded from * the database or from the file system. */ public boolean isFromDatabase(String lang) { if (lang==null) lang = "default"; Object source = objContentSource.get(lang); if (source == null) return false; if (source instanceof String) { if (source.equals("item")) return true; else return false; } else { return true; } } /** * */ public boolean exists() { if (objContents==null || objContents.size()<1) return false; return true; } /** * */ public String toString() { StringBuffer sb = new StringBuffer("portalobject("); sb.append(pagePath); sb.append(pageName); sb.append(","); Iterator i = objContentSource.keySet().iterator(); while (i.hasNext()) { String lang = (String)i.next(); sb.append(lang); if (i.hasNext()) sb.append(","); } sb.append(")"); return sb.toString(); } } Index: PortalServletAdaptor.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServletAdaptor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- PortalServletAdaptor.java 11 Aug 2005 11:20:17 -0000 1.17 +++ PortalServletAdaptor.java 10 Feb 2006 11:36:15 -0000 1.18 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -18,7 +18,7 @@ import javax.servlet.*; import javax.servlet.http.*; -import org.apache.log4j.*; +import org.apache.log4j.Logger; import org.cobricks.core.CoreManager; import org.cobricks.core.ComponentDirectory; Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- PortalManagerImpl.java 3 Feb 2006 15:37:17 -0000 1.76 +++ PortalManagerImpl.java 10 Feb 2006 11:36:15 -0000 1.77 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -15,8 +15,10 @@ import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.FilenameFilter; +import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.InputStream; @@ -95,7 +97,7 @@ static Logger logger = Logger.getLogger(PortalManagerImpl.class); static String COMP_NAME = "Cobricks-2 Portal Component"; - static String COMP_VERSION = "V0.3 (Aug. 2005)"; + static String COMP_VERSION = "V0.4 (Feb. 2006)"; static String ROOTPORTALFOLDER = "ROOT"; @@ -113,7 +115,7 @@ protected VelocityContext velocityRootContext = null; - protected PageCache pageCache = null; + protected PortalCache portalCache = null; protected AccessControl accessControl; protected SessionHandler sessionHandler; @@ -136,6 +138,9 @@ protected Map portalFoldersByPath; protected String logfilename; + + // names of all itemclasses that are children of wikipage + Set wikiOntologyClasses = new HashSet(); /** @@ -144,7 +149,7 @@ public PortalManagerImpl() { super(); - pageCache = new PageCache(); + portalCache = new PortalCache(); portalFolders = new HashMap(); portalFoldersByPath = new HashMap(); } @@ -165,7 +170,7 @@ */ public void resetCache() { - pageCache.clear(); + portalCache.clear(); portalFolders = new HashMap(); portalFoldersByPath = new HashMap(); pageItemIdCache = new HashMap(); @@ -210,87 +215,115 @@ /** - * Get a PortalPage object for the given pagePath / pageName. + * Get a portal object for the given pagePath / pageName. * There are two possibilities for successfully loading pages: * - the page exists in the database (there is an item for the page) * - the page exists in the webspace only (no item) * The difference shows in the itemid (=0 or >0) */ - public PortalPage getPage(String pagePath, String pageName) + public PortalObject getObject(String pagePath, String pageName) { if (pagePath == null) pagePath = "/"; if (pageName == null) pageName = "index.html"; - PortalPage p = pageCache.getPage(pagePath, pageName); + PortalObject p = portalCache.getObject(pagePath, pageName); if (p == null) { - int itemid = getPageItemId(pagePath, pageName); + int itemid = getObjectItemId(pagePath, pageName); if (itemid > 0) { // load data from database - p = loadPageFromDatabase(itemid); - if (p == null) p = new PortalPage(); - // add file system content (webspace directory) - loadPageFromFilesystem(p); - } else { - p = new PortalPage(pagePath, pageName, defaultLanguage); - // add file system content (webspace directory) - loadPageFromFilesystem(p); + p = loadObjectFromDatabase(itemid); + if (p!=null) + loadObjectFromFilesystem(p); + } + if (p == null) { + String mimetype = + PortalObject.getMimeTypeFromPageName(pageName); + if (mimetype.startsWith("text")) + p = new PortalPage(pagePath, pageName, defaultLanguage); + else + p = new PortalObjectFile(pagePath, pageName, + defaultLanguage); + loadObjectFromFilesystem(p); } if (p != null) - pageCache.setPage(p); + portalCache.setObject(p); } return p; } - + public PortalObject getPage(String pagePath, String pageName) + { + return getObject(pagePath, pageName); + } + + /** - * Get a PortalPage object for the given itemid. In this case the page + * Get a portal object for the given itemid. In this case the page * must exist in the database (there is an item for the page). * Otherwise, no result (NULL) is returned. */ - public PortalPage getPage(int itemid) + public PortalObject getObject(int itemid) { if (itemid < 1) return null; - PortalPage p = pageCache.getPage(itemid); + PortalObject p = portalCache.getObject(itemid); if (p == null) { // load data from database - p = loadPageFromDatabase(itemid); + p = loadObjectFromDatabase(itemid); if (p!=null) - pageCache.setPage(p); + portalCache.setObject(p); } return p; } + public PortalObject getPage(int itemid) + { + return getObject(itemid); + } + /** * Try to load the contents for the given itemid from the database. */ - public PortalPage loadPageFromDatabase(int itemid) + public PortalObject loadObjectFromDatabase(int itemid) { if (itemid < 1) return null; - logger.info("Getting page item "+itemid+" from database"); + logger.info("Getting object item "+itemid+" from database"); try { Object o = itemManager.getItem(itemid); - if (!(o instanceof PortalPage)) { - logger.warn("object class of portal page object is " + if (!(o instanceof PortalObject)) { + logger.warn("object class of portal object is " +o.getClass().getName()); return null; } - PortalPage result = (PortalPage)o; - // explicitly set content - result.initPageContent(); + PortalObject result = (PortalObject)o; + result.initAttrs(); + + // if it is a binary object, then set the content + String itemclass = result.getItemClass(); + // TBD: also true for itemclass derived ffrom portalfile ... + if (itemclass.equals("portalfile")) { + List res = getBinary(itemid); + Iterator i = res.iterator(); + while (i.hasNext()) { + Map m = (Map)i.next(); + String lang = (String)m.get("lang"); + Object content = m.get("content"); + ((PortalObjectFile)result).setPageContent(lang, content); + } + } return result; } catch (Exception e) { - logger.warn(LogUtil.ex("Failed loading PortalPage object", e)); + logger.warn(LogUtil.ex("Failed loading portal object", e)); } return null; } /** - * Try to load the contents for the given pagePath, pageName combination - * from the filesystem .. and store the results in the PortalPage object + * Try to load the object for the given pagePath, pageName combination + * from the filesystem .. and store the results in the portal object * (if there are not already entries in the object) */ - public void loadPageFromFilesystem(PortalPage p) + public void loadObjectFromFilesystem(PortalObject p) { String dirname = webspaceDir; String pagePath = p.getPagePath(); @@ -302,50 +335,16 @@ dirname += pagePath; } try { - FilenameFilter filenameFilter = new PortalFilenameFilter(pageName); + // check for all language versions ... + FilenameFilter filenameFilter = + new PortalFilenameFilter(pageName); File dir = new File(dirname); if (dir.isDirectory()) { String[] filenames = dir.list(filenameFilter); if (filenames != null) { - for (int i=0; i<filenames.length; i++) { - // first load the files contents - StringBuffer content = new StringBuffer(""); - try { - File file = new File(dir, filenames[i]); - BufferedReader in = - new BufferedReader(new FileReader(file)); - while (true) { - String tmps = in.readLine(); - if (tmps == null) break; - content.append(tmps); - content.append("\n"); - } - } catch (Exception e) { - logger.warn("failed loading file " - +filenames[i]+": "+e.getMessage()); - } - // store the contents - String lang = "default"; - if (filenames[i].length()>pageName.length()) - lang = filenames[i].substring(pageName.length()+1); - // store contents if there is not already something - // in the pageContents map (e.g. from loadFromDatabase()) - String contents = (String)p.getPageContent(lang); - if (contents==null || contents.trim().length()<1) { - // if the contents from the database are empty, then - // also get the contents from the file - but keep - // the reference to the database (for updates) - if (p.getPageContent(lang)==null) { - p.setPageContent(lang, content.toString(), - "file:"+dir.toString()+"/" - +filenames[i]); - } else { - p.setPageContent(lang, content.toString(), null); - } - } - } // for (int i=0; ... - } // if (filenames != null) - } // if (dir.isDirectory()) + p.loadFromFiles(filenames, dir); + } + } } catch (Exception e) { logger.error(LogUtil. exception("Failed loading page template from " @@ -355,10 +354,33 @@ /** + * + */ + public void saveFileToFilesystem(String pagepath, String pagename, + byte barr[]) + { + String tmps = webspaceDir; + if (tmps.endsWith(File.separator)) + tmps = tmps.substring(0, tmps.length()-1); + File file = new File(tmps+pagepath+pagename); + FileOutputStream fos = null; + try { + fos = new FileOutputStream(file); + fos.write(barr); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed writing file", e)); + } finally { + if (fos != null) + try { fos.close(); } catch (Exception ex) { } + } + } + + + /** * Check the access permission of the file. * The possible actions are "read" or "write". */ - protected boolean checkAccessPermission(PortalPage page, + protected boolean checkAccessPermission(PortalObject page, PortalUser portalUser, String action) { @@ -392,67 +414,23 @@ String pagePath = portalRequest.getPagePath(); String pageName = portalRequest.getPageName(); String lang = portalRequest.getLang(); - PortalPage page = getPage(pagePath, pageName); + PortalObject page = getObject(pagePath, pageName); // check if it is a text file or a binary one ... - String mimetype = URLConnection.guessContentTypeFromName(pageName); + String mimetype = page.getMimeType(); logger.info("mimetype of request = "+mimetype); - if (mimetype == null) { - mimetype = "text/html"; - // guessContentTypeFromName() did not return a result, we use - // simple suffix heuristics - String suffix = ""; - int pos = pageName.lastIndexOf("."); - if (pos > -1) { - suffix = pageName.substring(pos+1); - suffix = suffix.toLowerCase(); - suffix = suffix.trim(); - if (suffix.equals("html")) { - mimetype = "text/html"; - } - if (suffix.equals("htm")) { - mimetype = "text/html"; - } - if (suffix.equals("txt")) { - mimetype = "text/plain"; - } - if (suffix.equals("css")) { - mimetype = "text/css"; - } - if (suffix.equals("xml")) { - mimetype = "text/xml"; - } - if (suffix.equals("rdf")) { - mimetype = "text/rdf"; - } - if (suffix.equals("csv")) { - mimetype = "text/csv"; - } - } - } // if it is a text page, then user printPage() if (mimetype.startsWith("text")) { - printPage(portalRequest, out); + printPage(portalRequest, page, out); return; } - // ... otherwise send file directly + // ... otherwise send file content directly logger.info("identified non text file ... "+mimetype); - // check access rights - boolean access = true; - // TBD - if (!access) { - pagePath = "/"; - pageName = "noaccess.html"; - page = getPage(pagePath, pageName); - printPage(portalRequest, page, out); - return; - } - - Object o = page.getPageContent(lang); - if (o == null) { + Object content = page.getPageContent(lang); + if (content == null) { logger.warn("Failed getting content for page "+pagePath+pageName +","+lang+" - loading "+notFoundPath); pagePath = notFoundPath; @@ -462,33 +440,28 @@ pageName = pagePath.substring(pos+1); pagePath = pagePath.substring(0, pos+1); } - page = getPage(pagePath, pageName); + page = getObject(pagePath, pageName); printPage(portalRequest, page, out); return; } - // TBD: return content ... + ... [truncated message content] |
|
From: Michael K. <ko...@us...> - 2006-02-10 11:36:23
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/velocity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11203/velocity Modified Files: PortalResourceLoader.java Log Message: changed web object support in Portal Component to make binary objects possible Index: PortalResourceLoader.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/velocity/PortalResourceLoader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PortalResourceLoader.java 5 Aug 2005 11:25:49 -0000 1.6 +++ PortalResourceLoader.java 10 Feb 2006 11:36:15 -0000 1.7 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -16,7 +16,7 @@ import java.util.*; import org.apache.commons.collections.ExtendedProperties; -import org.apache.log4j.*; +import org.apache.log4j.Logger; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.runtime.resource.Resource; @@ -27,6 +27,7 @@ import org.cobricks.core.CoreManager; import org.cobricks.core.util.LogUtil; import org.cobricks.portal.PortalFolder; +import org.cobricks.portal.PortalObject; import org.cobricks.portal.PortalPage; import org.cobricks.portal.PortalManager; @@ -85,11 +86,13 @@ pagePath = pageName.substring(0, pos+1); pageName = pageName.substring(pos+1); } - PortalPage page = portalManager.getPage(pagePath, pageName); + PortalObject page = portalManager.getObject(pagePath, pageName); if (page != null) { - Map pc = page.getStringPageContent(null); - String pageLang = (String)pc.keySet().iterator().next(); - content = (String)pc.get(pageLang); + if (page instanceof PortalPage) { + Map pc = ((PortalPage)page).getStringPageContent(null); + String pageLang = (String)pc.keySet().iterator().next(); + content = (String)pc.get(pageLang); + } } } if (content != null) { @@ -102,7 +105,8 @@ // check if the resource can be found in the // package org.cobricks.portal.velocity try { - String resourcename = "/org/cobricks/portal/velocity/"+templateName; + String resourcename = + "/org/cobricks/portal/velocity/"+templateName; InputStream is = this.getClass().getResourceAsStream(resourcename); if (is != null) return is; } |
|
From: Michael K. <ko...@us...> - 2006-02-10 11:33:40
|
Update of /cvsroot/cobricks/cobricks2/web/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10360/portal Modified Files: create.html.en edit.html.en index.html.en list.html.en listwiki.html.en Added Files: createbin.html.en editbin.html.en listbin.html.en Log Message: new ui for creating and editing binary web objects Index: list.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/list.html.en,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- list.html.en 16 Jan 2006 09:26:54 -0000 1.7 +++ list.html.en 10 Feb 2006 11:33:21 -0000 1.8 @@ -16,9 +16,7 @@ List of HTML pages stored in the item database: <ul> -#foreach( $i in $itemManager.searchItems("/item[itemclass='portalpagehtml']") ) -$i -<br> +#foreach( $i in $itemManager.searchItems("/item[itemclass='portalpage']") ) <li><a href="$i.getPagePath()$i.getPageName()">$i.getAttribute("name")</a>, id=$i.getId() - <a href="edit.html?itemid=$i.getId()">edit</a> - <a href="delete.html?itemid=$i.getId()">delete</a></li> Index: edit.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/edit.html.en,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- edit.html.en 31 Jan 2006 20:04:42 -0000 1.11 +++ edit.html.en 10 Feb 2006 11:33:21 -0000 1.12 @@ -91,7 +91,7 @@ <a href="wikihelp.html" target="_blank">Help for Wiki</a> </p> #if ($userId == $page.getAttributeAsString("creator")) -<input type="checkbox" name="newContentVersion" checked="true" value="true"> Should be created a new content version? +<input type="checkbox" name="newContentVersion" checked="true" value="true"> Should a new content version be created? #else <input type="hidden" name="newContentVersion" value="true"> It will be created a new content version #end Index: create.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/create.html.en,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- create.html.en 2 Feb 2006 17:08:29 -0000 1.16 +++ create.html.en 10 Feb 2006 11:33:21 -0000 1.17 @@ -1,7 +1,6 @@ $portalPresenter.parse("$contextPath/pageheader.html", $portalRequest) - <em><a href="index.html">Portal Component</a> - <a href="create.html">Create Page</a></em> @@ -19,7 +18,7 @@ #end #end -<form action="$contextPath/PORTAL" method="post"> +<form action="$contextPath/PORTAL" method="post" enctype="multipart/form-data"> <input type="hidden" name="cmd" value="create"> <input type="hidden" name="cmd.noaccess" value="$contextPath/noaccess.html"> <input type="hidden" name="cmd.success" value="$contextPath/portal/index.html"> Index: listwiki.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/listwiki.html.en,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- listwiki.html.en 16 Jan 2006 09:26:54 -0000 1.1 +++ listwiki.html.en 10 Feb 2006 11:33:21 -0000 1.2 @@ -16,7 +16,7 @@ List of Wiki pages stored in the item database: <ul> -#foreach( $i in $itemManager.searchItems("/item[itemclass='wikipage']") ) +#foreach( $i in $itemManager.searchItems("/item[itemclass~'wikipage']") ) <li><a href="$i.getPagePath()$i.getPageName()">$i.getAttribute("name")</a>, id=$i.getId() - <a href="edit.html?itemid=$i.getId()">edit</a> - <a href="delete.html?itemid=$i.getId()">delete</a></li> Index: index.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/index.html.en,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- index.html.en 31 Jan 2006 20:13:48 -0000 1.8 +++ index.html.en 10 Feb 2006 11:33:21 -0000 1.9 @@ -6,11 +6,11 @@ <h1>Portal Component</h1> #if ( $returnCode == 1101 ) -<div class="success">Successfully created new portal page.</div><p> +<div class="success">Successfully created/updated portal object.</div><p> #elseif ( $returnCode == 1104 ) -<div class="success">Successfully created new portal folder.</div><p> +<div class="success">Successfully created portal folder.</div><p> #elseif ( $returnCode > 1999 ) -<div class="error">Failed with something ...</div><p> +<div class="error">Failed with something ($returnCode) ...</div><p> #end <p>The Portal Component implements functionality for providing a Web-based @@ -32,7 +32,8 @@ <ul> <li><a href="list.html">List HTML pages</a> <li><a href="listwiki.html">List Wiki pages</a> -<li><a href="list.html?op=useronly">List Portal Objects (editable by user)</a> +<li><a href="list.html?op=useronly">List HTML pages (editable by user)</a> +<li><a href="listbin.html">List binary objects</a> <li><a href="browse.html">List and browse Portal Folders</a> <p> </ul> --- NEW FILE: editbin.html.en --- $portalPresenter.parse("$contextPath/pageheader.html", $portalRequest) <em><a href="index.html">Portal Component</a> - <a href="createbin.html">Create Object</a></em> <h1>Update Portal Object</h1> #if ( $returnCode == 1101 ) <div class="success">Successfully/updated created portal object.</div><p> #elseif ( $returnCode > 1999 ) <div class="error">Failed creating portal object.</div><p> #if ($errors) <div class="error">The following error(s) ocurred: <ul>#foreach($error in $errors) <li>$corePresenter.printErrorMessage($error, "$!lang")</li> #end</ul></div><br/> #end #end #set($item = $itemPresenter.getItem($itemid)) #if ("$!pname"=="") #set ($pname = $item.getAttribute("name")) #end #if ("$!plang"=="") Language versions: #foreach ( $l in $portalPresenter.getBinaryLangs($corePresenter.parseInt($itemid))) <a href="editbin.html?itemid=$itemid&plang=$l">$l</a> - #set ($plang = $l) #end #end <form action="$contextPath/PORTAL" method="post" enctype="multipart/form-data"> <input type="hidden" name="cmd" value="updatebin"> <input type="hidden" name="cmd.noaccess" value="$contextPath/noaccess.html"> <input type="hidden" name="cmd.success" value="$contextPath/portal/index.html"> <input type="hidden" name="cmd.error" value="$contextPath/portal/createbin.html"> <input type="hidden" name="path" value="$portalRequest.getPagePath()"/> <input type="hidden" name="itemid" value="$!itemid"/> Path: TBD show the paths <p> Page Name (if no name is given, the filename is taken; if no extension is given, the extension from the filename is append to the page name):<br> <input name="pname" size="50" value="$!pname"> <p> Language: $!plang <p> <input type="file" name="_file" value="$_file"> <p> <input type="submit" value="Update Object"> </form> $portalPresenter.parse("$contextPath/pagefooter.html", $portalRequest) --- NEW FILE: listbin.html.en --- $portalPresenter.parse("$contextPath/pageheader.html", $portalRequest) <em><a href="index.html">Portal Component</a> - <a href="list.html">List Binary Objects</a></em> <h1>List Binary Portal Objects</h1> #if ( $returnCode == 1010 ) <p><div class="success">Successfully deleted portal object.</div></p> #end List of binary objects stored in the item database: <ul> #foreach( $i in $itemManager.searchItems("/item[itemclass='portalfile']") ) <li><a href="$i.getPagePath()$i.getPageName()">$i.getAttribute("name")</a>, id=$i.getId() - <a href="editbin.html?itemid=$i.getId()">edit</a> - <a href="delete.html?itemid=$i.getId()">delete</a></li> #end </ul> <p> <a href="create.html">Create new HTML Portal Object</a> $portalPresenter.parse("$contextPath/pagefooter.html", $portalRequest) --- NEW FILE: createbin.html.en --- $portalPresenter.parse("$contextPath/pageheader.html", $portalRequest) <em><a href="index.html">Portal Component</a> - <a href="createbin.html">Create Object</a></em> <h1>Create Portal Object</h1> #if ( $returnCode == 1101 ) <div class="success">Successfully created portal object.</div><p> #elseif ( $returnCode > 1999 ) <div class="error">Failed creating portal object.</div><p> #if ($errors) <div class="error">The following error(s) ocurred: <ul>#foreach($error in $errors) <li>$corePresenter.printErrorMessage($error, "$!lang")</li> #end</ul></div><br/> #end #end <form action="$contextPath/PORTAL" method="post" enctype="multipart/form-data"> <input type="hidden" name="cmd" value="createbin"> <input type="hidden" name="cmd.noaccess" value="$contextPath/noaccess.html"> <input type="hidden" name="cmd.success" value="$contextPath/portal/index.html"> <input type="hidden" name="cmd.error" value="$contextPath/portal/createbin.html"> <input type="hidden" name="path" value="$portalRequest.getPagePath()"/> Path: <select name="ppath"> #foreach ($p in $portalManager.getPortalFolderPaths()) <option value="$p">$p #end </select> <a href="createfolder.html">Create New Folder</a> <p> Page Name (if no name is given, the filename is taken; if no extension is given, the extension from the filename is appended to the page name):<br> <input name="pname" size="50" value="$!pname"> <p> Language: <select name="plang"> $portalPresenter.printLanguageOptions("$!plang") </select> <p> <input type="file" name="_file" value="$_file"> <p> <input type="checkbox" name="storedb" checked="checked"> Store object in database (otherwise the file will be stored in the file system and cannot be edited) </p> <p> <input type="submit" value="Create Object"> </form> $portalPresenter.parse("$contextPath/pagefooter.html", $portalRequest) |
|
From: Michael K. <ko...@us...> - 2006-02-10 11:33:36
|
Update of /cvsroot/cobricks/cobricks2/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10360/WEB-INF Modified Files: web.xml Log Message: new ui for creating and editing binary web objects Index: web.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/WEB-INF/web.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- web.xml 16 Jan 2006 20:59:37 -0000 1.12 +++ web.xml 10 Feb 2006 11:33:21 -0000 1.13 @@ -73,26 +73,6 @@ <servlet-name>default</servlet-name> <url-pattern>*.js</url-pattern> </servlet-mapping> - <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>*.gif</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>*.png</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>*.jpg</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>*.tif</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>*.zip</url-pattern> - </servlet-mapping> <servlet-mapping> <servlet-name>CoreServlet</servlet-name> @@ -296,12 +276,32 @@ </filter> <filter-mapping> <filter-name>multipartFilter</filter-name> + <url-pattern>/PORTAL</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>multipartFilter</filter-name> <url-pattern>/USER</url-pattern> </filter-mapping> <filter-mapping> <filter-name>multipartFilter</filter-name> <url-pattern>/ITEM</url-pattern> </filter-mapping> + <filter-mapping> + <filter-name>multipartFilter</filter-name> + <url-pattern>/CATEGORY</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>multipartFilter</filter-name> + <url-pattern>/CONTEXT</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>multipartFilter</filter-name> + <url-pattern>/MESSAGE</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>multipartFilter</filter-name> + <url-pattern>/COURSE</url-pattern> + </filter-mapping> </web-app> |
|
From: Michael K. <ko...@us...> - 2006-02-03 15:50:56
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23547 Modified Files: item_attrs.xml Log Message: Index: item_attrs.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/db/item_attrs.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- item_attrs.xml 24 Jun 2004 06:55:38 -0000 1.1 +++ item_attrs.xml 3 Feb 2006 15:50:43 -0000 1.2 @@ -4,7 +4,8 @@ <column name="itemid" type="int" notnull="true"/> <column name="aname" type="string(100)"/> - <column name="avalue" type="string(250)"/> + <column name="avalueprefix" type="varchar(100)"/> + <column name="avalue" type="text"/> <index name="item_attrs_itemid"> <colname>itemid</colname> |
|
From: Michael K. <ko...@us...> - 2006-02-03 15:37:25
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18706 Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- PortalManagerImpl.java 2 Feb 2006 17:16:52 -0000 1.75 +++ PortalManagerImpl.java 3 Feb 2006 15:37:17 -0000 1.76 @@ -13,6 +13,7 @@ package org.cobricks.portal; import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FilenameFilter; @@ -20,8 +21,10 @@ import java.io.FileWriter; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.OutputStream; import java.io.PrintWriter; import java.net.URL; +import java.net.URLConnection; import java.util.ArrayList; import java.util.Collections; import java.util.Date; |
|
From: Alexander G. <gaf...@us...> - 2006-02-02 17:18:08
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2300/src/org/cobricks/portal Modified Files: PortalServlet.java Log Message: Index: PortalServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServlet.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- PortalServlet.java 2 Feb 2006 11:39:26 -0000 1.44 +++ PortalServlet.java 2 Feb 2006 17:18:00 -0000 1.45 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -329,14 +329,12 @@ attrs.put("fullcontext", fullcontext); } - //If the page should be versiond - String createwikipage = prequest.getRequestParameter("createwikipage"); - createwikipage = (createwikipage == null) ? "" : createwikipage; - if (createwikipage.equals("true")) { - attrs.put("itemclass", "wikipage"); - } else { - attrs.put("itemclass", "portalpagehtml"); + //Set the itemclass + String itemclass = prequest.getRequestParameter("itemclass"); + if(itemclass == null) { + itemclass = "portalpagehtml"; } + attrs.put("itemclass", itemclass); try { int itemid = |
|
From: Alexander G. <gaf...@us...> - 2006-02-02 17:17:00
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1740/src/org/cobricks/portal Modified Files: PortalManagerImpl.java Log Message: Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 --- PortalManagerImpl.java 2 Feb 2006 11:39:26 -0000 1.74 +++ PortalManagerImpl.java 2 Feb 2006 17:16:52 -0000 1.75 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -13,7 +13,6 @@ package org.cobricks.portal; import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FilenameFilter; @@ -23,7 +22,6 @@ import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; -import java.net.URLConnection; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -37,8 +35,8 @@ import java.util.Set; import java.util.StringTokenizer; import java.util.regex.*; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletResponse; +import javax.servlet.*; +import javax.servlet.http.*; import org.apache.log4j.Logger; import org.apache.velocity.VelocityContext; @@ -517,26 +515,30 @@ String pageName = page.getPageName(); String lang = portalRequest.getLang(); - // language of the page + //Versionid of the page + Integer versionid = null; + //Language of the page String pageLanguage = null; - pageLanguage = (String)portalRequest.getRequestParameter("lang"); + + String itemclass = null; + + Ontology ontology = null; + OntologyClass ontologyClass = null; + OntologyClassAttr ontologyAttr = null; - // versionid of the page (if versioned) - Integer versionid = null; - boolean isVersioned = false; try { - String itemclass = (String)page.getAttribute("itemclass"); - // check if the content is versioned - Ontology ontology = itemManager.getOntology(); - OntologyClass ontologyClass= ontology.getClass(itemclass); - OntologyClassAttr ontologyAttr = - ontologyClass.getAttribute("content"); - if ((ontologyAttr != null) && ontologyAttr.isVersioned()) { - isVersioned = true; - } - // get versionid of page - versionid = Integer. - valueOf(portalRequest.getRequestParameter("versionid")); + itemclass = (String)page.getAttribute("itemclass"); + + //Check if the content is versioend + ontology = itemManager.getOntology(); + ontologyClass= ontology.getClass(itemclass); + ontologyAttr = ontologyClass.getAttribute("content"); + + //Get verseionid of page + versionid = Integer.valueOf( + portalRequest.getRequestParameter("versionid")); + //Get language of the page + pageLanguage = (String)portalRequest.getRequestParameter("lang"); } catch (Exception e) { versionid = null; } @@ -552,32 +554,36 @@ Map pc = null; - if (isVersioned) { + //Get all childs of 'wikipage' + OntologyClass wikiOntologyClass = ontology.getClass("wikipage"); + Set wikiVersionedPages = ontology.getChildren(ontologyClass, true); + wikiVersionedPages.add(wikiOntologyClass); + + if(wikiVersionedPages.contains(ontologyClass)) { pc = new HashMap(); String content = null; if (versionid != null) { - content = itemManager. - getContentVersion(page.getLocalId(), pageLanguage, - versionid.intValue()); - if (content == null) { + content = itemManager.getContentVersion( + page.getLocalId(), pageLanguage, versionid.intValue()); + if(content == null) { pageLanguage = defaultLanguage; - content = itemManager. - getContentVersion(page.getLocalId(), defaultLanguage, - versionid.intValue()); + content = itemManager.getContentVersion( + page.getLocalId(), defaultLanguage, versionid.intValue()); } } else { - content = this. - getHighestContentVersion(page.getLocalId(), pageLanguage); + content = this.getHighestContentVersion( + page.getLocalId(), pageLanguage); if(content == null) { pageLanguage = defaultLanguage; - content = this. - getHighestContentVersion(page.getLocalId(), - defaultLanguage); + content = this.getHighestContentVersion( + page.getLocalId(), defaultLanguage); } } if (content != null) { + //Parse the content content = Utility.parse(content); + pc.put(pageLanguage, content); } } else { @@ -586,8 +592,9 @@ } if (pc == null || pc.size()<1) { - logger.warn("Failed getting content for page "+pagePath+pageName - +","+lang+" - loading "+notFoundPath); + if (!pageName.equals("favicon.ico")) + logger.warn("Failed getting content for page "+pagePath+pageName + +","+lang+" - loading "+notFoundPath); pagePath = notFoundPath; pageName = "notfound.html"; int pos = pagePath.indexOf("/"); @@ -614,15 +621,6 @@ String pageLang = (String)pc.keySet().iterator().next(); String pageContent = (String)pc.get(pageLang); portalRequest.setPageLang(pageLang); - - // if it is a wiki page, then parse the content - String itemclass = ""; - if (page != null) itemclass = page.getItemClass(); - if (itemclass!=null && itemclass.equals("wikipage")) { - pageContent = Utility.parse(pageContent); - } - - // finally parse the page via Velocity and print it try { // parse Velocity template Velocity.evaluate(portalRequest.getVelocityContext(), out, @@ -639,14 +637,13 @@ } } - /** * Gets the highest content version to the itemid. * @param itemid The id for the content version. * @param lang Language for the content. - * @return Returns the content of the highest versionid if exist, - * otherwise null. + * @return Returns the content of the highest versionid if exist, otherwise + * null. */ private String getHighestContentVersion(int itemid, String lang) { @@ -676,7 +673,6 @@ } return content; } - /* -------------------------------------------------------------------- */ /* database access @@ -1109,6 +1105,9 @@ { super.init(componentId, managerId, properties, coreManager, dbAccess); + //Set properties + Utility.setProperties(properties); + // portal properties webspaceDir = properties.getProperty("portal.webspace.dir"); defaultLanguage = properties.getProperty("default.language", "en"); |
|
From: Alexander G. <gaf...@us...> - 2006-02-02 17:10:41
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31300/src/org/cobricks/portal/wiki Modified Files: Utility.java Log Message: Index: Utility.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki/Utility.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Utility.java 2 Feb 2006 11:39:26 -0000 1.5 +++ Utility.java 2 Feb 2006 17:10:29 -0000 1.6 @@ -36,18 +36,6 @@ //Default ending of a file private final static String DEFAULTENDING = "html"; -// private final static String ITEMID = "%ITEMID%"; -// private final static String LANG = "%LANG%"; - - //Link to edit the page - the itemid must be replaced -// private final static String EDITLINK = "<a href=\"portal/edit.html?itemid="+ -// ITEMID+"\">Edit</a>"; - - //Link to history of the page -// private final static String HISTORYLINK = "<a href=\"" + -// "portal/historywiki.html?" + -// "itemid="+ITEMID+"&lang="+LANG+"\">History</a>"; - //Indicate the begin of the text, that will not be changed private final static String BEGINNOWIKITEXT = "<nowiki>"; //Indicate the end of the text, that will not be changed @@ -94,7 +82,7 @@ /** * Initialize the lists with the strings to search in the parse Sting. */ - private static void initialize() { + static { //Text formatting String[] searchTokenTmp = {"'''''", "'''", "''", "===", "=="}; @@ -154,9 +142,6 @@ searchToken = searchTokenTmp; searchTokenWholeLine = searchTokenWholeLineTmp; - - //Initialize the properties - loadProperties(); } /** @@ -173,19 +158,15 @@ String tmpParse = toParse; /* ATTENTION: The Methods must be called in the right sequence!! - * 1. initialize() - * 2. deleteNowikiElements(String) - * 3. parseSearchToken(tmpParse) - * 4. parseSearchTokenWholeLine(tmpParse) - * 5. parseImages(tmpParse) - * 6. parseShortLinks(tmpParse); - * 7. parseLinks(tmpParse) - * 8. insertNowikiElements(tmpParse) + * 1. deleteNowikiElements(String) + * 2. parseSearchToken(tmpParse) + * 3. parseSearchTokenWholeLine(tmpParse) + * 4. parseImages(tmpParse) + * 5. parseShortLinks(tmpParse); + * 6. parseLinks(tmpParse) + * 7. insertNowikiElements(tmpParse) * * */ - - //initialize the search tokens - initialize(); /* delete the elementes, which should not be parsed -> the elements must * be inserted with the method insertNowikiElements(String) @@ -663,11 +644,9 @@ */ private static String parseShortLinks(String toParse) { - if(toParse == null) + if((toParse == null) || (properties == null)) return toParse; - loadProperties(); - StringBuffer tmpToParse = new StringBuffer(toParse); Map abbreviations = getLinkAbbreviations(); @@ -836,14 +815,17 @@ /** * Load the porperties from the property file in 'org.cobrcks.portal'. */ - private static void loadProperties() { - if(properties == null) { - properties = new Properties(); - CoreManager coreManager = new CoreManager(); - - PropertiesUtil.loadPropertiesResource("org.cobricks.portal", - "properties.txt", properties, coreManager); - } +// private static void loadProperties() { +// if(properties == null) { +// properties = new Properties(); +// CoreManager coreManager = new CoreManager(); +// +// PropertiesUtil.loadPropertiesResource("org.cobricks.portal", +// "properties.txt", properties, coreManager); +// } +// } + public static void setProperties(Properties prop) { + properties = prop; } /** @@ -852,7 +834,9 @@ * @return Map with the link abbreviations and the whole link. */ public static Map getLinkAbbreviations() { - loadProperties(); +// loadProperties(); + if(properties == null) + return null; Map linkMap = new HashMap(); |
|
From: Alexander G. <gaf...@us...> - 2006-02-02 17:08:40
|
Update of /cvsroot/cobricks/cobricks2/web/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30231/web/portal Modified Files: createwiki.html.en create.html.en Log Message: Index: create.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/create.html.en,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- create.html.en 16 Jan 2006 09:34:24 -0000 1.15 +++ create.html.en 2 Feb 2006 17:08:29 -0000 1.16 @@ -53,7 +53,7 @@ You may also upload a file for the content:<br> <input type="file" name="_file"> <p> -<input type="checkbox" name="createwikipage" value="true"> Create as Wiki Page (otherwise will be created a HTML page) +<input type="checkbox" name="itemclass" value="wikipage"> Create as Wiki Page (otherwise will be created a HTML page) </p> <p> <input type="submit" value="Create Page"> Index: createwiki.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/createwiki.html.en,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- createwiki.html.en 1 Feb 2006 20:42:45 -0000 1.4 +++ createwiki.html.en 2 Feb 2006 17:08:29 -0000 1.5 @@ -26,7 +26,7 @@ <input type="hidden" name="cmd.error" value="$contextPath/portal/create.html"> <input type="hidden" name="path" value="$portalRequest.getPagePath()"/> <input type="hidden" name="fullcontext" value="true" /> -<input type="hidden" name="createwikipage" value="true" /> +<input type="hidden" name="itemclass" value="wikipage" /> Path: <select name="ppath"> |
|
From: Michael K. <ko...@us...> - 2006-02-02 11:39:40
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30653 Modified Files: MultipartFilter.java PortalManager.java PortalManagerImpl.java PortalPresenter.java PortalServlet.java Log Message: Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- PortalPresenter.java 20 Dec 2005 18:10:24 -0000 1.34 +++ PortalPresenter.java 2 Feb 2006 11:39:26 -0000 1.35 @@ -655,6 +655,23 @@ return result.toString(); } + /** + * Print one option field for a SELECT tag - decide if to + * select the option or not + */ + public final String printOption(String label, String labelval, String val) + { + StringBuffer result = + new StringBuffer("<option value=\"" + labelval + "\">"); + if (labelval.equals(val)) { + result.append(" selected=\"true\""); + } + result.append(">"); + result.append(label); + result.append("</option>"); + return result.toString(); + } + /** * Index: PortalManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManager.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- PortalManager.java 22 Aug 2005 13:52:07 -0000 1.18 +++ PortalManager.java 2 Feb 2006 11:39:26 -0000 1.19 @@ -41,6 +41,8 @@ public String getRedirect(String uri); + public void sendPortalObject(PortalRequest portalRequest, PrintWriter out) + throws PortalCompletedException; public void printPage(PortalRequest portalRequest, PrintWriter out); public PortalPage getPage(String pagePath, String pageName); Index: PortalServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServlet.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- PortalServlet.java 1 Feb 2006 20:36:21 -0000 1.43 +++ PortalServlet.java 2 Feb 2006 11:39:26 -0000 1.44 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -85,8 +85,9 @@ throw new PortalCompletedException(); } - portalManager.printPage(portalRequest, out); - + // return/send the portal object + portalManager.sendPortalObject(portalRequest, out); + return null; } Index: MultipartFilter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/MultipartFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MultipartFilter.java 10 Aug 2005 13:35:34 -0000 1.2 +++ MultipartFilter.java 2 Feb 2006 11:39:26 -0000 1.3 @@ -83,7 +83,7 @@ } catch (Exception fooOnAnyProblems) { } else - fileUpload.setSizeMax(2048000); + fileUpload.setSizeMax(-1); String threshold = config.getInitParameter("sizeThreshold"); if (threshold != null) try { Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- PortalManagerImpl.java 1 Feb 2006 20:36:21 -0000 1.73 +++ PortalManagerImpl.java 2 Feb 2006 11:39:26 -0000 1.74 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2005 Cobricks Group. All rights reserved. + * Copyright (c) 2003-2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software @@ -13,6 +13,7 @@ package org.cobricks.portal; import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FilenameFilter; @@ -22,6 +23,7 @@ import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; +import java.net.URLConnection; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -35,8 +37,8 @@ import java.util.Set; import java.util.StringTokenizer; import java.util.regex.*; -import javax.servlet.*; -import javax.servlet.http.*; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.apache.velocity.VelocityContext; @@ -379,6 +381,121 @@ /** + * Return a web object - either a text object (then user printPage()) + * or a binary object. + */ + public void sendPortalObject(PortalRequest portalRequest, + PrintWriter out) + throws PortalCompletedException + { + String pagePath = portalRequest.getPagePath(); + String pageName = portalRequest.getPageName(); + String lang = portalRequest.getLang(); + PortalPage page = getPage(pagePath, pageName); + + // check if it is a text file or a binary one ... + String mimetype = URLConnection.guessContentTypeFromName(pageName); + logger.info("mimetype of request = "+mimetype); + if (mimetype == null) { + mimetype = "text/html"; + // guessContentTypeFromName() did not return a result, we use + // simple suffix heuristics + String suffix = ""; + int pos = pageName.lastIndexOf("."); + if (pos > -1) { + suffix = pageName.substring(pos+1); + suffix = suffix.toLowerCase(); + suffix = suffix.trim(); + if (suffix.equals("html")) { + mimetype = "text/html"; + } + if (suffix.equals("htm")) { + mimetype = "text/html"; + } + if (suffix.equals("txt")) { + mimetype = "text/plain"; + } + if (suffix.equals("css")) { + mimetype = "text/css"; + } + if (suffix.equals("xml")) { + mimetype = "text/xml"; + } + if (suffix.equals("rdf")) { + mimetype = "text/rdf"; + } + if (suffix.equals("csv")) { + mimetype = "text/csv"; + } + } + } + + // if it is a text page, then user printPage() + if (mimetype.startsWith("text")) { + printPage(portalRequest, out); + return; + } + // ... otherwise send file directly + + logger.info("identified non text file ... "+mimetype); + + // check access rights + boolean access = true; + // TBD + if (!access) { + pagePath = "/"; + pageName = "noaccess.html"; + page = getPage(pagePath, pageName); + printPage(portalRequest, page, out); + return; + } + + Object o = page.getPageContent(lang); + if (o == null) { + logger.warn("Failed getting content for page "+pagePath+pageName + +","+lang+" - loading "+notFoundPath); + pagePath = notFoundPath; + pageName = "notfound.html"; + int pos = pagePath.indexOf("/"); + if (pos > -1) { + pageName = pagePath.substring(pos+1); + pagePath = pagePath.substring(0, pos+1); + } + page = getPage(pagePath, pageName); + printPage(portalRequest, page, out); + return; + } + + // TBD: return content ... + HttpServletResponse response = + portalRequest.getHttpServletResponse(); + response.setContentType(mimetype); + response.setHeader("Content-disposition", + "attachment; filename="+pageName); + + BufferedInputStream bis = null; + BufferedOutputStream bos = null; + try { + ServletOutputStream sout = response.getOutputStream(); + URL url = new URL("test.doc"); + bis = new BufferedInputStream(url.openStream()); + bos = new BufferedOutputStream(sout); + byte[] buff = new byte[2048]; + int bytesRead; + while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { + bos.write(buff, 0, bytesRead); + } + } catch (Exception e) { + } finally { + if (bis != null) try { bis.close(); } catch (Exception e) { } + if (bos != null) try { bos.close(); } catch (Exception e) { } + } + + throw new PortalCompletedException(); + } + + + /** * Print page after parsing the template as Velocity template */ public void printPage(PortalRequest portalRequest, PrintWriter out) @@ -387,31 +504,39 @@ String pageName = portalRequest.getPageName(); String lang = portalRequest.getLang(); PortalPage page = getPage(pagePath, pageName); + printPage(portalRequest, page, out); + } + + /** + * Print page after parsing the template as Velocity template + */ + public void printPage(PortalRequest portalRequest, PortalPage page, + PrintWriter out) + { + String pagePath = page.getPagePath(); + String pageName = page.getPageName(); + String lang = portalRequest.getLang(); - //Versionid of the page - Integer versionid = null; - //Language of the page + // language of the page String pageLanguage = null; - - String itemclass = null; - - Ontology ontology = null; - OntologyClass ontologyClass = null; - OntologyClassAttr ontologyAttr = null; + pageLanguage = (String)portalRequest.getRequestParameter("lang"); + // versionid of the page (if versioned) + Integer versionid = null; + boolean isVersioned = false; try { - itemclass = (String)page.getAttribute("itemclass"); - - //Check if the content is versioend - ontology = itemManager.getOntology(); - ontologyClass= ontology.getClass(itemclass); - ontologyAttr = ontologyClass.getAttribute("content"); - - //Get verseionid of page - versionid = Integer.valueOf( - portalRequest.getRequestParameter("versionid")); - //Get language of the page - pageLanguage = (String)portalRequest.getRequestParameter("lang"); + String itemclass = (String)page.getAttribute("itemclass"); + // check if the content is versioned + Ontology ontology = itemManager.getOntology(); + OntologyClass ontologyClass= ontology.getClass(itemclass); + OntologyClassAttr ontologyAttr = + ontologyClass.getAttribute("content"); + if ((ontologyAttr != null) && ontologyAttr.isVersioned()) { + isVersioned = true; + } + // get versionid of page + versionid = Integer. + valueOf(portalRequest.getRequestParameter("versionid")); } catch (Exception e) { versionid = null; } @@ -427,31 +552,32 @@ Map pc = null; - if((ontologyAttr != null) && ontologyAttr.isVersioned()) { + if (isVersioned) { pc = new HashMap(); String content = null; if (versionid != null) { - content = itemManager.getContentVersion( - page.getLocalId(), pageLanguage, versionid.intValue()); - if(content == null) { + content = itemManager. + getContentVersion(page.getLocalId(), pageLanguage, + versionid.intValue()); + if (content == null) { pageLanguage = defaultLanguage; - content = itemManager.getContentVersion( - page.getLocalId(), defaultLanguage, versionid.intValue()); + content = itemManager. + getContentVersion(page.getLocalId(), defaultLanguage, + versionid.intValue()); } } else { - content = this.getHighestContentVersion( - page.getLocalId(), pageLanguage); + content = this. + getHighestContentVersion(page.getLocalId(), pageLanguage); if(content == null) { pageLanguage = defaultLanguage; - content = this.getHighestContentVersion( - page.getLocalId(), defaultLanguage); + content = this. + getHighestContentVersion(page.getLocalId(), + defaultLanguage); } } if (content != null) { - //Parse the content content = Utility.parse(content); - pc.put(pageLanguage, content); } } else { @@ -460,9 +586,8 @@ } if (pc == null || pc.size()<1) { - if (!pageName.equals("favicon.ico")) - logger.warn("Failed getting content for page "+pagePath+pageName - +","+lang+" - loading "+notFoundPath); + logger.warn("Failed getting content for page "+pagePath+pageName + +","+lang+" - loading "+notFoundPath); pagePath = notFoundPath; pageName = "notfound.html"; int pos = pagePath.indexOf("/"); @@ -489,6 +614,15 @@ String pageLang = (String)pc.keySet().iterator().next(); String pageContent = (String)pc.get(pageLang); portalRequest.setPageLang(pageLang); + + // if it is a wiki page, then parse the content + String itemclass = ""; + if (page != null) itemclass = page.getItemClass(); + if (itemclass!=null && itemclass.equals("wikipage")) { + pageContent = Utility.parse(pageContent); + } + + // finally parse the page via Velocity and print it try { // parse Velocity template Velocity.evaluate(portalRequest.getVelocityContext(), out, @@ -505,15 +639,17 @@ } } + /** * Gets the highest content version to the itemid. * @param itemid The id for the content version. * @param lang Language for the content. - * @return Returns the content of the highest versionid if exist, otherwise - * null. + * @return Returns the content of the highest versionid if exist, + * otherwise null. */ - private String getHighestContentVersion(int itemid, String lang) { + private String getHighestContentVersion(int itemid, String lang) + { List contentList = itemManager.getContentVersions(itemid, lang); String content = null; Integer versionid = null; @@ -540,6 +676,7 @@ } return content; } + /* -------------------------------------------------------------------- */ /* database access @@ -624,14 +761,6 @@ if (items != null && items.size()>0) throw new CobricksException("portal", "exists", ""); - // check if the pagename and pagepath would be a valid url -// String url = "http://localhost" + pagePath + pageName; -// Pattern urlPattern = -// Pattern.compile("(?:https?|ftp)://[^\\s,<>\\?]+?\\.[^\\s,<>\\?]+"); -// Matcher m = urlPattern.matcher(url); -// if (!m.find()) -// throw new CobricksException("portal", "invalidURL", ""); - // create new item object Item item = null; try { |
|
From: Michael K. <ko...@us...> - 2006-02-02 11:39:39
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30653/wiki Modified Files: Utility.java Log Message: Index: Utility.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki/Utility.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Utility.java 1 Feb 2006 20:37:38 -0000 1.4 +++ Utility.java 2 Feb 2006 11:39:26 -0000 1.5 @@ -172,7 +172,7 @@ String tmpParse = toParse; - /* ATENTION: The Methods must be called in the right sequence!! + /* ATTENTION: The Methods must be called in the right sequence!! * 1. initialize() * 2. deleteNowikiElements(String) * 3. parseSearchToken(tmpParse) |
|
From: Michael K. <ko...@us...> - 2006-02-02 11:39:28
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30586 Modified Files: ItemManager.java ItemManagerImpl.java ItemServlet.java Removed Files: item.ucd Log Message: Index: ItemManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManager.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ItemManager.java 16 Jan 2006 09:23:44 -0000 1.28 +++ ItemManager.java 2 Feb 2006 11:39:12 -0000 1.29 @@ -27,12 +27,8 @@ * * @author mic...@ac... * @author ma...@in... -<<<<<<< ItemManager.java * @author Alexander Gafriller - gaf...@in... * @version $Date$ -======= - * @version $Date$ ->>>>>>> 1.27 */ public interface ItemManager extends ComponentManagerInterface Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- ItemManagerImpl.java 1 Feb 2006 20:35:41 -0000 1.64 +++ ItemManagerImpl.java 2 Feb 2006 11:39:12 -0000 1.65 @@ -1604,21 +1604,32 @@ /** * This method deletes an item from the persistent data bases and from * the item cache. - * At this time (TBD) you can be sure that both ids will never be assigned - * again - all references to the item to be deleted will then point to an - * id which does not exist. - * This method has no user id as parameter, it assumes that only user - * with administrator privileges use this method. + * Access right checking is done, except when userid is -1. * * @param localid The local id is needed to determine the item to be * deleted + * @param userid The user id of the user deleting the item * @throws CobricksException This can be thrown if there was an internal * XML database exception while handling this request. */ - public void deleteItem(int localid) + public void deleteItem(int localid, int userid) throws CobricksException { - this.removeAllItemAttachments(this.getItem(localid)); + Item item = this.getItem(localid); + + if (userid > -1) { + boolean allowed = + this.performPermissionQuery(userid, item, "delete"); + /* + if (!allowed) { + logger.info("Access denied for deleting item: userid =" + + Integer.toString(userid)); + return; + } + */ + } + + this.removeAllItemAttachments(item); // Remove it from the relational db this.removeItemFromDB(localid); @@ -1629,30 +1640,18 @@ ComponentEvent event = new ComponentEventImpl("org.cobricks.item", "item", "delete"); event.setObjectId(localid); + event.setUserId(userid); this.publishEvent(event); } /** - * This method does the same as deleteItem(int), but with additional - * access right checking. - * @param localid The local id is used to determine the item to be deleted. - * @param userid The user id is used to check if the user has the - * permission to do so. - * @throws CobricksException This can be thrown if there was an internal - * XML database exception while handling this request. + * */ - public void deleteItem(int localid, int userid) + public void deleteItem(int localid) throws CobricksException { - Item item = this.getItem(localid); - boolean allowed = this.performPermissionQuery(userid, item, "delete"); - if (allowed) { - this.deleteItem(localid); - } else { - logger.info("Access denied for deleting item: userid =" - + Integer.toString(userid)); - } + deleteItem(localid, -1); } Index: ItemServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemServlet.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- ItemServlet.java 23 Jan 2006 15:14:11 -0000 1.40 +++ ItemServlet.java 2 Feb 2006 11:39:12 -0000 1.41 @@ -400,14 +400,25 @@ public final String performDeletion(PortalRequest prequest, PrintWriter out) { - try { - // Get the itemid of the item to be deleted - String itemid = prequest.getRequestParameter("itemid"); + // Get the itemid of the item to be deleted + String itemid = prequest.getRequestParameter("itemid"); + // check access rights + PortalUser portalUser = prequest.getPortalUser(); + /* + if (!userManager.getAccessControl().checkPermission(portalUser + .getUserId(), "item", "delete", "itemid=$!itemid")) { + prequest.setReturnCode(2000); + return "noaccess"; + } + */ + + try { int id = Integer.parseInt(itemid.trim()); - // Delete the item - this.itemManager.deleteItem(id); + // Delete the item - permission checking is done in this + // function ... + this.itemManager.deleteItem(id, portalUser.getUser().getId()); prequest.setReturnCode(1002); return "success"; --- item.ucd DELETED --- |
|
From: Alexander G. <gaf...@us...> - 2006-02-01 20:43:09
|
Update of /cvsroot/cobricks/cobricks2/web/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15134/web/portal Modified Files: wikihelp.html Log Message: Index: wikihelp.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/wikihelp.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- wikihelp.html 31 Jan 2006 20:13:48 -0000 1.2 +++ wikihelp.html 1 Feb 2006 20:43:01 -0000 1.3 @@ -1,5 +1,3 @@ -$portalPresenter.parse("$contextPath/pageheader.html", $portalRequest) - <h1>Wiki Help</h1> <p>This document describe the Wiki elements which can be used in a @@ -160,8 +158,4 @@ </tr> #end -</table> - - - -$portalPresenter.parse("$contextPath/pagefooter.html", $portalRequest) +</table> \ No newline at end of file |
|
From: Alexander G. <gaf...@us...> - 2006-02-01 20:42:53
|
Update of /cvsroot/cobricks/cobricks2/web/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15023/web/portal Modified Files: createwiki.html.en Log Message: Index: createwiki.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/createwiki.html.en,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- createwiki.html.en 24 Jan 2006 07:15:42 -0000 1.3 +++ createwiki.html.en 1 Feb 2006 20:42:45 -0000 1.4 @@ -49,7 +49,7 @@ <p> <textarea name="content" rows="15" cols="75"> -#include("/portal/wikipage-template.html") + </textarea><br> You may also upload a file for the content:<br> <input type="file" name="_file"> |
|
From: Alexander G. <gaf...@us...> - 2006-02-01 20:37:53
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12716/src/org/cobricks/portal/wiki Modified Files: UtilityTest.java Utility.java Log Message: Index: UtilityTest.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki/UtilityTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- UtilityTest.java 31 Jan 2006 19:59:20 -0000 1.2 +++ UtilityTest.java 1 Feb 2006 20:37:38 -0000 1.3 @@ -347,36 +347,4 @@ //System.out.println(retValue); assertTrue(result.equals(retValue)); } - - public void testInsertEditLink() { - String parse, result, retValue; - int itemid = 3; - //Insert the edit link - parse = "Edit this page: "; - - result = "Edit this page: " - + "<a href=\"portal/edit.html?itemid=3\">Edit</a>"; - - retValue = Utility.insertEditLink(itemid, parse, parse.length()); - //System.out.println(result); - //System.out.println(retValue); - assertTrue(result.equals(retValue)); - } - - public void testInsertHistoryLink() { - String parse, result, retValue, lang = "en"; - int itemid = 3; - //Insert the edit link - parse = "History of the page: "; - - result = "History of the page: " - + "<a href=\"portal/historywiki.html?itemid=3&lang=en\">" - + "History</a>"; - - retValue = Utility.insertHistoryLink(itemid, lang, parse, parse - .length()); - //System.out.println(result); - //System.out.println(retValue); - assertTrue(result.equals(retValue)); - } } Index: Utility.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki/Utility.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Utility.java 31 Jan 2006 19:59:20 -0000 1.3 +++ Utility.java 1 Feb 2006 20:37:38 -0000 1.4 @@ -36,17 +36,17 @@ //Default ending of a file private final static String DEFAULTENDING = "html"; - private final static String ITEMID = "%ITEMID%"; - private final static String LANG = "%LANG%"; +// private final static String ITEMID = "%ITEMID%"; +// private final static String LANG = "%LANG%"; //Link to edit the page - the itemid must be replaced - private final static String EDITLINK = "<a href=\"portal/edit.html?itemid="+ - ITEMID+"\">Edit</a>"; +// private final static String EDITLINK = "<a href=\"portal/edit.html?itemid="+ +// ITEMID+"\">Edit</a>"; //Link to history of the page - private final static String HISTORYLINK = "<a href=\"" + - "portal/historywiki.html?" + - "itemid="+ITEMID+"&lang="+LANG+"\">History</a>"; +// private final static String HISTORYLINK = "<a href=\"" + +// "portal/historywiki.html?" + +// "itemid="+ITEMID+"&lang="+LANG+"\">History</a>"; //Indicate the begin of the text, that will not be changed private final static String BEGINNOWIKITEXT = "<nowiki>"; @@ -834,92 +834,6 @@ } /** - * Insert the link to the edit side with the right itemid. - * @param itemid Itemid of the page which should be edited. - * @param content Content where the link will be inserted. - * @param position Position where the link will be inserted. - * @return The content with the edit-link. - */ - public static String insertEditLink(int itemid, String content, int position) - { - if(content == null) - return null; - - StringBuffer tmp = new StringBuffer(content); - - tmp.insert(position, replaceItemid(itemid)); - - return tmp.toString(); - } - - /** - * Search the place holder of the itemid and replace it with the real - * itemid of the content. - * @param itemid The itemid that will be inserted. - * @return The edit-link with the right itemid. - */ - private static String replaceItemid(int itemid) - { - if(EDITLINK == null) - return EDITLINK; - - StringBuffer tmp = new StringBuffer(EDITLINK); - int pos = tmp.indexOf(ITEMID); - if(pos > -1) { - tmp = tmp.replace(pos, pos+ITEMID.length(), ""+itemid); - } - - return tmp.toString(); - } - - /** - * Insert the history link into the content at the specific position. - * @param itemid Itemid of the side which history should be shown. - * @param lang Language of the side - * @param content Content where the history list should be inserted - * @param position Position where the link should be inserted - * @return Content with the inserted history link. - */ - public static String insertHistoryLink(int itemid, String lang, String content, int position) - { - if(content == null) - return null; - - StringBuffer tmp = new StringBuffer(content); - - tmp.insert(position, replaceItemidAndLanguage(itemid, lang)); - - return tmp.toString(); - } - - /** - * Search the place holder of the itemid and language in the history - * and replace it with the real values. - * @param itemid Itemid of the page. - * @param lang Language of the page. - * @return The history link with the right itemid and language. - */ - private static String replaceItemidAndLanguage(int itemid, String lang) - { - if(HISTORYLINK == null) - return null; - - StringBuffer tmp = new StringBuffer(HISTORYLINK); - - int pos = tmp.indexOf(ITEMID); - if(pos > -1) { - tmp = tmp.replace(pos, pos+ITEMID.length(), ""+itemid); - } - - pos = tmp.indexOf(LANG); - if(pos > -1) { - tmp = tmp.replace(pos, pos+LANG.length(), lang); - } - - return tmp.toString(); - } - - /** * Load the porperties from the property file in 'org.cobrcks.portal'. */ private static void loadProperties() { |
|
From: Alexander G. <gaf...@us...> - 2006-02-01 20:36:30
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12151/src/org/cobricks/portal Modified Files: PortalManagerImpl.java itemontology.xml PortalServlet.java Log Message: Index: PortalServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServlet.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- PortalServlet.java 26 Jan 2006 12:38:55 -0000 1.42 +++ PortalServlet.java 1 Feb 2006 20:36:21 -0000 1.43 @@ -332,9 +332,9 @@ String createwikipage = prequest.getRequestParameter("createwikipage"); createwikipage = (createwikipage == null) ? "" : createwikipage; if (createwikipage.equals("true")) { - attrs.put("createwikipage", "true"); + attrs.put("itemclass", "wikipage"); } else { - attrs.put("createwikipage", "false"); + attrs.put("itemclass", "portalpagehtml"); } try { Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- PortalManagerImpl.java 18 Jan 2006 18:23:44 -0000 1.72 +++ PortalManagerImpl.java 1 Feb 2006 20:36:21 -0000 1.73 @@ -449,7 +449,7 @@ } if (content != null) { - //Parse the wiki-content + //Parse the content content = Utility.parse(content); pc.put(pageLanguage, content); @@ -635,14 +635,6 @@ // create new item object Item item = null; try { - //If should be created a wiki-page - String createwikipage = (String)attrs.remove("createwikipage"); - if (createwikipage.equals("true")) { - attrs.put("itemclass", "wikipage"); - } else { - attrs.put("itemclass", "portalpagehtml"); - } - attrs.put("name", pageName); attrs.put("mimetype", "text/html"); Set folders = new HashSet(); Index: itemontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/itemontology.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- itemontology.xml 16 Jan 2006 20:40:16 -0000 1.17 +++ itemontology.xml 1 Feb 2006 20:36:21 -0000 1.18 @@ -21,9 +21,6 @@ <class name="wikipage" parent="portalpagehtml"> <description lang="de">Wikiseite</description> <attr name="content" type="text" multilanguage="true" versioned="true" /> -<attr name="creatoruserid" type="int" /> -<attr name="versionid" type="int" /> -<attr name="creationtime" type="datetime" /> </class> </itemontology> |
|
From: Alexander G. <gaf...@us...> - 2006-02-01 20:35:52
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11793/src/org/cobricks/item Modified Files: ItemManagerImpl.java Log Message: Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- ItemManagerImpl.java 16 Jan 2006 20:43:24 -0000 1.63 +++ ItemManagerImpl.java 1 Feb 2006 20:35:41 -0000 1.64 @@ -962,7 +962,11 @@ String content = null; int versionid = -1; - if (itemClassName.equals("wikipage")) { + //For checkung if the content is versioned + OntologyClassAttr ontologyAttrContent = null; + ontologyAttrContent = itemclass.getAttribute("content"); + + if (ontologyAttrContent.isVersioned()) { String lang = (String)attrs.get("lang"); if (lang == null || lang.equals("")) lang = this.getDefaultLanguage(); @@ -970,7 +974,7 @@ contentName = "content_"+lang; content = (String)attrs.remove(contentName); - //Create new Wiki version + //Create new content version versionid = this.createContentVersion(itemid, lang, content, creatoruserid); } @@ -986,7 +990,7 @@ } } - if((content != null) && (contentName != null)) + if((ontologyAttrContent.isVersioned())) attrs.put(contentName, content); // create item object and initialize it @@ -2664,14 +2668,14 @@ Integer versionid = null; String sql = - "select max(versionid) " + + "select max(versionid) as maxid" + " from item_content " + " where itemid = " + itemid + " and lang = '" + lang + "'"; List result = dbAccess.sqlQuery(sql); if(!result.isEmpty()) { - versionid = (Integer)((Map)result.get(0)).get("max(versionid)"); + versionid = (Integer)((Map)result.get(0)).get("maxid"); } if (versionid == null) { @@ -2701,24 +2705,7 @@ //Get the versionid Integer versionid = null; - String sql = - "select max(versionid) " + - " from item_content " + - " where itemid = " + itemid + - " and lang = '" + lang + "'"; - - List result = dbAccess.sqlQuery(sql); - if(!result.isEmpty()) { - versionid = (Integer)((Map)result.get(0)).get("max(versionid)"); - } - - if (versionid == null) { - logger.warn("updateHighestContentVersion: There is no versioned " + - "content stored. The new content was not stored."); - return null; - } - - return getContentVersion(itemid, lang, versionid.intValue()); - + Item item = this.getItemFromCache(itemid); + return item.getContent(); } } |
|
From: Alexander G. <gaf...@us...> - 2006-01-31 20:13:57
|
Update of /cvsroot/cobricks/cobricks2/web/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26772/web/portal Modified Files: index.html.en wikihelp.html wiki.html.en Removed Files: wikipage-template.html Log Message: --- wikipage-template.html DELETED --- Index: wiki.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/wiki.html.en,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- wiki.html.en 10 Aug 2005 13:38:06 -0000 1.1 +++ wiki.html.en 31 Jan 2006 20:13:48 -0000 1.2 @@ -9,8 +9,33 @@ <p>Using the item and portal components it is possible to provide "Wiki-like" functionality. This page demonstrates this.</p> -<p>TBD</p> +<h2>Create Wiki pages</h2> +<p> +To create Wiki pages there are two possibilities. First you can use the +<a href="/portal/create.html">Create new HTML page</a> Link, where you can +choose, if should be created a HTML page or a Wiki page. Otherwise you can use +<a href="/portal/createwiki.html">Create new Wiki page</a>, where only Wiki +pages can be created. +</p> +<h2>List Wiki pages</h2> +<p> +To list all Wiki pages that were created on the platform you can use the +<a href="/portal/listwiki.html">List Wiki pages</a> form. +</p> + +<h2>Edit Wiki pages</h2> +<p> +To edit the content of a Wiki page you can use the +<a href="/portal/edit.html">Edit form</a>. It is the same form which can +be used to edit HTML pages. The parameter 'itemid' must be passed. +</p> + +<h2>History of a Wiki page</h2> +<p> +The form <a href="/portal/historywiki.html">History Wiki</a> list the +changes of the content for a Wiki page. The parameter 'itemid' must be passed. +</p> $portalPresenter.parse("$contextPath/pagefooter.html", $portalRequest) Index: index.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/index.html.en,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- index.html.en 16 Jan 2006 09:26:54 -0000 1.7 +++ index.html.en 31 Jan 2006 20:13:48 -0000 1.8 @@ -37,8 +37,9 @@ <p> </ul> -<h3>Wiki Help</h3> +<h3>Wiki</h3> <ul> +<li><a href="wiki.html">Overview</a> <li><a href="wikihelp.html" target="_blank">Help for Wiki</a> </ul> Index: wikihelp.html =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/wikihelp.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- wikihelp.html 16 Jan 2006 09:26:54 -0000 1.1 +++ wikihelp.html 31 Jan 2006 20:13:48 -0000 1.2 @@ -143,4 +143,25 @@ </tr> </table> +<h2>Abbreviations</h2> + +<table border="1"> + <tr> + <th>Commands to enter</th> + <th>What will be displayed</th> + </tr> + +#set ( $linkMap = $portalRequest.getLinkAbbreviations() ) +#set ( $keys = $linkMap.keySet() ) +#foreach($key in $keys) + <tr> + <td>$key</td> + <td>$linkMap.get($key)</td> + </tr> +#end + +</table> + + + $portalPresenter.parse("$contextPath/pagefooter.html", $portalRequest) |
|
From: Alexander G. <gaf...@us...> - 2006-01-31 20:06:23
|
Update of /cvsroot/cobricks/cobricks2/web/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23622/web/portal Modified Files: historywiki.html.en Log Message: Index: historywiki.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/historywiki.html.en,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- historywiki.html.en 16 Jan 2006 09:26:54 -0000 1.1 +++ historywiki.html.en 31 Jan 2006 20:06:12 -0000 1.2 @@ -5,16 +5,15 @@ <em><a href="index.html">Portal Component</a> - <a href="historywiki.html">List Wiki history Objects</a></em> -<h1>List Wiki history Objects</h1> +#set ( $page = $portalPresenter.getPage($itemid) ) -List of Wiki history pages stored in the database: +<h1>Content history of $page.getPageName()</h1> -#set ( $page = $portalPresenter.getPage($itemid) ) <ul> #foreach( $i in $itemManager.getContentVersions($corePresenter.parseInt($itemid), "$lang") ) -<li>Name: <a href="$page.getPagePath()$page.getPageName()?lang=$lang&versionid=$i.get("versionid")">$page.getAttribute("name")</a> -- Creatoruserid: $i.get("creatoruserid") -- Version: $i.get("versionid") +<li> +Creatoruserid: $i.get("creatoruserid") +- Version: <a href="$page.getPagePath()$page.getPageName()?lang=$lang&versionid=$i.get("versionid")">$i.get("versionid")</a> - Created: $i.get("creationtime") </li> #end |
|
From: Alexander G. <gaf...@us...> - 2006-01-31 20:04:51
|
Update of /cvsroot/cobricks/cobricks2/web/portal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23072/web/portal Modified Files: edit.html.en Log Message: Index: edit.html.en =================================================================== RCS file: /cvsroot/cobricks/cobricks2/web/portal/edit.html.en,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- edit.html.en 16 Jan 2006 09:26:54 -0000 1.10 +++ edit.html.en 31 Jan 2006 20:04:42 -0000 1.11 @@ -42,7 +42,10 @@ #set ( $name = $page.getPageName() ) <tr><td> Name: <input type="text" name="name" value="$!name" size="45"/> -<p> </p> + +<p> +<b>itemclass = $page.getAttribute("ontologyclassname")</b> +</p> </td></tr> #if ("$!_submit" == "Add Language") @@ -94,9 +97,6 @@ #end #end </p> -<p> -itemclass = $page.getAttribute("ontologyclassname") -</p> <p><input type="submit" name="_submit" value="Update Page"></p> |
|
From: Alexander G. <gaf...@us...> - 2006-01-31 19:59:29
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20639/src/org/cobricks/portal/wiki Modified Files: UtilityTest.java Utility.java Log Message: Link abbreviations added Index: UtilityTest.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki/UtilityTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- UtilityTest.java 16 Jan 2006 09:23:28 -0000 1.1 +++ UtilityTest.java 31 Jan 2006 19:59:20 -0000 1.2 @@ -25,8 +25,8 @@ parse = "Italic: ''italic''"; result = "Italic: <i>italic</i>"; retValue = Utility.parse(parse); - // System.out.println(result); - // System.out.println(retValue); + System.out.println(result); + System.out.println(retValue); assertTrue(result.equals(retValue)); parse = "Italic: ''italic\n"; Index: Utility.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki/Utility.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Utility.java 18 Jan 2006 22:06:37 -0000 1.2 +++ Utility.java 31 Jan 2006 19:59:20 -0000 1.3 @@ -12,9 +12,12 @@ package org.cobricks.portal.wiki; +import java.util.Iterator; +import java.util.NoSuchElementException; import java.util.Map; import java.util.HashMap; import java.util.Properties; +import java.util.regex.Pattern; import org.cobricks.core.CoreManager; import org.cobricks.core.util.PropertiesUtil; @@ -70,15 +73,24 @@ private final static String ENDIMG = "]]"; private final static String SEPARATORIMG = "|"; + //Short links + private final static String BEGINSHORTLINK = "[[:"; + private final static String ENDSCHORTLINK = "]]"; + private final static String SEPARATORSHORTLINK = "|"; + //Comments private final static String BEGINCOMMENT = "<!--"; private final static String ENDCOMMENT = "-->"; //delete this token private static String[] deleteToken = null; - + //Read porperties from property file - private static Properties properties = new Properties(); + private static Properties properties = null; + + //property name, which contains all links for the link abbreviation + private static String linkAbbreviationProperty = "portal.linkabbreviations"; + /** * Initialize the lists with the strings to search in the parse Sting. */ @@ -166,8 +178,9 @@ * 3. parseSearchToken(tmpParse) * 4. parseSearchTokenWholeLine(tmpParse) * 5. parseImages(tmpParse) - * 6. parseLinks(tmpParse) - * 7. insertNowikiElements(tmpParse) + * 6. parseShortLinks(tmpParse); + * 7. parseLinks(tmpParse) + * 8. insertNowikiElements(tmpParse) * * */ @@ -188,6 +201,9 @@ //parse the images tmpParse = parseImages(tmpParse); + //parse the short links + tmpParse = parseShortLinks(tmpParse); + //parse the links tmpParse = parseLinks(tmpParse); @@ -207,7 +223,6 @@ if((pagefooterwiki != null) && (!pagefooterwiki.equals(""))) tmpParse = tmpParse + pagefooterwiki + ENDOFLINE; - return tmpParse; } @@ -580,7 +595,6 @@ position = tmpToParse.indexOf(BEGINNOWIKITEXT, position+1); } - return tmpToParse.toString(); } @@ -641,6 +655,79 @@ } /** + * Insert the link to the pages by exchanging the 'short link' placeholder. + * + * @param toParse Will be parsed + * @return return the parsed String, where the 'short links' are + * changed by the right link. + */ + private static String parseShortLinks(String toParse) + { + if(toParse == null) + return toParse; + + loadProperties(); + + StringBuffer tmpToParse = new StringBuffer(toParse); + + Map abbreviations = getLinkAbbreviations(); + String linkAbbreviation = null; + String beginLink = null; + + int position = -1; + int firstExtractPosition = -1; + int lastExtractPosition = -1; + int separatorPosition = -1; + String parsedLink = null; + String additionalText; + try { + //For all short link do + for(Iterator it = abbreviations.keySet().iterator();it.hasNext();) { + linkAbbreviation = (String)it.next(); + beginLink = BEGINSHORTLINK + linkAbbreviation; + position = tmpToParse.indexOf(beginLink); + while(position > -1) { + firstExtractPosition = position+BEGINSHORTLINK.length(); + lastExtractPosition = tmpToParse.indexOf(ENDSCHORTLINK, + position); + + parsedLink = tmpToParse.substring(firstExtractPosition, + lastExtractPosition); + + //Change it to replace the tokens + lastExtractPosition += ENDSCHORTLINK.length(); + + //Check if the link has a description + separatorPosition = parsedLink.indexOf(SEPARATORSHORTLINK); + if(separatorPosition > -1) { + additionalText = parsedLink.substring(separatorPosition+1); + + tmpToParse = tmpToParse.replace( + position, + lastExtractPosition, + "<a href=\""+abbreviations.get(linkAbbreviation) + +"/"+additionalText+"\">"+ + abbreviations.get(linkAbbreviation)+ + "/"+additionalText+"</a>"); + } else { + tmpToParse = tmpToParse.replace( + position, + lastExtractPosition, + "<a href=\""+abbreviations.get(linkAbbreviation) + +"\">"+abbreviations.get( + linkAbbreviation)+"</a>"); + + } + position = tmpToParse.indexOf(beginLink, position+1); + } + } + } catch (NoSuchElementException e) { + + } + return tmpToParse.toString(); + } + + /** * Insert the right links. * @param toParse Will be parsed * @return Return toParse with the inserted links. If there are no links @@ -716,7 +803,6 @@ } position = tmpToParse.indexOf(BEGINLINK,position+1); } - return tmpToParse.toString(); } @@ -837,7 +923,37 @@ * Load the porperties from the property file in 'org.cobrcks.portal'. */ private static void loadProperties() { - PropertiesUtil.loadPropertiesResource("org.cobricks.portal", - "properties.txt", properties, new CoreManager()); + if(properties == null) { + properties = new Properties(); + CoreManager coreManager = new CoreManager(); + + PropertiesUtil.loadPropertiesResource("org.cobricks.portal", + "properties.txt", properties, coreManager); + } + } + + /** + * Get the link abbreviations which are stored in the file "properties.txt" + * in "org.cobricks.portal" + * @return Map with the link abbreviations and the whole link. + */ + public static Map getLinkAbbreviations() { + loadProperties(); + + Map linkMap = new HashMap(); + + //Conatins the property names, where the string abbreviations are stored + StringBuffer linkAbbreviationPropertyNames = new StringBuffer( + properties.getProperty(linkAbbreviationProperty)); + + Pattern pattern = Pattern.compile(";"); + String [] linkNames = pattern.split(linkAbbreviationPropertyNames.subSequence(0,linkAbbreviationPropertyNames.length())); + + String link = null; + for(int i = 0; i < linkNames.length; i++) { + linkMap.put(linkNames[i], properties.get(linkNames[i])); + } + + return linkMap; } } |