Skip to content
Browse files

First open source version

  • Loading branch information...
1 parent 769d0bf commit c1294b270a9c4f29b4bd2da01d01bfb8295574e5 @nheidloff nheidloff committed Oct 26, 2012
Showing with 9,721 additions and 0 deletions.
  1. +12 −0 disk-collaborationtoday/.classpath
  2. +16 −0 disk-collaborationtoday/.project
  3. +7 −0 disk-collaborationtoday/.settings/.jsdtscope
  4. +8 −0 disk-collaborationtoday/.settings/org.eclipse.core.resources.prefs
  5. +1 −0 disk-collaborationtoday/.settings/org.eclipse.wst.jsdt.ui.superType.container
  6. +1 −0 disk-collaborationtoday/.settings/org.eclipse.wst.jsdt.ui.superType.name
  7. +150 −0 disk-collaborationtoday/AppProperties/database.properties
  8. 0 disk-collaborationtoday/AppProperties/xspdesign.properties
  9. +39 −0 disk-collaborationtoday/Code/Java/biz/webgate/domino/mywebgate/api/MicroPublisherSessionFacade.java
  10. +18 −0 ...orationtoday/Code/Java/biz/webgate/domino/mywebgate/api/MicroPublisherSessionFacade.java.metadata
  11. +225 −0 disk-collaborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/URLFetcher.java
  12. +18 −0 disk-collaborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/URLFetcher.java.metadata
  13. +66 −0 disk-collaborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/builder/ErrorJSONBuilder.java
  14. +18 −0 ...aborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/builder/ErrorJSONBuilder.java.metadata
  15. +128 −0 ...llaborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/jsonparser/URLFetcherJSONParser.java
  16. +18 −0 ...ontoday/Code/Java/biz/webgate/domino/mywebgate/util/jsonparser/URLFetcherJSONParser.java.metadata
  17. +49 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Category.java
  18. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Category.java.metadata
  19. +58 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Click.java
  20. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Click.java.metadata
  21. +112 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ClickCache.java
  22. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ClickCache.java.metadata
  23. +398 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ConfigCache.java
  24. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ConfigCache.java.metadata
  25. +148 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateChecker.java
  26. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateChecker.java.metadata
  27. +37 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateEntry.java
  28. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateEntry.java.metadata
  29. +36 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/MiscUtils.java
  30. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/MiscUtils.java.metadata
  31. +351 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/NewsCache.java
  32. +20 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/NewsCache.java.metadata
  33. +249 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/NewsEntriesJson.java
  34. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/NewsEntriesJson.java.metadata
  35. +230 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/NewsEntry.java
  36. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/NewsEntry.java.metadata
  37. +110 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Parser.java
  38. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Parser.java.metadata
  39. +109 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Person.java
  40. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Person.java.metadata
  41. +34 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/PersonComparator.java
  42. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/PersonComparator.java.metadata
  43. +132 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/PersonsCache.java
  44. +24 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/PersonsCache.java.metadata
  45. +39 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/PopularityComparator.java
  46. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/PopularityComparator.java.metadata
  47. +72 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Type.java
  48. +18 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Type.java.metadata
  49. +339 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/WriteCacheJob.java
  50. +26 −0 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/WriteCacheJob.java.metadata
  51. +34 −0 disk-collaborationtoday/Code/ScriptLibraries/Bookmarklet.jss
  52. +14 −0 disk-collaborationtoday/Code/ScriptLibraries/Bookmarklet.jss.metadata
  53. +243 −0 disk-collaborationtoday/Code/ScriptLibraries/biz.webgate.mywebgate.micropublisher.js
  54. +14 −0 disk-collaborationtoday/Code/ScriptLibraries/biz.webgate.mywebgate.micropublisher.js.metadata
  55. +105 −0 disk-collaborationtoday/Code/ScriptLibraries/collab2day.js
  56. +14 −0 disk-collaborationtoday/Code/ScriptLibraries/collab2day.js.metadata
  57. +503 −0 disk-collaborationtoday/Code/ScriptLibraries/xpNewsFeedGenerator.jss
  58. +14 −0 disk-collaborationtoday/Code/ScriptLibraries/xpNewsFeedGenerator.jss.metadata
  59. 0 disk-collaborationtoday/Code/dbscript.lsdb
  60. +26 −0 disk-collaborationtoday/CustomControls/ccPager.xsp
  61. +21 −0 disk-collaborationtoday/CustomControls/ccPager.xsp-config
  62. +22 −0 disk-collaborationtoday/CustomControls/ccPager.xsp.metadata
  63. +48 −0 disk-collaborationtoday/CustomControls/duplicateCheck.xsp
  64. +17 −0 disk-collaborationtoday/CustomControls/duplicateCheck.xsp-config
  65. +22 −0 disk-collaborationtoday/CustomControls/duplicateCheck.xsp.metadata
  66. +17 −0 disk-collaborationtoday/CustomControls/footer.xsp
  67. +17 −0 disk-collaborationtoday/CustomControls/footer.xsp-config
  68. +22 −0 disk-collaborationtoday/CustomControls/footer.xsp.metadata
  69. +146 −0 disk-collaborationtoday/CustomControls/layout.xsp
  70. +17 −0 disk-collaborationtoday/CustomControls/layout.xsp-config
  71. +22 −0 disk-collaborationtoday/CustomControls/layout.xsp.metadata
  72. +9 −0 disk-collaborationtoday/CustomControls/leftColumn.xsp
  73. +17 −0 disk-collaborationtoday/CustomControls/leftColumn.xsp-config
  74. +22 −0 disk-collaborationtoday/CustomControls/leftColumn.xsp.metadata
  75. +61 −0 disk-collaborationtoday/CustomControls/leftColumnLineItems.xsp
  76. +21 −0 disk-collaborationtoday/CustomControls/leftColumnLineItems.xsp-config
  77. +22 −0 disk-collaborationtoday/CustomControls/leftColumnLineItems.xsp.metadata
  78. +68 −0 disk-collaborationtoday/CustomControls/moderationLayout.xsp
  79. +17 −0 disk-collaborationtoday/CustomControls/moderationLayout.xsp-config
  80. +22 −0 disk-collaborationtoday/CustomControls/moderationLayout.xsp.metadata
  81. +90 −0 disk-collaborationtoday/CustomControls/moderationLeftColumn.xsp
  82. +17 −0 disk-collaborationtoday/CustomControls/moderationLeftColumn.xsp-config
  83. +22 −0 disk-collaborationtoday/CustomControls/moderationLeftColumn.xsp.metadata
  84. +185 −0 disk-collaborationtoday/CustomControls/moderationNewsEntry.xsp
  85. +61 −0 disk-collaborationtoday/CustomControls/moderationNewsEntry.xsp-config
  86. +26 −0 disk-collaborationtoday/CustomControls/moderationNewsEntry.xsp.metadata
  87. +13 −0 disk-collaborationtoday/CustomControls/moderatorCheck.xsp
  88. +17 −0 disk-collaborationtoday/CustomControls/moderatorCheck.xsp-config
  89. +22 −0 disk-collaborationtoday/CustomControls/moderatorCheck.xsp.metadata
  90. +154 −0 disk-collaborationtoday/CustomControls/newsEntry.xsp
  91. +65 −0 disk-collaborationtoday/CustomControls/newsEntry.xsp-config
  92. +22 −0 disk-collaborationtoday/CustomControls/newsEntry.xsp.metadata
  93. +286 −0 disk-collaborationtoday/CustomControls/recaptcha_cc.xsp
  94. +151 −0 disk-collaborationtoday/CustomControls/recaptcha_cc.xsp-config
  95. +22 −0 disk-collaborationtoday/CustomControls/recaptcha_cc.xsp.metadata
  96. +61 −0 disk-collaborationtoday/CustomControls/rightColumn.xsp
  97. +17 −0 disk-collaborationtoday/CustomControls/rightColumn.xsp-config
  98. +22 −0 disk-collaborationtoday/CustomControls/rightColumn.xsp.metadata
  99. +57 −0 disk-collaborationtoday/CustomControls/spotlightEntry.xsp
  100. +21 −0 disk-collaborationtoday/CustomControls/spotlightEntry.xsp-config
  101. +22 −0 disk-collaborationtoday/CustomControls/spotlightEntry.xsp.metadata
  102. +103 −0 disk-collaborationtoday/CustomControls/topStories.xsp
  103. +17 −0 disk-collaborationtoday/CustomControls/topStories.xsp-config
  104. +22 −0 disk-collaborationtoday/CustomControls/topStories.xsp.metadata
  105. +123 −0 disk-collaborationtoday/Forms/Blog.form
  106. +62 −0 disk-collaborationtoday/Forms/Category.form
  107. +62 −0 disk-collaborationtoday/Forms/Config.form
  108. +236 −0 disk-collaborationtoday/Forms/News.form
  109. +121 −0 disk-collaborationtoday/Forms/Person.form
  110. +79 −0 disk-collaborationtoday/Forms/Request.form
  111. +81 −0 disk-collaborationtoday/Forms/Type.form
  112. 0 disk-collaborationtoday/Resources/AboutDocument
  113. BIN disk-collaborationtoday/Resources/Files/ModerationPolicies.odp
  114. +37 −0 disk-collaborationtoday/Resources/Files/ModerationPolicies.odp.metadata
  115. BIN disk-collaborationtoday/Resources/Files/ModerationPolicies.pdf
  116. +36 −0 disk-collaborationtoday/Resources/Files/ModerationPolicies.pdf.metadata
  117. +23 −0 disk-collaborationtoday/Resources/Files/TestJSONP.html
  118. +17 −0 disk-collaborationtoday/Resources/Files/TestJSONP.html.metadata
  119. +30 −0 disk-collaborationtoday/Resources/Files/TestWidget.html
  120. +17 −0 disk-collaborationtoday/Resources/Files/TestWidget.html.metadata
  121. BIN disk-collaborationtoday/Resources/Files/iconDateTimePicker.png
  122. +17 −0 disk-collaborationtoday/Resources/Files/iconDateTimePicker.png.metadata
  123. +35 −0 disk-collaborationtoday/Resources/IconNote
  124. BIN disk-collaborationtoday/Resources/Images/Connections101-Avatar.jpg
  125. +21 −0 disk-collaborationtoday/Resources/Images/Connections101-Avatar.jpg.metadata
  126. BIN disk-collaborationtoday/Resources/Images/IBM-Avatar.jpg
  127. +21 −0 disk-collaborationtoday/Resources/Images/IBM-Avatar.jpg.metadata
  128. BIN disk-collaborationtoday/Resources/Images/Loading.gif
  129. +21 −0 disk-collaborationtoday/Resources/Images/Loading.gif.metadata
  130. BIN disk-collaborationtoday/Resources/Images/bootstrapedit.png
  131. +20 −0 disk-collaborationtoday/Resources/Images/bootstrapedit.png.metadata
  132. BIN disk-collaborationtoday/Resources/Images/chevron-left.png
  133. +20 −0 disk-collaborationtoday/Resources/Images/chevron-left.png.metadata
  134. BIN disk-collaborationtoday/Resources/Images/chevron-right.png
  135. +20 −0 disk-collaborationtoday/Resources/Images/chevron-right.png.metadata
  136. BIN disk-collaborationtoday/Resources/Images/collab2day.png
  137. +21 −0 disk-collaborationtoday/Resources/Images/collab2day.png.metadata
  138. BIN disk-collaborationtoday/Resources/Images/collaborationtoday_icon.png
  139. +20 −0 disk-collaborationtoday/Resources/Images/collaborationtoday_icon.png.metadata
  140. BIN disk-collaborationtoday/Resources/Images/facebook_16.png
  141. +21 −0 disk-collaborationtoday/Resources/Images/facebook_16.png.metadata
  142. BIN disk-collaborationtoday/Resources/Images/favicon.ico
  143. +22 −0 disk-collaborationtoday/Resources/Images/favicon.ico.metadata
  144. BIN disk-collaborationtoday/Resources/Images/favicon.png
  145. +20 −0 disk-collaborationtoday/Resources/Images/favicon.png.metadata
  146. BIN disk-collaborationtoday/Resources/Images/gplus_16.png
  147. +20 −0 disk-collaborationtoday/Resources/Images/gplus_16.png.metadata
  148. BIN disk-collaborationtoday/Resources/Images/head.png
  149. +20 −0 disk-collaborationtoday/Resources/Images/head.png.metadata
  150. BIN disk-collaborationtoday/Resources/Images/heads.png
  151. +20 −0 disk-collaborationtoday/Resources/Images/heads.png.metadata
  152. BIN disk-collaborationtoday/Resources/Images/mod.png
  153. +20 −0 disk-collaborationtoday/Resources/Images/mod.png.metadata
  154. BIN disk-collaborationtoday/Resources/Images/spotlightPlaceholder.png
  155. +21 −0 disk-collaborationtoday/Resources/Images/spotlightPlaceholder.png.metadata
  156. BIN disk-collaborationtoday/Resources/Images/transparent.gif
  157. +21 −0 disk-collaborationtoday/Resources/Images/transparent.gif.metadata
  158. BIN disk-collaborationtoday/Resources/Images/twitter_16.png
  159. +20 −0 disk-collaborationtoday/Resources/Images/twitter_16.png.metadata
  160. +18 −0 disk-collaborationtoday/Resources/StyleSheets/bootstrap-2.0.4.combined.min.css
  161. +22 −0 disk-collaborationtoday/Resources/StyleSheets/bootstrap-2.0.4.combined.min.css.metadata
  162. +29 −0 disk-collaborationtoday/Resources/StyleSheets/collab2day.css
  163. +17 −0 disk-collaborationtoday/Resources/StyleSheets/collab2day.css.metadata
  164. +231 −0 disk-collaborationtoday/Resources/StyleSheets/custom.css
  165. +17 −0 disk-collaborationtoday/Resources/StyleSheets/custom.css.metadata
  166. +70 −0 disk-collaborationtoday/Resources/StyleSheets/pager.css
  167. +17 −0 disk-collaborationtoday/Resources/StyleSheets/pager.css.metadata
  168. +8 −0 disk-collaborationtoday/Resources/StyleSheets/view.css
  169. +17 −0 disk-collaborationtoday/Resources/StyleSheets/view.css.metadata
  170. +44 −0 disk-collaborationtoday/Resources/Themes/bootstrap.theme
  171. +16 −0 disk-collaborationtoday/Resources/Themes/bootstrap.theme.metadata
  172. 0 disk-collaborationtoday/Resources/UsingDocument
  173. +43 −0 disk-collaborationtoday/Views/BlogsAll.view
  174. +47 −0 disk-collaborationtoday/Views/CategoriesAll.view
  175. +40 −0 disk-collaborationtoday/Views/ConfigAll.view
  176. +56 −0 disk-collaborationtoday/Views/NewsAll.view
  177. +52 −0 disk-collaborationtoday/Views/NewsAllByID.view
  178. +54 −0 disk-collaborationtoday/Views/NewsAllByLink.view
  179. +43 −0 disk-collaborationtoday/Views/NewsByIdDate.view
  180. +83 −0 disk-collaborationtoday/Views/NewsModeratedCached.view
  181. +59 −0 disk-collaborationtoday/Views/PersonsAll.view
  182. +47 −0 disk-collaborationtoday/Views/RequestsAll.view
  183. +47 −0 disk-collaborationtoday/Views/TypesAll.view
  184. +48 −0 disk-collaborationtoday/WebContent/WEB-INF/faces-config.xml
  185. BIN disk-collaborationtoday/WebContent/WEB-INF/lib/httpclient-4.2.1.jar
  186. BIN disk-collaborationtoday/WebContent/WEB-INF/lib/httpcore-4.2.1.jar
  187. BIN disk-collaborationtoday/WebContent/WEB-INF/lib/jericho-html-3.1.jar
  188. BIN disk-collaborationtoday/WebContent/WEB-INF/lib/nekohtml.jar
  189. BIN disk-collaborationtoday/WebContent/WEB-INF/lib/prettytime-1.0.8.Final.jar
  190. +6 −0 disk-collaborationtoday/WebContent/WEB-INF/xsp.properties
  191. +102 −0 disk-collaborationtoday/XPages/about.xsp
  192. +20 −0 disk-collaborationtoday/XPages/about.xsp.metadata
  193. +83 −0 disk-collaborationtoday/XPages/add.xsp
  194. +20 −0 disk-collaborationtoday/XPages/add.xsp.metadata
  195. +52 −0 disk-collaborationtoday/XPages/admin.xsp
  196. +20 −0 disk-collaborationtoday/XPages/admin.xsp.metadata
  197. +20 −0 disk-collaborationtoday/XPages/api.xsp
  198. +20 −0 disk-collaborationtoday/XPages/api.xsp.metadata
  199. +177 −0 disk-collaborationtoday/XPages/author.xsp
  200. +21 −0 disk-collaborationtoday/XPages/author.xsp.metadata
  201. +48 −0 disk-collaborationtoday/XPages/authors.xsp
  202. +20 −0 disk-collaborationtoday/XPages/authors.xsp.metadata
