Changeset 8630 for trunk/greenstone3-extensions/gsdl-as
- Timestamp:
- 2004-11-23T15:08:24+13:00 (19 years ago)
- Location:
- trunk/greenstone3-extensions/gsdl-as
- Files:
-
- 15 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/greenstone3-extensions/gsdl-as
- Property svn:ignore
-
old new 1 1 build 2 2 dist 3 lib4 3 test-classes
-
- Property svn:ignore
-
trunk/greenstone3-extensions/gsdl-as/.cvsignore
r8619 r8630 1 1 build 2 2 dist 3 lib4 3 test-classes -
trunk/greenstone3-extensions/gsdl-as/build.xml
r8609 r8630 447 447 <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> 448 448 <mkdir dir="${build.home}/WEB-INF/lib"/> 449 <!-- 450 <copy todir="${build.home}/WEB-INF/lib" file="${foo.jar}"/>451 -->449 <copy todir="${build.home}/WEB-INF/lib"> 450 <fileset dir="lib" includes="*.jar"/> 451 </copy> 452 452 453 453 <!-- Copy static files from external dependencies as needed --> -
trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/AlertingServiceServlet.java
r8609 r8630 122 122 Subscription sub = new Subscription(valueMap); 123 123 // TODO this should probably be somewhere else 124 for (Iterator iter = sub. predicates().iterator(); iter.hasNext();) {124 for (Iterator iter = sub.getPredicates().iterator(); iter.hasNext();) { 125 125 Predicate predicate = (Predicate) iter.next(); 126 126 if (predicate != null) { … … 151 151 } 152 152 153 // TODO authentication (not everyone should be allowed to post154 // events...)155 153 GreenstoneCommunicator gsComm = null; 156 154 try { -
trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java
r8609 r8630 164 164 165 165 return matchedPreds; 166 // Set result = new TreeSet();167 // for (Iterator iter = PredicateFactory.getAllBooleanPredicates().iterator(); iter.hasNext();) {168 // Predicate predicate = (Predicate) iter.next();169 // if (predicate.isSatisfied(event)) {170 // result.add(event);171 // }172 // }173 // return result;174 }175 176 /**177 * @param value178 * @return179 */180 private Set getWordsInString(String value) {181 Set result = new TreeSet();182 String[] words = value.split("\\s");183 // TODO better word recognition184 for (int i = 0; i < words.length; i++) {185 String word = words[i];186 while (word.endsWith(".") || word.endsWith(",") || word.endsWith("?") || word.endsWith("!")) {187 word = word.substring(0, word.length() - 2);188 }189 if (!result.contains(word)) {190 result.add(word);191 }192 }193 return result;194 }195 196 /**197 * @param object198 * @return199 */200 private Set getWordsInDocument(String documentID) {201 Set result = new TreeSet();202 // TODO get document text, use getWordsInString203 // or better: do something clever using the indexes204 return result;205 166 } 206 167 … … 270 231 271 232 public String toString() { 272 Set allSubscriptions = new TreeSet(); 273 allSubscriptions.addAll(noEqualsSubscriptions); 274 275 for(Iterator iter = docIdEqualsSubscriptions.values().iterator(); iter.hasNext();) { 276 Set values = (Set) iter.next(); 277 allSubscriptions.addAll(values); 278 } 279 280 for(Iterator iter = docCollectionIdEqualsSubscriptions.values().iterator(); iter.hasNext();) { 281 Set values = (Set) iter.next(); 282 allSubscriptions.addAll(values); 283 } 284 285 for(Iterator iter = collectionIdEqualsSubscriptions.values().iterator(); iter.hasNext();) { 286 Set values = (Set) iter.next(); 287 allSubscriptions.addAll(values); 288 } 233 Set allSubscriptions = getAllSubscriptions(); 289 234 290 235 StringBuffer buffer = new StringBuffer(); … … 298 243 return buffer.toString(); 299 244 } 245 246 /** 247 * @return 248 */ 249 public Set getAllSubscriptions() { 250 Set allSubscriptions = new TreeSet(); 251 allSubscriptions.addAll(noEqualsSubscriptions); 252 253 for(Iterator iter = docIdEqualsSubscriptions.values().iterator(); iter.hasNext();) { 254 Set values = (Set) iter.next(); 255 allSubscriptions.addAll(values); 256 } 257 258 for(Iterator iter = docCollectionIdEqualsSubscriptions.values().iterator(); iter.hasNext();) { 259 Set values = (Set) iter.next(); 260 allSubscriptions.addAll(values); 261 } 262 263 for(Iterator iter = collectionIdEqualsSubscriptions.values().iterator(); iter.hasNext();) { 264 Set values = (Set) iter.next(); 265 allSubscriptions.addAll(values); 266 } 267 return Collections.unmodifiableSet(allSubscriptions); 268 } 300 269 301 270 } -
trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/profiles/Subscription.java
r8609 r8630 57 57 } 58 58 59 public Collection predicates() {59 public Collection getPredicates() { 60 60 return Collections.unmodifiableCollection(map.values()); 61 61 } -
trunk/greenstone3-extensions/gsdl-as/test-src/org/greenstone/gsdlas/GreenstoneCommunicatorTest.java
r8609 r8630 27 27 junit.textui.TestRunner.run(GreenstoneCommunicatorTest.class); 28 28 } 29 29 30 30 protected void setUp() throws Exception { 31 31 URL host; -
trunk/greenstone3-extensions/gsdl-as/test-src/org/greenstone/gsdlas/ProfileStoreTest.java
r8609 r8630 86 86 Subscription sub = new Subscription(valueMap); 87 87 // TODO this should probably be somewhere else 88 for (Iterator iter = sub. predicates().iterator(); iter.hasNext();) {88 for (Iterator iter = sub.getPredicates().iterator(); iter.hasNext();) { 89 89 Predicate predicate = (Predicate) iter.next(); 90 90 if (predicate != null) { -
trunk/greenstone3-extensions/gsdl-as/web/WEB-INF/web.xml
r8609 r8630 74 74 An alerting service for Greenstone 3 75 75 </description> 76 <servlet-class>org.greenstone.gsdlas.AlertingServiceServlet</servlet-class> 76 <servlet-class>org.greenstone.gsdlas.AlertingService</servlet-class> 77 <init-param> 78 <param-name>properties</param-name> 79 <param-value>/velocity.properties</param-value> 80 </init-param> 77 81 </servlet> 78 82 <!-- -
trunk/greenstone3-extensions/gsdl-as/web/index.html
r8609 r8630 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html> 4 <head> 5 <title>Alerting Service for Greenstone</title> 6 <style type="text/css"> 7 <!-- 8 table { border:1pt solid black; padding:2px; background:#F0F0F0; } 9 th { text-align:left; background:lightblue; } 10 th,td { border-width:0px; } 11 --> 12 </style 13 </head> 14 <body> 15 <h1>Test</h1> 16 <form action="/alerting/service?test" method="POST"> 17 <input type="text" name="text"/><br/> 18 <input type="submit"/> 19 </form> 20 <hr/> 21 <!-- <h1>Event</h1> 22 <form action="/alerting/service?receive" method="POST"> 23 <table> 24 <tr> 25 <th>Event Type</th> 26 <td> 27 <input type="radio" name="type" value="new_document" checked/> new document 28 <input type="radio" name="type" value="document_deleted"/> document deleted 29 <input type="radio" name="type" value="document_content_changed"/> content changed 30 <input type="radio" name="type" value="document_md_changed"/> metadata changed 31 </td> 32 </tr> 33 <tr> 34 <th>Document ID</th> 35 <td> 36 <input type="text" name="documentID"/> 37 </td> 38 </tr> 39 </table> 40 <br/> 41 <input type="submit"/> 42 </form> 43 <hr/> --> 44 <h1>Subscribe</h1> 45 <form action="/alerting/service?subscribe" method ="POST" name="subscribe"> 46 <table border="1"> 47 <tr> 48 <th>Event Type</th> 49 <td> 50 <input type="radio" name="type" value="new_document" checked="checked"/> new document 51 <input type="radio" name="type" value="document_deleted"/> document deleted 52 <input type="radio" name="type" value="document_content_changed" /> content changed 53 <input type="radio" name="type" value="document_md_changed"/> metadata changed 54 </td> 55 </tr> 56 <tr> 57 <th>Document ID</th> 58 <td> 59 <input type="text" name="documentID"/> 60 </td> 61 </tr> 62 <tr> 63 <th>Document Title</th> 64 <td> 65 <input type="text" name="document_title"/> 66 </td> 67 </tr> 68 <tr> 69 <th>Document Content</th> 70 <td> 71 <input type="text" name="document_content"/> 72 </td> 73 </tr> 74 <tr> 75 <th>Collection ID</th> 76 <td> 77 <input type="text" name="collectionID"/> 78 </td> 79 </tr> 80 <tr> 81 <th>Collection Name</th> 82 <td> 83 <input type="text" name="collection_name"/> 84 </td> 85 </tr> 86 </table> 87 <br/> 88 <input type="submit"/> 89 </form> 90 </body> 91 </html> 1 <html><head> 2 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 3 <title>Greenstone Version 3</title></head> 4 5 <body alink="#cc9900" background="images/chalk.gif" bgcolor="#ffffff" link="#006666" text="#000000" vlink="#666633"> 6 7 <!-- page banner (_style:pagebanner_) --> 8 <center> 9 <table cellpadding="0" cellspacing="0" width="537"> 10 <tbody><tr valign="top"> 11 <td rowspan="2" align="left"><center><img src="images/gsdlhead.gif" alt="Greenstone Digital Library Software" height="100" width="300"></center></td> 12 <td align="right"></td> 13 </tr> 14 15 <tr> 16 <td align="right"></td> 17 </tr> 18 19 <tr> 20 <td colspan="2"></td> 21 </tr> 22 </tbody></table> 23 </center> 24 <!-- end of page banner --> 25 26 <center> 27 28 <table width="537"> 29 <tbody><tr><td><h3>Alerting Service for Greenstone 3</h3></td></tr> 30 <tr><td> </td></tr> 31 <tr><td>What do you want to do today?</td></tr> 32 <tr><td> </td></tr> 33 34 35 <tr><td><a href="test.html">Test</a> the alerting service servlet.</td></tr> 36 <tr><td><a href="about.html">Read more</a> about the alerting service.</td></tr> 37 38 </tbody></table> 39 </center> 40 </body></html>
Note:
See TracChangeset
for help on using the changeset viewer.