Sorry, we could not display the entire diff because it was too big.
View
12 disk-collaborationtoday/.classpath
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="Local"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jericho-html-3.1.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/httpclient-4.2.1.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/httpcore-4.2.1.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/nekohtml.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/prettytime-1.0.8.Final.jar"/>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
View
16 disk-collaborationtoday/.project
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>disk-collaborationtoday</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.ibm.designer.domino.team.builder.PhysicalToNsfSynBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
View
7 disk-collaborationtoday/.settings/.jsdtscope
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="Code/ScriptLibraries"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
View
8 disk-collaborationtoday/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,8 @@
+#Tue Sep 04 06:42:57 CEST 2012
+encoding//Resources/StyleSheets/custom.css=UTF-8
+encoding//Resources/Files/TestWidget.html=UTF-8
+encoding//Resources/StyleSheets/collab2day.css=UTF-8
+encoding//Resources/Files/TestJSONP.html=UTF-8
+eclipse.preferences.version=1
+encoding//Resources/StyleSheets/pager.css=UTF-8
+encoding//Resources/StyleSheets/view.css=UTF-8
View
1 disk-collaborationtoday/.settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
View
1 disk-collaborationtoday/.settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -0,0 +1 @@
+Window
View
150 disk-collaborationtoday/AppProperties/database.properties
@@ -0,0 +1,150 @@
+<?xml version='1.0' encoding='utf-8'?>
+<database xmlns='http://www.lotus.com/dxl' version='8.5' maintenanceversion='4.0'
+ replicaid='86257A780060902F' path='CN=nheidloff-1/O=NHeidloff!!ctdevelopment\ct.nsf'
+ title='Development Collaboration Today' templatename='CTTemplate'>
+<databaseinfo dbid='C1257A7900266253' odsversion='43' diskspace='9699328'
+ percentused='77.0771748310811' numberofdocuments='388'><datamodified><datetime
+ dst='true'>20121004T085912,73+02</datetime></datamodified><designmodified
+><datetime dst='true'>20121026T091829,37+02</datetime></designmodified></databaseinfo>
+<acl adminserver='CN=nheidloff-1/O=NHeidloff' maxinternetaccess='editor'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role>
+<role>[AvatarModerator]</role>
+<aclentry name='-Default-' default='true' level='noaccess' readpublicdocs='false'
+ writepublicdocs='false'/>
+<aclentry name='CN=Frank van der Linden/OU=EOF/O=EOG' type='person' level='manager'
+ deletedocs='true'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role></aclentry>
+<aclentry name='Jesse Gallagher' type='person' level='editor' deletedocs='true'
+ createpersonalagents='false' createpersonalviews='false' createsharedviews='false'
+ createlsjavaagents='false'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role>
+<role>[AvatarModerator]</role></aclentry>
+<aclentry name='OtherDomainServers' type='servergroup' level='noaccess' readpublicdocs='false'
+ writepublicdocs='false'/>
+<aclentry name='Serdar Basegmez' type='person' level='editor' deletedocs='true'
+ createpersonalagents='false' createpersonalviews='false' createsharedviews='false'
+ createlsjavaagents='false'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role></aclentry>
+<aclentry name='F van der Linden' type='person' level='editor' deletedocs='true'
+ createpersonalagents='false' createpersonalviews='false' createsharedviews='false'
+ createlsjavaagents='false'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role></aclentry>
+<aclentry name='Per Henrik Lausten' type='person' level='editor' deletedocs='true'
+ createpersonalagents='false' createpersonalviews='false' createsharedviews='false'
+ createlsjavaagents='false'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role></aclentry>
+<aclentry name='Anonymous' level='noaccess' readpublicdocs='false' writepublicdocs='false'/>
+<aclentry name='CN=nheidloff-1/O=NHeidloff' type='server' level='manager'
+ deletedocs='true'/>
+<aclentry name='CN=Jesse Gallagher/O=Frost' type='person' level='manager'
+ deletedocs='true'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role>
+<role>[AvatarModerator]</role></aclentry>
+<aclentry name='Niklas Heidloff' type='person' level='editor' deletedocs='true'
+ createpersonalagents='false' createpersonalviews='false' createsharedviews='false'
+ createlsjavaagents='false'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role>
+<role>[AvatarModerator]</role></aclentry>
+<aclentry name='LocalDomainServers' type='servergroup' level='manager' deletedocs='true'/>
+<aclentry name='CN=Per Henrik Lausten/O=PHL Consult' type='person' level='manager'
+ deletedocs='false'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role></aclentry>
+<aclentry name='CN=Serdar Basegmez/O=developi' type='person' level='manager'
+ deletedocs='true'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role></aclentry>
+<aclentry name='CN=Niklas Heidloff/OU=Germany/O=IBM' type='person' level='manager'
+ deletedocs='true'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role>
+<role>[AvatarModerator]</role></aclentry>
+<aclentry name='CN=Peter Tanner/OU=Boston/OU=Contr/O=IBM' type='person' level='manager'
+ deletedocs='false'/>
+<aclentry name='CN=Bruce Elgort/O=NotesOSS' type='person' level='manager'
+ deletedocs='true'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role>
+<role>[AvatarModerator]</role></aclentry>
+<aclentry name='CN=Bruce Elgort/O=Sharepoint' type='person' level='manager'
+ deletedocs='true'>
+<role>[Moderator]</role>
+<role>[TopModerator]</role>
+<role>[SpotModerator]</role>
+<role>[AvatarModerator]</role></aclentry>
+<logentry>22/10/2012 08:41:57 AM Niklas Heidloff/Germany/IBM updated -Default-</logentry>
+<logentry>22/10/2012 08:40:55 AM Niklas Heidloff/Germany/IBM updated -Default-</logentry>
+<logentry>26/09/2012 01:42:44 PM Niklas Heidloff/Germany/IBM updated Jesse Gallagher</logentry>
+<logentry>26/09/2012 01:42:39 PM Niklas Heidloff/Germany/IBM updated Jesse Gallagher</logentry>
+<logentry>26/09/2012 01:42:36 PM Niklas Heidloff/Germany/IBM updated Jesse Gallagher</logentry>
+<logentry>26/09/2012 01:41:54 PM Niklas Heidloff/Germany/IBM added Jesse Gallagher</logentry>
+<logentry>26/09/2012 01:41:49 PM Niklas Heidloff/Germany/IBM updated Jesse Gallagher/Frost</logentry>
+<logentry>26/09/2012 01:41:42 PM Niklas Heidloff/Germany/IBM added Jesse Gallagher/Frost</logentry>
+<logentry>26/09/2012 01:41:41 PM Niklas Heidloff/Germany/IBM updated Bruce Elgort/Sharepoint</logentry>
+<logentry>26/09/2012 01:41:38 PM Niklas Heidloff/Germany/IBM updated Bruce Elgort/NotesOSS</logentry>
+<logentry>18/09/2012 06:36:15 PM Niklas Heidloff/Germany/IBM updated Anonymous</logentry>
+<logentry>18/09/2012 03:15:55 PM Niklas Heidloff/Germany/IBM updated Anonymous</logentry>
+<logentry>14/09/2012 11:52:54 AM Niklas Heidloff/Germany/IBM updated Niklas Heidloff/Germany/IBM</logentry>
+<logentry>14/09/2012 11:52:52 AM Niklas Heidloff/Germany/IBM updated Niklas Heidloff</logentry>
+<logentry>14/09/2012 11:52:50 AM Niklas Heidloff/Germany/IBM updated Bruce Elgort/Sharepoint</logentry>
+<logentry>14/09/2012 11:52:48 AM Niklas Heidloff/Germany/IBM updated Bruce Elgort/NotesOSS</logentry>
+<logentry>14/09/2012 11:46:55 AM Niklas Heidloff/Germany/IBM updated role AvatarModerator</logentry>
+<logentry>13/09/2012 08:16:46 PM Frank van der Linden/EOF/EOG updated Anonymous</logentry>
+<logentry>13/09/2012 07:53:18 PM Frank van der Linden/EOF/EOG deleted Stuart McIntyre</logentry>
+<logentry>13/09/2012 07:53:07 PM Frank van der Linden/EOF/EOG deleted Mike Smith</logentry></acl>
+
+<launchsettings><weblaunch whenopened='openxpage' xpage='home.xsp'/></launchsettings>
+<note default='true' class='icon'>
+<noteinfo noteid='122' unid='ADB7A45D56757D92C1257A4100254423' sequence='3'>
+<created><datetime dst='true'>20120720T084702,75+02</datetime></created>
+<modified><datetime dst='true'>20120918T091959,28+02</datetime></modified>
+<revised><datetime dst='true'>20120918T091959,27+02</datetime></revised>
+<lastaccessed><datetime dst='true'>20120918T091959,28+02</datetime></lastaccessed>
+<addedtofile><datetime dst='true'>20120914T085916,72+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name
+>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name
+>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<item name='IconBitmap' summary='true'>
+<rawitemdata type='6'>
+AiAgAQAA///////wD///gAH//gAAf/wAAD/4AAAf8AAAD+AAAAfgAAAHwAAAA8AAAAPAAAADgAAA
+AYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAHAAAADwAAAA8AAAAPgAAAH4AAAB/AAAA/4AAAf
+/AAAP/4AAH//gAH///AP//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAiIiIiAAAAAAAAAAAAAAI
+jPZmZm/IgAAAAAAAAAAIjGZmZmZmZsiAAAAAAAAAjGZmZmZmZmZmyAAAAAAACMZmZmZmZmZmZmyA
+AAAAAIxmZmZmZmZmZmZmyAAAAAjGZmZmZmZmZmZmZmyAAAAIZmbyL2byL2byL2ZmgAAAjGZmIiJm
+IiJmIiJmZsgAAIZmZiIiZiIiZiIiZmZoAADGZmYiImYiImYiImZmbAAI9mZmIiJmIiJmIiJmZm+A
+CGZmZiIiZiIiZiIiZmZmgAhmZmYiImYiImYiImZmZoAIZmZmIiJmIiJmIiJmZmaACGZvIiIiZiIi
+ZiIiIvZmgAhmYiIiImYiImYiIiImZoAIZm8iIi9m8i9m8iIi9maACPZmZmZmZmZmZmZmZmZvgADG
+ZmbyL2byL2byL2ZmbAAAj2ZmIiJmIiJmIiJmZvgAAIxmZiIiZiIiZiIiZmbIAAAI9mbyL2byL2by
+L2ZvgAAACMZmZmZmZmZmZmZmbIAAAACMZmZmZmZmZmZmZsgAAAAACMZmZmZmZmZmZmyAAAAAAACM
+9mZmZmZmZm/IAAAAAAAACIz2ZmZmZm/IgAAAAAAAAAAIiMZmZmyIgAAAAAAAAAAAAACIiIiIAAAA
+AAAAUEECICABAAD/////+A4DgA==
+</rawitemdata></item>
+<item name='$DBTheme'><text>bootstrap.theme</text></item>
+<item name='$DefaultXPage'><text>home.xsp</text></item>
+<item name='$Daos'><text>0</text></item>
+<item name='$Flags'><text>J!</text></item>
+<item name='$FlagsNoRefresh'><text/></item>
+<item name='$TITLE'><text>Development Collaboration Today
+#1CTTemplate</text></item></note>
+</database>
+
View
0 disk-collaborationtoday/AppProperties/xspdesign.properties
No changes.
View
39 ...borationtoday/Code/Java/biz/webgate/domino/mywebgate/api/MicroPublisherSessionFacade.java
@@ -0,0 +1,39 @@
+ /*
+ * © Copyright WebGate Consulting AG, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package biz.webgate.domino.mywebgate.api;
+
+import biz.webgate.domino.mywebgate.util.jsonparser.URLFetcherJSONParser;
+
+import com.ibm.domino.services.HttpServiceConstants;
+import com.ibm.domino.services.ServiceException;
+import com.ibm.domino.services.rest.RestServiceEngine;
+import com.ibm.xsp.extlib.component.rest.CustomService;
+import com.ibm.xsp.extlib.component.rest.CustomServiceBean;
+
+public class MicroPublisherSessionFacade extends CustomServiceBean {
+
+ @Override
+ public void renderService(CustomService service, RestServiceEngine engine)
+ throws ServiceException {
+ service
+ .setContentType(HttpServiceConstants.CONTENTTYPE_APPLICATION_JSON_UTF8);
+ if ("/micropublisher/fetchLink".equals(engine.getHttpRequest()
+ .getPathInfo())) {
+ URLFetcherJSONParser.getInstance().fetchURL(engine);
+ }
+ // TODO: Handle wrong URL
+ }
+}
View
18 ...oday/Code/Java/biz/webgate/domino/mywebgate/api/MicroPublisherSessionFacade.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="236" sequence="725" unid="8CAD2F65476EC95FC1257A44005B032E">
+<created><datetime dst="true">20120723T183405,90+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,31+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,30+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,31+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085926,26+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Christian Guedemann/O=WGC/C=CH</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Bruce Elgort/O=Sharepoint</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>biz/webgate/domino/mywebgate/api/MicroPublisherSessionFacade.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>biz/webgate/domino/mywebgate/api/MicroPublisherSessionFacade.java</text></item>
+
+
+</note>
View
225 disk-collaborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/URLFetcher.java
@@ -0,0 +1,225 @@
+/*
+ * © Copyright WebGate Consulting AG, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package biz.webgate.domino.mywebgate.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.cyberneko.html.parsers.DOMParser;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class URLFetcher {
+
+ private String m_URL;
+ private String m_Title = "";
+ private String m_Description = "";
+ private String m_URLContent = "";
+ private ArrayList<String> m_ThumbNails = new ArrayList<String>();
+
+ private Exception m_Exception;
+ private String m_Error;
+
+ private HashMap<String, String> m_OpenGraph = new HashMap<String, String>();
+
+ public URLFetcher(String url) {
+ super();
+ m_URL = url;
+ }
+
+ public String getURL() {
+ return m_URL;
+ }
+
+ public String getTitle() {
+ return m_Title;
+ }
+
+ public String getDescription() {
+ return m_Description == null ? "" : m_Description;
+ }
+
+ public ArrayList<String> getThumbNails() {
+ return m_ThumbNails;
+ }
+
+ public boolean fetchURL() {
+ try {
+ HttpClient httpClient = new DefaultHttpClient();
+
+ HttpGet httpGet = new HttpGet(m_URL);
+ httpGet.addHeader("Content-Type", "text/html; charset=utf-8");
+ HttpResponse response = httpClient.execute(httpGet);
+ int statusCode = response.getStatusLine().getStatusCode();
+
+ String strBaseURL = m_URL;
+ if (strBaseURL.lastIndexOf("/") > 8) {
+ strBaseURL = strBaseURL.substring(0, strBaseURL
+ .lastIndexOf("/"));
+ }
+
+ Document doc = null;
+ if (statusCode == 200) {
+ m_ThumbNails.add("no image");
+ HttpEntity entity = response.getEntity();
+ // String content = EntityUtils.toString(entity);
+
+ try {
+ DOMParser dpHTML = new DOMParser();
+ dpHTML
+ .setProperty(
+ "http://cyberneko.org/html/properties/default-encoding",
+ "utf-8");
+ // dpHTML.parse(new
+ // InputSource(EntityUtils.toString(entity)));
+ dpHTML.parse(new InputSource(entity.getContent()));
+ doc = dpHTML.getDocument();
+ NodeList ndlMet = doc.getElementsByTagName("meta");
+ NodeList ndlTitle = doc.getElementsByTagName("title");
+ NodeList ndlImage = doc.getElementsByTagName("img");
+ check4OpenGraphTags(ndlMet, strBaseURL);
+ if (m_Description.equals("")) {
+ for (int nCounter = 0; nCounter < ndlMet.getLength(); nCounter++) {
+ Element elCurrent = (Element) ndlMet.item(nCounter);
+ if ("description".equalsIgnoreCase(elCurrent
+ .getAttribute("name"))) {
+ if (elCurrent.hasAttribute("content")) {
+ m_Description = elCurrent
+ .getAttribute("content");
+ nCounter = ndlMet.getLength();
+ }
+ }
+ }
+ }
+ if (ndlTitle.getLength() > 0 && m_Title.equals("")) {
+ m_Title = ((Element) ndlTitle.item(0)).getFirstChild()
+ .getNodeValue();
+ }
+ for (int nCounter = 0; nCounter < ndlImage.getLength(); nCounter++) {
+ Element elCurrent = (Element) ndlImage.item(nCounter);
+ if (elCurrent.hasAttribute("src")) {
+ String strImage = elCurrent.getAttribute("src");
+ if (ndlImage.getLength() > 20
+ && elCurrent.hasAttribute("height")) {
+ String strHeight = elCurrent
+ .getAttribute("height");
+ strHeight.replace("px", "");
+ try {
+ int nHeight = Integer.parseInt(strHeight);
+ if (nHeight > 200) {
+ strImage = null;
+ }
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+ if (strImage != null) {
+ strImage = checkIMAGEURL(strImage, strBaseURL);
+
+ if (!m_ThumbNails.contains(strImage)) {
+ m_ThumbNails.add(strImage);
+ }
+ }
+ }
+ }
+ } catch (IllegalStateException e) {
+ m_Error = e.getLocalizedMessage();
+ m_Exception = e;
+ e.printStackTrace();
+ } catch (SAXException e) {
+ m_Error = e.getLocalizedMessage();
+ m_Exception = e;
+ e.printStackTrace();
+ } finally {
+ httpClient.getConnectionManager().shutdown();
+ }
+
+ }
+
+ } catch (Exception e) {
+ m_Error = e.getLocalizedMessage();
+ m_Exception = e;
+ e.printStackTrace();
+ return false;
+ }
+ return true;
+ }
+
+ private void check4OpenGraphTags(NodeList ndlMeta, String strBaseURL) {
+ for (int nCounter = 0; nCounter < ndlMeta.getLength(); nCounter++) {
+ Element elMeta = (Element) ndlMeta.item(nCounter);
+ // Test if property is available
+ if (elMeta.hasAttribute("property")) {
+ String strProperty = elMeta.getAttribute("property");
+ // CHECK if we have a OpenGraphProperty
+ if (strProperty.toLowerCase().startsWith("og:")) {
+ m_OpenGraph
+ .put(strProperty, elMeta.getAttribute("content"));
+ }
+ if ("og:image".equalsIgnoreCase(strProperty)) {
+ String strImage = checkIMAGEURL(elMeta.getAttribute("content"), strBaseURL);
+ m_ThumbNails.add(strImage);
+ }
+ if ("og:title".equalsIgnoreCase(strProperty)) {
+ m_Title = elMeta.getAttribute("content");
+ }
+ if ("og:url".equalsIgnoreCase(strProperty)) {
+ m_URLContent = elMeta.getAttribute("content");
+ }
+ if ("og:description".equalsIgnoreCase(strProperty)) {
+ m_Description = elMeta.getAttribute("content");
+ }
+ }
+ }
+ }
+
+ public Exception getException() {
+ return m_Exception;
+ }
+
+ public String getError() {
+ return m_Error;
+ }
+
+ public String getURLContent() {
+ return m_URLContent;
+ }
+
+ public HashMap<String, String> getOpenGraph() {
+ return m_OpenGraph;
+ }
+
+ private String checkIMAGEURL(String strImage, String strBaseURL) {
+ String strRC = strImage;
+ if (strRC.startsWith("//")) {
+ strRC = "http:" + strRC;
+ }
+ if (!strRC.toLowerCase().startsWith("http://")) {
+ strRC = strBaseURL + "/" + strRC;
+ }
+
+ return strRC;
+
+ }
+}
View
18 disk-collaborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/URLFetcher.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="29a" sequence="704" unid="78A1AF0033E82C9AC1257A44005B0372">
+<created><datetime dst="true">20120723T183406,58+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,29+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,28+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,29+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085929,24+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Christian Guedemann/O=WGC/C=CH</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>biz/webgate/domino/mywebgate/util/URLFetcher.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>biz/webgate/domino/mywebgate/util/URLFetcher.java</text></item>
+
+
+</note>
View
66 ...laborationtoday/Code/Java/biz/webgate/domino/mywebgate/util/builder/ErrorJSONBuilder.java
@@ -0,0 +1,66 @@
+ /*
+ * © Copyright WebGate Consulting AG, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package biz.webgate.domino.mywebgate.util.builder;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import com.ibm.domino.services.rest.RestServiceEngine;
+import com.ibm.domino.services.util.JsonWriter;
+
+public class ErrorJSONBuilder {
+
+ private static ErrorJSONBuilder m_Builder;
+
+ private ErrorJSONBuilder() {
+
+ }
+
+ public static synchronized ErrorJSONBuilder getInstance() {
+ if (m_Builder == null) {
+ m_Builder = new ErrorJSONBuilder();
+ }
+ return m_Builder;
+ }
+
+ public void processError2JSON(RestServiceEngine engine, int nError,
+ String strError, Exception ex) {
+ try {
+ engine.getHttpResponse().getWriter().flush();
+ JsonWriter jsWriter = new JsonWriter(engine.getHttpResponse()
+ .getWriter(), true);
+ jsWriter.startObject();
+ jsWriter.startProperty("error");
+ jsWriter.outStringLiteral(strError);
+ jsWriter.endProperty();
+ jsWriter.startProperty("errornr");
+ jsWriter.outIntLiteral(nError);
+ jsWriter.endProperty();
+ if (ex != null) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ ex.printStackTrace(pw);
+ jsWriter.startProperty("trace");
+ jsWriter.outStringLiteral(sw.toString());
+ jsWriter.endProperty();
+ }
+ jsWriter.endObject();
+ jsWriter.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
View
18 ...ntoday/Code/Java/biz/webgate/domino/mywebgate/util/builder/ErrorJSONBuilder.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="226" sequence="686" unid="EBDB041285DB7792C1257A44005B0363">
+<created><datetime dst="true">20120723T183406,43+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,27+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,26+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,27+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085926,18+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Christian Guedemann/O=WGC/C=CH</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>biz/webgate/domino/mywebgate/util/builder/ErrorJSONBuilder.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>biz/webgate/domino/mywebgate/util/builder/ErrorJSONBuilder.java</text></item>
+
+
+</note>
View
128 ...iontoday/Code/Java/biz/webgate/domino/mywebgate/util/jsonparser/URLFetcherJSONParser.java
@@ -0,0 +1,128 @@
+/*
+ * © Copyright WebGate Consulting AG, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package biz.webgate.domino.mywebgate.util.jsonparser;
+
+import java.io.Reader;
+import java.util.Iterator;
+
+import biz.webgate.domino.mywebgate.util.URLFetcher;
+import biz.webgate.domino.mywebgate.util.builder.ErrorJSONBuilder;
+
+import com.ibm.commons.util.io.json.JsonJavaFactory;
+import com.ibm.commons.util.io.json.JsonJavaObject;
+import com.ibm.commons.util.io.json.JsonParser;
+import com.ibm.domino.services.rest.RestServiceEngine;
+import com.ibm.domino.services.util.JsonWriter;
+
+public class URLFetcherJSONParser {
+
+ private static URLFetcherJSONParser m_Parser;
+
+ private URLFetcherJSONParser() {
+
+ }
+
+ public static synchronized URLFetcherJSONParser getInstance() {
+ if (m_Parser == null) {
+ m_Parser = new URLFetcherJSONParser();
+ }
+ return m_Parser;
+ }
+
+ public void fetchURL(RestServiceEngine engine) {
+ JsonJavaObject json = null;
+ JsonJavaFactory factory = JsonJavaFactory.instanceEx;
+
+ try {
+ Reader r = engine.getHttpRequest().getReader();
+ json = (JsonJavaObject) JsonParser.fromJson(factory, r);
+ String strMethod = "url.fetchmetadata"; //json.getString("method");
+ String strLink = json.getString("link");
+ if ("url.fetchmetadata".equalsIgnoreCase(strMethod)) {
+ URLFetcher urlFetcher = new URLFetcher(strLink);
+ if (urlFetcher.fetchURL()) {
+ JsonWriter jsWriter = new JsonWriter(engine
+ .getHttpResponse().getWriter(), true);
+ jsWriter.startObject();
+ jsWriter.startProperty("result");
+ jsWriter.outStringLiteral("ok");
+ jsWriter.endProperty();
+
+ // Title
+ jsWriter.startProperty("title");
+ jsWriter.outStringLiteral(urlFetcher.getTitle());
+ jsWriter.endProperty();
+ // Description
+ jsWriter.startProperty("desc");
+ jsWriter.outStringLiteral(urlFetcher.getDescription());
+ jsWriter.endProperty();
+ // url
+ jsWriter.startProperty("url");
+ jsWriter.outStringLiteral(urlFetcher.getURL());
+ jsWriter.endProperty();
+
+ jsWriter.startProperty("images");
+ jsWriter.startArray();
+
+ for (Iterator<String> itImg = urlFetcher.getThumbNails()
+ .iterator(); itImg.hasNext();) {
+ jsWriter.startArrayItem();
+ jsWriter.outStringLiteral(itImg.next());
+ jsWriter.endArrayItem();
+ }
+ jsWriter.endArray();
+
+ jsWriter.endProperty();
+
+ jsWriter.startProperty("opengraph");
+ if (urlFetcher.getOpenGraph().size() > 0) {
+
+ jsWriter.startObject();
+
+ for (Iterator<String> itOG = urlFetcher.getOpenGraph()
+ .keySet().iterator(); itOG.hasNext();) {
+ String strOGTag = itOG.next();
+ jsWriter.startProperty(strOGTag);
+ jsWriter.outStringLiteral(urlFetcher.getOpenGraph()
+ .get(strOGTag));
+ jsWriter.endProperty();
+ }
+ jsWriter.endObject();
+ } else {
+ jsWriter.outStringLiteral("");
+ }
+ jsWriter.endProperty();
+ jsWriter.endObject();
+
+ jsWriter.close();
+ return;
+ } else {
+ ErrorJSONBuilder.getInstance().processError2JSON(engine,
+ 5001, urlFetcher.getError(),
+ urlFetcher.getException());
+ return;
+ }
+
+ }
+ ErrorJSONBuilder.getInstance().processError2JSON(engine, 5002,
+ "Unknown Command " + strMethod, null);
+
+ } catch (Exception e) {
+ ErrorJSONBuilder.getInstance().processError2JSON(engine, 5999,
+ "Error during URLFetcherJSONParser", e);
+ }
+ }
+}
View
18 ...Code/Java/biz/webgate/domino/mywebgate/util/jsonparser/URLFetcherJSONParser.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="25e" sequence="692" unid="C8E98296831C2719C1257A44005B036E">
+<created><datetime dst="true">20120723T183406,54+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,25+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,24+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,25+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085926,48+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Christian Guedemann/O=WGC/C=CH</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>biz/webgate/domino/mywebgate/util/jsonparser/URLFetcherJSONParser.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>biz/webgate/domino/mywebgate/util/jsonparser/URLFetcherJSONParser.java</text></item>
+
+
+</note>
View
49 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Category.java
@@ -0,0 +1,49 @@
+package org.openntf.news.http.core;
+
+/*
+ * © Copyright IBM, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Author: Niklas Heidloff - niklas_heidloff@de.ibm.com
+ */
+
+public class Category {
+
+ private String _iD;
+ private String _description;
+ private String _displayName;
+
+ public Category(String iD, String displayName,
+ String description) {
+ _iD = iD;
+ _description = description;
+ _displayName = displayName;
+ }
+
+ public static Category getEmptyCategory() {
+ return new Category("", "", "");
+ }
+
+ public String getID() {
+ return _iD;
+ }
+
+ public String getDescription() {
+ return _description;
+ }
+
+ public String getDisplayName() {
+ return _displayName;
+ }
+}
View
18 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Category.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="1ce" sequence="449" unid="58D2DE9D1C195EF9C1257A68003027D4">
+<created><datetime dst="true">20120828T104559,24+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,23+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,22+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,23+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085925,71+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>org/openntf/news/http/core/Category.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>org/openntf/news/http/core/Category.java</text></item>
+
+
+</note>
View
58 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Click.java
@@ -0,0 +1,58 @@
+package org.openntf.news.http.core;
+
+/*
+ * © Copyright IBM, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Author: Niklas Heidloff - niklas_heidloff@de.ibm.com
+ */
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Click implements Serializable {
+
+ static final long serialVersionUID = 1;
+
+ private String _nID;
+ private String _ip;
+ private Date _date;
+
+ public Click() {
+ }
+
+ public void setNID(String nID) {
+ _nID = nID;
+ }
+
+ public void setIP(String ip) {
+ _ip = ip;
+ }
+
+ public void setDate(Date date) {
+ _date = date;
+ }
+
+ public String getNID() {
+ return _nID;
+ }
+
+ public String getIP() {
+ return _ip;
+ }
+
+ public Date getDate() {
+ return _date;
+ }
+}
View
18 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Click.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="1f6" sequence="604" unid="CD74964D774775B6C1257A4D0051EEA7">
+<created><datetime dst="true">20120801T165455,11+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,21+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,20+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,21+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085925,94+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>org/openntf/news/http/core/Click.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>org/openntf/news/http/core/Click.java</text></item>
+
+
+</note>
View
112 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ClickCache.java
@@ -0,0 +1,112 @@
+package org.openntf.news.http.core;
+
+/*
+ * Copyright IBM, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Author: Niklas Heidloff - niklas_heidloff@de.ibm.com
+ */
+
+import java.util.Iterator;
+import java.util.HashSet;
+import java.util.Date;
+import com.ibm.xsp.extlib.util.ExtLibUtil;
+import java.util.Calendar;
+
+import javax.faces.context.FacesContext;
+
+import lotus.domino.Database;
+import lotus.domino.Name;
+import lotus.domino.NotesException;
+
+public class ClickCache {
+
+ private HashSet<Click> _clicks;
+ private Date _lastJob;
+
+ public ClickCache() {
+ if (_clicks == null) {
+ _clicks = new HashSet<Click>();
+ }
+ if (_lastJob == null) {
+ _lastJob = new Date();
+ }
+ }
+
+ public synchronized void addClick(Click click, boolean forceRun) {
+ if (click != null) {
+ click.setDate(new Date());
+ _clicks.add(click);
+ }
+ boolean run = false;
+ if (forceRun) {
+ run = true;
+ }
+ else {
+ if (runAgain()) {
+ run = true;
+ }
+ }
+
+ if (run) {
+ HashSet<Click> clicksToBeSaved = _clicks;
+ _clicks = new HashSet<Click>();
+ _lastJob = new Date();
+ try {
+ Database db = ExtLibUtil.getCurrentDatabase();
+ WriteCacheJob.start(clicksToBeSaved, db.getFilePath());
+ } catch (NotesException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private boolean runAgain() {
+ boolean output = false;
+ //int minutes = 1;
+ int minutes = 5;
+
+ try {
+ String userName;
+ userName = com.ibm.xsp.extlib.social.SocialServicesFactory.getInstance().getAuthenticatedUserId(javax.faces.context.FacesContext.getCurrentInstance());
+ Name name = com.ibm.xsp.extlib.util.ExtLibUtil.getCurrentSession().createName(userName);
+ userName = name.getCommon();
+
+ if (userName.equalsIgnoreCase("Anonymous")) {
+ return false;
+ }
+ FacesContext context = FacesContext.getCurrentInstance();
+ ConfigCache config = (ConfigCache) context.getApplication()
+ .getVariableResolver().resolveVariable(context,
+ "configCache");
+
+ if (config.isUserModerator(userName)) {
+ Calendar now = Calendar.getInstance();
+ Calendar last = Calendar.getInstance();
+ now.setTime(new Date());
+ last.setTime(_lastJob);
+ long millisecondsNow = now.getTimeInMillis();
+ long millisecondsLast = last.getTimeInMillis();
+ long diff = millisecondsNow - millisecondsLast;
+ long diffMinutes = diff / (60 * 1000);
+
+ if (diffMinutes >= minutes)
+ output = true;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return output;
+ }
+}
View
18 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ClickCache.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="24e" sequence="724" unid="1F29B6FEB51803FFC1257A4D0051BD94">
+<created><datetime dst="true">20120801T165249,48+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,19+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,18+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,19+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085926,38+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Jesse Gallagher/O=Frost</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>org/openntf/news/http/core/ClickCache.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>org/openntf/news/http/core/ClickCache.java</text></item>
+
+
+</note>
View
398 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ConfigCache.java
@@ -0,0 +1,398 @@
+package org.openntf.news.http.core;
+
+/*
+ * Copyright IBM, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Author: Niklas Heidloff - niklas_heidloff@de.ibm.com
+ */
+
+/*
+ * 2012-09-29 - Jesse Gallagher
+ * Modified view looping to setAutoUpdate(false), only run
+ * .getColumnValues() once per entry, and to use .setPreferJavaDates
+ */
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Vector;
+import java.util.HashMap;
+import java.util.List;
+import lotus.domino.Database;
+import lotus.domino.Document;
+import lotus.domino.Item;
+import lotus.domino.Name;
+import lotus.domino.NotesException;
+import lotus.domino.View;
+import lotus.domino.ACL;
+import lotus.domino.ACLEntry;
+import lotus.domino.ViewEntry;
+import lotus.domino.ViewNavigator;
+import com.ibm.xsp.extlib.util.ExtLibUtil;
+
+public class ConfigCache {
+
+ private boolean _isCached = false;
+ private ArrayList<Type> _types;
+ private ArrayList<Category> _categories;
+ private String _captchaPublicKey;
+ private String _captchaPrivateKey;
+ private String _analyticsJS;
+
+ public ConfigCache() {
+ }
+
+ public void update() {
+ _isCached = false;
+ _types = null;
+ _categories = null;
+ _captchaPublicKey = "";
+ _captchaPrivateKey = "";
+ _analyticsJS = "";
+ initialize();
+ }
+
+ public ArrayList<Type> getTypes() {
+ initialize();
+ return _types;
+ }
+
+ public ArrayList<Category> getCategories() {
+ initialize();
+ return _categories;
+ }
+
+ public void setCaptchaPublicKey(String captchaPublicKey) {
+ _captchaPublicKey = captchaPublicKey;
+ }
+
+ public String getAnalyticsJS() {
+ return _analyticsJS;
+ }
+
+ public void setCaptchaPrivateKey(String captchaPrivateKey) {
+ _captchaPrivateKey = captchaPrivateKey;
+ }
+
+ public String getCaptchaPublicKey() {
+ return _captchaPublicKey;
+ }
+
+ public String getCaptchaPrivateKey() {
+ return _captchaPrivateKey;
+ }
+
+ @SuppressWarnings("unchecked")
+ private synchronized void init() {
+ _types = new ArrayList<Type>();
+ _categories = new ArrayList<Category>();
+ _captchaPublicKey = "";
+ _captchaPrivateKey = "";
+ _analyticsJS = "";
+
+ Database db = ExtLibUtil.getCurrentDatabase();
+ View viewTypesAll = null;
+ View viewCategoriesAll = null;
+ View viewConfigAll = null;
+ ViewNavigator viewNavigatorTypes = null;
+ ViewNavigator viewNavigatorConfig = null;
+ ViewNavigator viewNavigatorCategories = null;
+
+ try {
+ viewTypesAll = db.getView("TypesAll");
+ viewTypesAll.setAutoUpdate(false);
+ viewNavigatorTypes = viewTypesAll.createViewNav();
+ ViewEntry tmpEntry;
+ ViewEntry entry = viewNavigatorTypes.getFirst();
+ while (entry != null) {
+ if (entry.isCategory() == false) {
+ entry.setPreferJavaDates(true);
+ List<Object> columnValues = entry.getColumnValues();
+
+ Vector<Object> moderators = new Vector<Object>();
+ Document doc = entry.getDocument();
+ Item moderatorsItem = doc.getFirstItem("TModerators");
+ if (moderatorsItem != null) moderators = moderatorsItem.getValues();
+ Type type = new Type((String)columnValues.get(2),
+ (String)columnValues.get(3),
+ moderators,
+ (String)columnValues.get(4),
+ (String)columnValues.get(0),
+ (String)columnValues.get(5));
+ _types.add(type);
+ }
+
+ tmpEntry = viewNavigatorTypes.getNext();
+ entry.recycle();
+ entry = tmpEntry;
+ }
+
+ viewCategoriesAll = db.getView("CategoriesAll");
+ viewCategoriesAll.setAutoUpdate(false);
+ viewNavigatorCategories = viewCategoriesAll.createViewNav();
+ entry = viewNavigatorCategories.getFirst();
+ while (entry != null) {
+ if (entry.isCategory() == false) {
+ entry.setPreferJavaDates(true);
+ List<Object> columnValues = entry.getColumnValues();
+
+ Category category = new Category((String)columnValues.get(1),
+ (String)columnValues.get(2),
+ (String)columnValues.get(3));
+ _categories.add(category);
+ }
+
+ tmpEntry = viewNavigatorCategories.getNext();
+ entry.recycle();
+ entry = tmpEntry;
+ }
+
+ viewConfigAll = db.getView("ConfigAll");
+ viewConfigAll.setAutoUpdate(false);
+ viewNavigatorConfig = viewConfigAll.createViewNav();
+ entry = viewNavigatorConfig.getFirst();
+ if (entry != null) {
+ Document doc = entry.getDocument();
+ if (doc != null) {
+ setCaptchaPublicKey(doc.getItemValueString("COCaptchaPublicKey"));
+ setCaptchaPrivateKey(doc.getItemValueString("COCaptchaPrivateKey"));
+ _analyticsJS = doc.getItemValueString("COAnalytics");
+ doc.recycle();
+ }
+ entry.recycle();
+ }
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ return;
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ return;
+ }
+ finally {
+ try {
+ if (viewNavigatorTypes != null) {
+ viewNavigatorTypes.recycle();
+ }
+ if (viewNavigatorCategories != null) {
+ viewNavigatorCategories.recycle();
+ }
+ if (viewTypesAll != null) {
+ viewTypesAll.recycle();
+ }
+ if (viewConfigAll != null) {
+ viewConfigAll.recycle();
+ }
+ if (viewCategoriesAll != null) {
+ viewCategoriesAll.recycle();
+ }
+ }
+ catch (NotesException e) {
+ e.printStackTrace();
+ return;
+ }
+ }
+ _isCached = true;
+ }
+
+ private void initialize() {
+ if (_isCached) return;
+ init();
+ }
+
+
+ public Type getType(String tID) {
+ initialize();
+ if (_types == null) return Type.getEmptyType();
+ Iterator it = _types.iterator();
+ for (; it.hasNext();) {
+ Type type = (Type)it.next();
+ if (type.getID().equalsIgnoreCase(tID)) return type;
+ }
+ return Type.getEmptyType();
+ }
+
+ public Category getCategory(String cID) {
+ initialize();
+ if (_categories == null) return Category.getEmptyCategory();
+ Iterator it = _categories.iterator();
+ for (; it.hasNext();) {
+ Category category = (Category)it.next();
+ if (category.getID().equalsIgnoreCase(cID)) return category;
+ }
+ return Category.getEmptyCategory();
+ }
+
+ public Vector getTypesForCurrentUserCombobox() {
+ String user;
+ Vector output = null;
+ try {
+ String userName;
+ userName = com.ibm.xsp.extlib.social.SocialServicesFactory.getInstance().getAuthenticatedUserId(javax.faces.context.FacesContext.getCurrentInstance());
+ Name name = com.ibm.xsp.extlib.util.ExtLibUtil.getCurrentSession().createName(userName);
+ userName = name.getCommon();
+ initialize();
+
+ output = new Vector();
+ Iterator it = _types.iterator();
+ for (; it.hasNext();) {
+ Type type = (Type)it.next();
+ Vector moderators = type.getModerators();
+ if (moderators != null) {
+ if (moderators.contains(userName)) {
+ Category category = getCategory(type.getCategoryId());
+ if (category != null)
+ output.add(category.getDisplayName() + " - " + type.getDisplayName() + "|" + type.getID());
+ }
+ }
+ }
+ }
+ catch (NotesException e) {
+ }
+ return output;
+ }
+
+ public Vector getCategoriesCombobox() {
+ Vector output = new Vector();
+ output.add("Top|top");
+ initialize();
+ if (_categories != null) {
+ Iterator it = _categories.iterator();
+ for (; it.hasNext();) {
+ Category category = (Category)it.next();
+ output.add(category.getDisplayName() + "|" + category.getID());
+ }
+ }
+ return output;
+ }
+
+ public Vector getTypesForCurrentUser() {
+ String user;
+ Vector output = null;
+ try {
+ String userName;
+ userName = com.ibm.xsp.extlib.social.SocialServicesFactory.getInstance().getAuthenticatedUserId(javax.faces.context.FacesContext.getCurrentInstance());
+ Name name = com.ibm.xsp.extlib.util.ExtLibUtil.getCurrentSession().createName(userName);
+ userName = name.getCommon();
+ initialize();
+
+ output = new Vector();
+ Iterator it = _types.iterator();
+ for (; it.hasNext();) {
+ Type type = (Type)it.next();
+ Vector moderators = type.getModerators();
+ if (moderators != null) {
+ if (moderators.contains(userName))
+ output.add(type);
+ }
+ }
+ }
+ catch (NotesException e) {
+ }
+ return output;
+ }
+
+ public Vector getTypesForCategory(String categoryId) {
+ initialize();
+ Vector output = new Vector();
+ if (_types == null) return output;
+ Iterator it = _types.iterator();
+ for (; it.hasNext();) {
+ Type type = (Type)it.next();
+ if (categoryId.equalsIgnoreCase(type.getCategoryId())) {
+ output.add(type);
+ }
+ }
+ return output;
+ }
+
+ private HashMap<String, Boolean> _moderators;
+ private HashMap<String, Boolean> _topStoriesModerators;
+ private HashMap<String, Boolean> _spotlightModerators;
+ private HashMap<String, Boolean> _avatarModerators;
+
+ public boolean isUserAvatarModerator(String user) {
+ if (_avatarModerators == null) _avatarModerators = new HashMap<String, Boolean>();
+ Boolean isModerator = _avatarModerators.get(user);
+ if (isModerator == null) {
+ isModerator = new Boolean(hasUserRole(user, "[AvatarModerator]"));
+ _avatarModerators.put(user, isModerator);
+ }
+ return isModerator.booleanValue();
+ }
+
+ public boolean isUserModerator(String user) {
+ if (_moderators == null) _moderators = new HashMap<String, Boolean>();
+ Boolean isModerator = _moderators.get(user);
+ if (isModerator == null) {
+ isModerator = new Boolean(hasUserRole(user, "[Moderator]"));
+ _moderators.put(user, isModerator);
+ }
+ return isModerator.booleanValue();
+ }
+
+ public boolean isUserTopStoriesModerator(String user) {
+ if (_topStoriesModerators == null) _topStoriesModerators = new HashMap<String, Boolean>();
+ Boolean isModerator = _topStoriesModerators.get(user);
+ if (isModerator == null) {
+ isModerator = new Boolean(hasUserRole(user, "[TopModerator]"));
+ _topStoriesModerators.put(user, isModerator);
+ }
+ return isModerator.booleanValue();
+ }
+
+ public boolean isUserSpotlightModerator(String user) {
+ if (_spotlightModerators == null) _spotlightModerators = new HashMap<String, Boolean>();
+ Boolean isModerator = _spotlightModerators.get(user);
+ if (isModerator == null) {
+ isModerator = new Boolean(hasUserRole(user, "[SpotModerator]"));
+ _spotlightModerators.put(user, isModerator);
+ }
+ return isModerator.booleanValue();
+ }
+
+ private boolean hasUserRole(String user, String roleName) {
+ boolean output = false;
+ Vector roles = getUserRoles(user);
+ if (roles != null) {
+ Iterator it = roles.iterator();
+ for (; it.hasNext();) {
+ String role = (String)it.next();
+ if (role.equalsIgnoreCase(roleName)) {
+ output = true;
+ }
+ }
+ }
+ return output;
+ }
+
+ private Vector getUserRoles(String user) {
+ Vector roles = null;
+ Database db = ExtLibUtil.getCurrentDatabase();
+ try {
+ ACL acl = db.getACL();
+ if (acl != null) {
+ ACLEntry entry = acl.getEntry(user);
+ if (entry != null) {
+ roles = entry.getRoles();
+ }
+ }
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ return roles;
+ }
+}
View
18 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/ConfigCache.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="2be" sequence="703" unid="FCBE991174B31681C1257A4D00415D56">
+<created><datetime dst="true">20120801T135357,34+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,17+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,16+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,17+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120914T085930,81+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Per Henrik Lausten/O=PHL Consult</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Jesse Gallagher/O=Frost</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>org/openntf/news/http/core/ConfigCache.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>org/openntf/news/http/core/ConfigCache.java</text></item>
+
+
+</note>
View
148 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateChecker.java
@@ -0,0 +1,148 @@
+package org.openntf.news.http.core;
+
+import java.util.ArrayList;
+
+import lotus.domino.Database;
+import lotus.domino.DocumentCollection;
+import lotus.domino.NotesException;
+import lotus.domino.View;
+import lotus.domino.ViewEntry;
+import lotus.domino.ViewEntryCollection;
+import lotus.domino.Document;
+
+import com.ibm.xsp.extlib.util.ExtLibUtil;
+
+public class DuplicateChecker {
+ ArrayList<DuplicateEntry> duplicatesList = new ArrayList<DuplicateEntry>();
+
+ public DuplicateChecker(){
+
+ }
+
+ public ArrayList<DuplicateEntry> checkDuplicates(String sNID, String sNTitle, String sNLink, Boolean bDoFuzzySearch){
+
+ try{
+ //clear HashMap
+ duplicatesList.clear();
+ //step 1: check if link already exist in database.
+ if(!checkIfLinkAllReadyExist(sNID, sNTitle, sNLink)){
+ //step 2: if step 1 did not get results, do fuzzy search title
+ if(bDoFuzzySearch){
+ doFuzzySearch(sNID, sNTitle, sNLink);
+ }
+ }
+
+ }catch(Exception e){
+
+ }finally{
+
+ }
+ return this.getDuplicatesList();
+ }
+
+ private boolean checkIfLinkAllReadyExist(String sNID, String sNTitle, String sNLink1){
+ boolean bCheck = false;
+ String sNLink;
+ View vw = null;
+ ViewEntryCollection vec = null;
+ try{
+ if(sNLink1.indexOf("#")>0){
+ sNLink = sNLink1.substring(0, sNLink1.indexOf("#"));
+ }else{
+ sNLink = new String(sNLink1);
+ }
+
+ Database db = ExtLibUtil.getCurrentDatabase();
+ vw = db.getView("NewsAllbyLink");
+ vec = vw.getAllEntriesByKey(sNLink,true);
+ if(vec.getCount()>0){
+ ViewEntry entry = vec.getFirstEntry();
+ while(entry!=null){
+ ViewEntry tmpEntry = vec.getNextEntry(entry);
+ Document doc = entry.getDocument();
+ if(doc.getItemValueString("NID").compareTo(sNID)!=0){
+ //the document is not the current document
+ bCheck = true;
+ DuplicateEntry dup = new DuplicateEntry();
+ dup.setNid(doc.getItemValueString("NID"));
+ dup.setNLink(doc.getItemValueString("NLink"));
+ dup.setNTitle(doc.getItemValueString("NTitle"));
+
+ duplicatesList.add(dup);
+ }
+ entry.recycle();
+ entry = tmpEntry;
+ }
+ }
+ if(vw!=null){
+ vw.recycle();
+ }
+
+ }catch(Exception e){
+
+ }finally{
+ try {
+ if(vec!=null){
+ vec.recycle();
+ }
+ if(vw!=null){
+ vw.recycle();
+ }
+ } catch (NotesException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ return bCheck;
+ }
+
+ @SuppressWarnings("static-access")
+ private boolean doFuzzySearch(String sNID, String sNTitle, String sNLink){
+ boolean bCheck = false;
+ DocumentCollection dc = null;
+ try{
+ Database db = ExtLibUtil.getCurrentDatabase();
+ dc = db.FTSearch(sNTitle, 30, db.FT_SCORES, db.FT_FUZZY);
+ if(dc.getCount()>0){
+ Document doc = dc.getFirstDocument();
+ while(doc!=null){
+ Document docNext = dc.getNextDocument(doc);
+ if(doc.getItemValueString("NID").compareTo(sNID)!=0){
+ //the document is not the current document
+ bCheck = true;
+ DuplicateEntry dup = new DuplicateEntry();
+ dup.setNid(doc.getItemValueString("NID"));
+ dup.setNLink(doc.getItemValueString("NLink"));
+ dup.setNTitle(doc.getItemValueString("NTitle"));
+
+ duplicatesList.add(dup);
+ }
+ doc.recycle();
+ doc = docNext;
+ }
+ }
+
+ }catch(Exception e){
+
+ }finally{
+ try {
+ if(dc!=null){
+ dc.recycle();
+ }
+ } catch (NotesException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return bCheck;
+ }
+
+ public ArrayList<DuplicateEntry> getDuplicatesList() {
+ return duplicatesList;
+ }
+
+ public void setDuplicatesList(ArrayList<DuplicateEntry> duplicatesList) {
+ this.duplicatesList = duplicatesList;
+ }
+}
View
18 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateChecker.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="3ae" sequence="179" unid="DB514FAD1D4390BDC1257A7C004DC55B">
+<created><datetime dst="true">20120917T160927,95+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,15+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,14+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,15+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120918T080307,26+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>org/openntf/news/http/core/DuplicateChecker.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>org/openntf/news/http/core/DuplicateChecker.java</text></item>
+
+
+</note>
View
37 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateEntry.java
@@ -0,0 +1,37 @@
+package org.openntf.news.http.core;
+
+public class DuplicateEntry {
+
+ private String Nid;
+ private String NTitle;
+ private String NLink;
+
+ public DuplicateEntry(){
+
+ }
+
+ public String getNid() {
+ return Nid;
+ }
+
+ public void setNid(String nid) {
+ Nid = nid;
+ }
+
+ public String getNTitle() {
+ return NTitle;
+ }
+
+ public void setNTitle(String title) {
+ NTitle = title;
+ }
+
+ public String getNLink() {
+ return NLink;
+ }
+
+ public void setNLink(String link) {
+ NLink = link;
+ }
+
+}
View
18 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/DuplicateEntry.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="3a2" sequence="72" unid="4FCABB309ECC5B81C1257A7C00512E2D">
+<created><datetime dst="true">20120917T164642,37+02</datetime></created>
+<modified><datetime dst="true">20121022T084228,13+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,12+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,13+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20120918T080304,87+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name><name>CN=Frank van der Linden/OU=EOF/O=EOG</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>org/openntf/news/http/core/DuplicateEntry.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>org/openntf/news/http/core/DuplicateEntry.java</text></item>
+
+
+</note>
View
36 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/MiscUtils.java
@@ -0,0 +1,36 @@
+package org.openntf.news.http.core;
+
+import java.util.Date;
+
+import lotus.domino.DateTime;
+import lotus.domino.NotesException;
+
+public class MiscUtils {
+ private MiscUtils() { }
+
+ // Methods for coaxing column values to desired data types, with DateTime recycling
+ public static Date getColumnValueAsDate(Object columnValue) {
+ try {
+ if(columnValue instanceof DateTime) {
+ DateTime dt = (DateTime)columnValue;
+ Date date = dt.toJavaDate();
+ dt.recycle();
+ return date;
+ } else if(columnValue instanceof Date) {
+ return (Date)columnValue;
+ }
+ } catch(NotesException ne) { }
+ return new Date();
+ }
+ public static Double getColumnValueAsDouble(Object columnValue) {
+ try {
+ if(columnValue instanceof DateTime) {
+ ((DateTime)columnValue).recycle();
+ return 0d;
+ } else if(columnValue instanceof Double) {
+ return (Double)columnValue;
+ }
+ } catch(NotesException ne) { }
+ return 0d;
+ }
+}
View
18 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/MiscUtils.java.metadata
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="4.0" replicaid="86257A780060902F" version="8.5" xmlns="http://www.lotus.com/dxl">
+<noteinfo noteid="3ca" sequence="26" unid="FA7ABC31D4ABBA6F86257A89004B2B95">
+<created><datetime dst="true">20120930T084103,57-05</datetime></created>
+<modified><datetime dst="true">20121022T084228,11+02</datetime></modified>
+<revised><datetime dst="true">20121022T084228,10+02</datetime></revised>
+<lastaccessed><datetime dst="true">20121022T084228,11+02</datetime></lastaccessed>
+<addedtofile><datetime dst="true">20121004T085911,61+02</datetime></addedtofile></noteinfo>
+<updatedby><name>CN=Jesse Gallagher/O=Frost</name><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></updatedby>
+<wassignedby><name>CN=Niklas Heidloff/OU=Germany/O=IBM</name></wassignedby>
+<item name="$Flags"><text>34567Cg~[</text></item>
+<item name="$TITLE"><text>org/openntf/news/http/core/MiscUtils.java</text></item>
+<item name="$DesignerVersion"><text>8.5.3</text></item>
+
+
+<item name="$FileNames" sign="true"><text>org/openntf/news/http/core/MiscUtils.java</text></item>
+
+
+</note>
View
351 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/NewsCache.java
@@ -0,0 +1,351 @@
+package org.openntf.news.http.core;
+
+/*
+ * Copyright IBM, 2012
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Author: Niklas Heidloff - niklas_heidloff@de.ibm.com
+ */
+
+/*
+ * 2012-09-29 - Jesse Gallagher
+ * Modified view looping to setAutoUpdate(false), only run
+ * .getColumnValues() once per entry, and to use .setPreferJavaDates
+ */
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.TreeMap;
+import java.util.List;
+import javax.faces.context.FacesContext;
+import lotus.domino.Database;
+import lotus.domino.NotesException;
+import lotus.domino.View;
+import lotus.domino.ViewEntry;
+import lotus.domino.ViewNavigator;
+import com.ibm.xsp.extlib.util.ExtLibUtil;
+
+public class NewsCache {
+
+ private boolean _isCached = false;
+ private ArrayList<NewsEntry> _newsEntries;
+ private ArrayList<NewsEntry> _spotlightNewsEntries;
+ private ArrayList<NewsEntry> _topTopStories;
+ private ArrayList<NewsEntry> _popularNewsEntries;
+ private HashMap<String, ArrayList<NewsEntry>> _typedNewsEntries;
+ private HashMap<String, ArrayList<NewsEntry>> _categorizedTopNewsEntries;
+ private Date _lastUpdated;
+
+ public NewsCache() {
+ _lastUpdated = new Date();
+ }
+
+ public Date getLastUpdated() {
+ return _lastUpdated;
+ }
+
+ public void update() {
+ _lastUpdated = new Date();
+ _isCached = false;
+ _spotlightNewsEntries = null;
+ _newsEntries = null;
+ _popularNewsEntries = null;
+ _typedNewsEntries = null;
+ _topTopStories = null;
+ _categorizedTopNewsEntries = null;
+ initialize();
+ }
+
+ public HashMap<String, ArrayList<NewsEntry>> getCategorizedTopNewsEntries() {
+ initialize();
+ return _categorizedTopNewsEntries;
+ }
+
+ private ArrayList<NewsEntry> getTypedEntriesList(String tID) {
+ ArrayList<NewsEntry> newsEntries = null;
+ newsEntries = (ArrayList<NewsEntry>) _typedNewsEntries.get(tID);
+ if (newsEntries == null) {
+ newsEntries = new ArrayList<NewsEntry>();
+ _typedNewsEntries.put(tID, newsEntries);
+ }
+ return newsEntries;
+ }
+
+ private ArrayList<NewsEntry> getCategorizedTopEntriesList(String cID) {
+ ArrayList<NewsEntry> newsEntries = null;
+ newsEntries = (ArrayList<NewsEntry>) _categorizedTopNewsEntries
+ .get(cID);
+ if (newsEntries == null) {
+ newsEntries = new ArrayList<NewsEntry>();
+ _categorizedTopNewsEntries.put(cID, newsEntries);
+ }
+ return newsEntries;
+ }
+
+ @SuppressWarnings("unchecked")
+ private synchronized void init() {
+ _newsEntries = new ArrayList<NewsEntry>();
+ _spotlightNewsEntries = new ArrayList<NewsEntry>();
+ _topTopStories = new ArrayList<NewsEntry>();
+ _typedNewsEntries = new HashMap<String, ArrayList<NewsEntry>>();
+ _categorizedTopNewsEntries = new HashMap<String, ArrayList<NewsEntry>>();
+
+ Database db = ExtLibUtil.getCurrentDatabase();
+ View view = null;
+ ViewNavigator navigator = null;
+ FacesContext context = FacesContext.getCurrentInstance();
+ ConfigCache config = (ConfigCache) context.getApplication()
+ .getVariableResolver().resolveVariable(context, "configCache");
+
+ try {
+ view = db.getView("NewsModeratedCached");
+ view.setAutoUpdate(false);
+ navigator = view.createViewNav();
+ ViewEntry tmpEntry;
+ ViewEntry entry = navigator.getFirst();
+ while (entry !=