[kune-commits] r1346 - in trunk: img src/main/java/cc/kune/core/client/rpcservices src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/access src/main/java/cc/kune/core/server/content src/main/java/cc/kune/core/server/rpc src/main/java/cc/kune/core/server/state src/main/java/cc/kune/core/shared/dto src/main/java/cc/kune/domain src/main/java/cc/kune/gspace/client/actions src/main/java/cc/kune/gspace/client/viewers src/main/resources src/main/resources/META-INF src/test/java/cc/kune/core/server src/test/java/cc/kune/core/server/access src/test/java/cc/kune/core/server/integration/content src/test/java/cc/kune/core/server/manager src/test/java/cc/kune/core/server/mapper
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Thu May 5 16:46:38 CEST 2011
Author: vjrj_
Date: 2011-05-05 16:46:37 +0200 (Thu, 05 May 2011)
New Revision: 1346
Added:
trunk/img/kune-intro-min.png
Removed:
trunk/src/main/java/cc/kune/core/server/content/CommentManager.java
trunk/src/main/java/cc/kune/core/server/content/CommentManagerDefault.java
trunk/src/main/java/cc/kune/core/shared/dto/CommentDTO.java
trunk/src/main/java/cc/kune/domain/Comment.java
trunk/src/test/java/cc/kune/core/server/integration/content/ContentCommentServiceTest.java
Modified:
trunk/img/kune-intro.svg
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/access/FinderService.java
trunk/src/main/java/cc/kune/core/server/access/FinderServiceDefault.java
trunk/src/main/java/cc/kune/core/server/content/ContentManager.java
trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/state/StateContent.java
trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java
trunk/src/main/java/cc/kune/domain/Content.java
trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
trunk/src/main/resources/META-INF/persistence.xml
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/cc/kune/core/server/TestConstants.java
trunk/src/test/java/cc/kune/core/server/access/FinderTest.java
trunk/src/test/java/cc/kune/core/server/manager/ContentManagerTest.java
trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java
Log:
Changes in db domain, some other fixes
Added: trunk/img/kune-intro-min.png
===================================================================
(Binary files differ)
Property changes on: trunk/img/kune-intro-min.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/img/kune-intro.svg
===================================================================
--- trunk/img/kune-intro.svg 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/img/kune-intro.svg 2011-05-05 14:46:37 UTC (rev 1346)
@@ -24,9 +24,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="0.98994949"
- inkscape:cx="448.08112"
- inkscape:cy="520"
+ inkscape:zoom="1"
+ inkscape:cx="124.2033"
+ inkscape:cy="320.54641"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
@@ -432,60 +432,109 @@
sodipodi:type="arc" />
</g>
<g
- id="g8729"
- transform="matrix(0.69032837,0,0,0.69032837,-226.87213,174.45352)">
+ id="g8699-2"
+ transform="matrix(0.69032837,0,0,0.69032837,66.145968,308.75342)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro-min.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- sodipodi:type="arc"
- style="color:#000000;fill:#aaeeff;fill-opacity:1;fill-rule:nonzero;stroke:#b3b3b3;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- id="path4967"
+ sodipodi:type="star"
+ style="color:#000000;fill:none;stroke:#28220b;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4963-9"
+ sodipodi:sides="5"
+ sodipodi:cx="35"
+ sodipodi:cy="12.362183"
+ sodipodi:r1="5"
+ sodipodi:r2="4.045085"
+ sodipodi:arg1="1.5707963"
+ sodipodi:arg2="2.1991149"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 35,17.362183 -4.755283,-3.454915 1.816357,-5.5901703 5.877852,-10e-8 1.816357,5.5901694 z"
+ inkscape:transform-center-y="-0.10735044"
+ transform="matrix(2.331168,0.83049401,-0.83049401,2.331168,12.776852,771.74251)"
+ inkscape:transform-center-x="1.078998" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/groupSpaceEnabled.png"
+ transform="matrix(1.1754752,0,0,2.3509505,-21.691738,753.33034)"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
+ sodipodi:ry="10"
+ sodipodi:rx="20"
+ sodipodi:cy="32.362183"
sodipodi:cx="90"
- sodipodi:cy="32.362183"
- sodipodi:rx="20"
- sodipodi:ry="10"
- d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
- transform="matrix(1.1754752,0,0,2.3509505,30.276632,753.33034)" />
+ id="path4965-9"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#800000;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" />
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- d="m 130.79962,807.50532 c -2.85339,0.78923 -5.20625,2.69048 -7.74114,4.12698 -1.45578,1.08139 -3.17371,4.03552 -1.21347,5.32414 1.55176,0.2611 2.79811,-1.05921 4.32566,-1.15498 1.78407,-0.4112 3.60556,-0.7363 5.29696,-1.46265 2.88934,-0.9105 2.88934,-0.9105 3.18467,-1.97638 0.14032,-1.60483 -1.00047,-3.09256 -2.07745,-4.18939 -0.49137,-0.40285 -1.11497,-0.78049 -1.77523,-0.66772 z"
- id="path4969"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccccc" />
+ transform="matrix(4.6623359,1.6609881,-1.6609881,4.6623359,51.694712,721.54769)"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
+ sodipodi:ry="1"
+ sodipodi:rx="1"
+ sodipodi:cy="16.362183"
+ sodipodi:cx="15"
+ id="path4973-0"
+ style="color:#000000;fill:#dd8a3d;fill-opacity:1;stroke:#dd8a3d;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" />
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- d="m 153.3922,823.22551 c -4.04703,2.06374 -8.81245,4.142 -10.56886,8.25203 -0.54013,1.26397 0.22272,2.75445 0.4124,4.10295 0.7708,1.43658 -1.11269,2.70312 -0.55672,4.14497 0.66534,1.49717 2.56652,1.27157 3.82727,0.79099 1.28493,-0.44158 -0.53582,-1.70575 0,0 0.58286,1.36335 5.36635,1.77935 6.80857,1.16016 1.38701,-0.50855 2.33091,-0.74837 2.99303,-1.90611 2.17102,-4.41676 3.23712,-9.41812 2.89588,-14.33661 -0.10641,-1.32539 -0.51397,-2.60792 -0.99259,-3.83098 -0.49507,-1.61389 -2.16711,0.0173 -2.82476,0.68071 -0.60256,0.42631 -1.2709,0.77633 -1.99422,0.94189 z"
- id="path4983"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cacccccccccc" />
+ sodipodi:type="arc"
+ style="color:#000000;fill:#69312f;fill-opacity:1;stroke:#69312f;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4975-8"
+ sodipodi:cx="15"
+ sodipodi:cy="16.362183"
+ sodipodi:rx="1"
+ sodipodi:ry="1"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
+ transform="matrix(4.6623359,1.6609881,-1.6609881,4.6623359,38.408722,716.19953)" />
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- inkscape:connector-curvature="0"
- id="path4985"
- d="m 121.52672,824.27304 c -2.3826,0.90534 -4.95654,1.52602 -7.13172,2.85353 -1.8032,1.51882 -1.57875,4.29287 -0.64391,6.22636 1.14716,2.47466 2.05723,5.06419 3.4281,7.43042 1.32587,1.74784 -0.0893,0.98747 1.52127,2.46832 0.45524,0.54208 3.2913,3.28282 4.94937,2.47469 0.82652,-0.40286 0.61983,-1.62095 0.54826,-2.70337 0.52083,-2.24499 -0.82476,-4.39163 -0.7175,-6.65278 -0.0579,-2.83898 0.49943,-5.64398 0.8377,-8.45265 0.19302,-1.55725 -0.68561,-4.455 -2.79157,-3.64452 z"
- style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- sodipodi:nodetypes="cccccacccc" />
+ transform="matrix(4.6623359,1.6609881,-1.6609881,4.6623359,50.908082,736.08463)"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
+ sodipodi:ry="1"
+ sodipodi:rx="1"
+ sodipodi:cy="16.362183"
+ sodipodi:cx="15"
+ id="path4977-1"
+ style="color:#000000;fill:#28220b;fill-opacity:1;stroke:#28220b;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" />
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceEnabled.png"
- transform="matrix(1.1754752,0,0,2.3509505,30.276632,753.33034)"
- d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
- sodipodi:ry="10"
- sodipodi:rx="20"
- sodipodi:cy="32.362183"
- sodipodi:cx="90"
- id="path4987"
- style="color:#000000;fill:none;stroke:#002255;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ sodipodi:type="arc"
+ style="color:#000000;fill:#cc6633;fill-opacity:1;stroke:#cc6633;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4979-3"
+ sodipodi:cx="15"
+ sodipodi:cy="16.362183"
+ sodipodi:rx="1"
+ sodipodi:ry="1"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
+ transform="matrix(4.6623359,1.6609881,-1.6609881,4.6623359,37.248612,739.8127)" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ transform="matrix(5.5489598,1.9768537,-1.9768537,5.5489598,20.951652,708.53981)"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
+ sodipodi:ry="1"
+ sodipodi:rx="1"
+ sodipodi:cy="16.362183"
+ sodipodi:cx="15"
+ id="path4981-1"
+ style="color:#000000;fill:#ffdb6b;fill-opacity:1;stroke:#dd8a3d;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
</g>
<g
@@ -759,5 +808,283 @@
x="74.030479"
sodipodi:role="line"
id="tspan10129">in real time</tspan></text>
+ <g
+ id="g9950-6"
+ transform="matrix(1.1841718,0,0,1.1841718,152.99098,651.95049)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro-min.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ inkscape:export-ydpi="399.59854"
+ inkscape:export-xdpi="399.59854"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-logo-1200.png"
+ id="path2585-8"
+ d="m 273.08439,61.656431 c -0.94086,0 -1.84521,0.0038 -2.7527,0.06255 -0.0847,0.01722 -0.16503,0.0466 -0.25025,0.06255 -0.84477,0.157787 -1.67823,0.292338 -2.56501,0.312813 -0.12283,0.01722 -0.25319,-0.01836 -0.37537,0 -7.23791,1.089665 -13.35321,4.232391 -18.26793,9.446767 -5.73951,6.06158 -8.63346,13.323179 -8.63347,21.771374 0,8.542995 2.89397,15.853925 8.63347,21.896495 6.21303,6.51614 14.2855,9.75956 24.21126,9.75958 5.26591,-2e-5 10.3285,-1.30838 15.13985,-3.94137 4.81128,-2.55719 8.9947,-6.17652 12.57485,-10.76056 l -10.82313,-6.00589 c -4.65983,6.21305 -10.38519,9.32165 -17.20437,9.32165 -4.7356,0 -8.98159,-1.53619 -12.63741,-4.56698 -3.71271,-3.03077 -5.56801,-6.72237 -5.56796,-11.135945 l 49.48606,0 0,-2.50246 c -5e-5,-10.702335 -3.62514,-19.272304 -10.82312,-25.712732 -6.06157,-5.360601 -12.77627,-8.007783 -20.14477,-8.007859 z m -230.100847,0.43793 0,23.961011 -8.383224,0 0,12.262047 8.383224,0 0,25.024561 12.762525,0 0,-25.024561 7.695059,0 15.702918,25.024561 15.139855,0 -21.083194,-31.781201 20.144769,-28.277758 -15.452668,0 -15.577788,22.772351 -6.568951,0 0,-23.961011 -12.762525,0 z m 156.591197,0 c -2.19697,0.392104 -4.24408,1.030291 -6.13103,2.001968 -3.18232,1.704844 -5.69466,3.953222 -7.56992,6.756633 l 0,-7.569941 -12.82509,0 0,60.058959 12.82509,0 0,-33.658041 c -2e-5,-4.811275 1.35771,-8.502905 4.0665,-11.13593 2.72765,-2.632924 6.18568,-3.941333 10.44774,-3.941371 4.50823,3.8e-5 8.0288,1.20973 10.51032,3.691123 2.48138,2.481482 3.69105,6.370493 3.69113,11.636428 l 0,33.407791 12.82509,0 0,-36.223052 c -7e-5,-7.36852 -2.24843,-13.456553 -6.75664,-18.267934 -3.38123,-3.60845 -7.29356,-5.854486 -11.76155,-6.756633 l -9.32164,0 z m -97.22042,1.18866 0,34.784148 c -2e-5,8.145201 2.74589,14.730761 8.2581,19.769411 5.1144,4.73557 11.44922,7.13197 18.89354,7.13199 7.52004,-2e-5 13.82273,-2.39642 18.95611,-7.13199 5.51215,-5.03865 8.25804,-11.62421 8.25811,-19.769411 l 0,-34.784148 -12.82509,0 0,33.658038 c -7e-5,4.432511 -1.35779,8.038631 -4.06649,10.823121 -2.80351,2.87925 -6.21219,4.31674 -10.32264,4.31674 -3.95896,2e-5 -7.39407,-1.45642 -10.19751,-4.31674 -2.78453,-2.87919 -4.12909,-6.46636 -4.12905,-10.823121 l 0,-33.658038 -12.82508,0 z M 271.4578,73.16773 c 4.18619,6.4e-5 7.84165,1.173592 10.94824,3.503441 3.01177,2.386754 5.22976,5.863768 6.63151,10.447757 l -34.47133,0 c 1.00391,-4.413515 3.087,-7.841158 6.19357,-10.32264 3.0118,-2.40562 6.56857,-3.628494 10.69801,-3.628558 z"
+ style="font-size:58.13353348px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#a56941;fill-opacity:1;stroke:none;font-family:Emblem"
+ inkscape:connector-curvature="0" />
+ <g
+ inkscape:export-ydpi="399.59854"
+ inkscape:export-xdpi="399.59854"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-logo-1200.png"
+ transform="matrix(0.43982058,0,0,0.4392609,-61.046168,-320.82474)"
+ id="g6020-0">
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path6022-2"
+ d="m 60.321717,411.99998 377.014613,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23953247;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path6024-1"
+ d="m 252.61203,788.60332 0,-377.01178"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffdb6b;stroke-width:109.23950958;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path6026-0"
+ d="m 252.86937,597.15755 377.0124,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#69312f;stroke-width:109.23951721;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path6028-5"
+ d="m 437.45588,596.97447 0,-377.01491"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#cc6633;stroke-width:109.23950195;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path6030-1"
+ d="m 372.87905,411.27704 64.93441,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947906;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <text
+ sodipodi:linespacing="125%"
+ id="text2991-8"
+ y="847.95343"
+ x="151.89561"
+ style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#dd8a3d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu Bold"
+ xml:space="preserve"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro-min.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"><tspan
+ style="font-size:32px;font-weight:bold;fill:#dd8a3d;fill-opacity:1;-inkscape-font-specification:Ubuntu Bold"
+ y="847.95343"
+ x="151.89561"
+ id="tspan2993-4"
+ sodipodi:role="line">Comunicate with others</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#dd8a3d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu Bold"
+ x="197.72444"
+ y="1189.9738"
+ id="text2995-7"
+ sodipodi:linespacing="125%"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"><tspan
+ sodipodi:role="line"
+ id="tspan2997-2"
+ x="197.72444"
+ y="1189.9738"
+ style="font-size:32px;font-weight:bold;fill:#dd8a3d;fill-opacity:1;-inkscape-font-specification:Ubuntu Bold">Public</tspan></text>
+ <g
+ id="g8695-4"
+ transform="matrix(0.69032837,0,0,0.69032837,102.02122,263.35464)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro-min.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/userSpaceEnabled.png"
+ sodipodi:type="arc"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#800000;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4961-0"
+ sodipodi:cx="90"
+ sodipodi:cy="32.362183"
+ sodipodi:rx="20"
+ sodipodi:ry="10"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
+ transform="matrix(1.1754752,0,0,2.3509505,-73.660121,753.33034)" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/userSpaceEnabled.png"
+ sodipodi:type="arc"
+ style="color:#000000;fill:#d45500;fill-opacity:1;stroke:#d45500;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4971-6"
+ sodipodi:cx="15"
+ sodipodi:cy="16.362183"
+ sodipodi:rx="1"
+ sodipodi:ry="1"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
+ transform="matrix(4.9493694,0,0,4.9493694,-42.107891,748.42974)" />
+ </g>
+ <g
+ transform="matrix(0.69032837,0,0,0.69032837,30.270728,354.20632)"
+ id="g3297"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro-min.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ transform="matrix(1.1754752,0,0,2.3509505,30.276632,753.33034)"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
+ sodipodi:ry="10"
+ sodipodi:rx="20"
+ sodipodi:cy="32.362183"
+ sodipodi:cx="90"
+ id="path3299"
+ style="color:#000000;fill:#aaeeff;fill-opacity:1;fill-rule:nonzero;stroke:#b3b3b3;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:nodetypes="cccccccc"
+ inkscape:connector-curvature="0"
+ id="path3301"
+ d="m 130.79962,807.50532 c -2.85339,0.78923 -5.20625,2.69048 -7.74114,4.12698 -1.45578,1.08139 -3.17371,4.03552 -1.21347,5.32414 1.55176,0.2611 2.79811,-1.05921 4.32566,-1.15498 1.78407,-0.4112 3.60556,-0.7363 5.29696,-1.46265 2.88934,-0.9105 2.88934,-0.9105 3.18467,-1.97638 0.14032,-1.60483 -1.00047,-3.09256 -2.07745,-4.18939 -0.49137,-0.40285 -1.11497,-0.78049 -1.77523,-0.66772 z"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:nodetypes="cacccccccccc"
+ inkscape:connector-curvature="0"
+ id="path3303"
+ d="m 153.3922,823.22551 c -4.04703,2.06374 -8.81245,4.142 -10.56886,8.25203 -0.54013,1.26397 0.22272,2.75445 0.4124,4.10295 0.7708,1.43658 -1.11269,2.70312 -0.55672,4.14497 0.66534,1.49717 2.56652,1.27157 3.82727,0.79099 1.28493,-0.44158 -0.53582,-1.70575 0,0 0.58286,1.36335 5.36635,1.77935 6.80857,1.16016 1.38701,-0.50855 2.33091,-0.74837 2.99303,-1.90611 2.17102,-4.41676 3.23712,-9.41812 2.89588,-14.33661 -0.10641,-1.32539 -0.51397,-2.60792 -0.99259,-3.83098 -0.49507,-1.61389 -2.16711,0.0173 -2.82476,0.68071 -0.60256,0.42631 -1.2709,0.77633 -1.99422,0.94189 z"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:nodetypes="cccccacccc"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="m 121.52672,824.27304 c -2.3826,0.90534 -4.95654,1.52602 -7.13172,2.85353 -1.8032,1.51882 -1.57875,4.29287 -0.64391,6.22636 1.14716,2.47466 2.05723,5.06419 3.4281,7.43042 1.32587,1.74784 -0.0893,0.98747 1.52127,2.46832 0.45524,0.54208 3.2913,3.28282 4.94937,2.47469 0.82652,-0.40286 0.61983,-1.62095 0.54826,-2.70337 0.52083,-2.24499 -0.82476,-4.39163 -0.7175,-6.65278 -0.0579,-2.83898 0.49943,-5.64398 0.8377,-8.45265 0.19302,-1.55725 -0.68561,-4.455 -2.79157,-3.64452 z"
+ id="path3305"
+ inkscape:connector-curvature="0"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#002255;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path3307"
+ sodipodi:cx="90"
+ sodipodi:cy="32.362183"
+ sodipodi:rx="20"
+ sodipodi:ry="10"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
+ transform="matrix(1.1754752,0,0,2.3509505,30.276632,753.33034)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceEnabled.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
+ <g
+ id="g8721-1"
+ transform="matrix(0.69032837,0,0,0.69032837,-66.264583,578.73873)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceDisabled.png"
+ transform="matrix(1.1754752,0,0,2.3509505,30.940442,700.21488)"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
+ sodipodi:ry="10"
+ sodipodi:rx="20"
+ sodipodi:cy="32.362183"
+ sodipodi:cx="90"
+ id="path3047-0"
+ style="color:#000000;fill:#d5e5ff;fill-opacity:1;fill-rule:nonzero;stroke:#b3b3b3;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceDisabled.png"
+ sodipodi:nodetypes="cccccccc"
+ inkscape:connector-curvature="0"
+ id="path3129-3"
+ d="m 131.46342,754.38987 c -2.85339,0.78922 -5.20625,2.69047 -7.74114,4.12697 -1.45578,1.08139 -3.17371,4.03552 -1.21347,5.32414 1.55176,0.26111 2.79811,-1.05921 4.32566,-1.15498 1.78407,-0.4112 3.60556,-0.7363 5.29696,-1.46264 2.88934,-0.91051 2.88934,-0.91051 3.18467,-1.97638 0.14032,-1.60484 -1.00047,-3.09257 -2.07744,-4.1894 -0.49138,-0.40285 -1.11498,-0.78048 -1.77524,-0.66771 z"
+ style="color:#000000;fill:#87deaa;fill-opacity:1;fill-rule:nonzero;stroke:#87deaa;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceDisabled.png"
+ sodipodi:nodetypes="cacccccccccc"
+ inkscape:connector-curvature="0"
+ id="path4991-4"
+ d="m 154.056,770.13557 c -4.04703,2.06371 -8.81245,4.14198 -10.56886,8.252 -0.54013,1.26397 0.22272,2.75445 0.4124,4.10296 0.7708,1.43658 -1.11269,2.70312 -0.55672,4.14497 0.66534,1.49716 2.56652,1.27157 3.82727,0.79098 1.28493,-0.44158 -0.53582,-1.70574 0,0 0.58286,1.36336 5.36635,1.77935 6.80857,1.16016 1.38701,-0.50854 2.33091,-0.74836 2.99304,-1.90608 2.17101,-4.41678 3.23711,-9.41815 2.89587,-14.33663 -0.10641,-1.3254 -0.51397,-2.60792 -0.99259,-3.83099 -0.49507,-1.61389 -2.16711,0.0174 -2.82476,0.68074 -0.60256,0.42628 -1.2709,0.7763 -1.99422,0.94189 z"
+ style="color:#000000;fill:#87deaa;fill-opacity:1;fill-rule:nonzero;stroke:#87deaa;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceDisabled.png"
+ sodipodi:nodetypes="cccccacccc"
+ style="color:#000000;fill:#87deaa;fill-opacity:1;fill-rule:nonzero;stroke:#87deaa;stroke-width:2.47468472;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="m 122.19052,771.15758 c -2.3826,0.90535 -4.95654,1.52602 -7.13172,2.85354 -1.8032,1.51881 -1.57875,4.29286 -0.64391,6.22635 1.14716,2.47467 2.05723,5.0642 3.42811,7.43042 1.32586,1.74785 -0.0893,0.98748 1.52126,2.46833 0.45524,0.54208 3.2913,3.28281 4.94937,2.47468 0.82652,-0.40286 0.61983,-1.62095 0.54826,-2.70337 0.52083,-2.24498 -0.82476,-4.39163 -0.7175,-6.65277 -0.0579,-2.83898 0.49944,-5.64399 0.8377,-8.45266 0.19303,-1.55724 -0.68561,-4.455 -2.79157,-3.64452 z"
+ id="path3125-0"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceDisabled.png"
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#b3b3b3;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path3007-3"
+ sodipodi:cx="90"
+ sodipodi:cy="32.362183"
+ sodipodi:rx="20"
+ sodipodi:ry="10"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
+ transform="matrix(1.1754752,0,0,2.3509505,30.940442,700.21488)" />
+ <path
+ transform="matrix(1.1754752,0,0,2.3509505,30.940442,700.21488)"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
+ sodipodi:ry="10"
+ sodipodi:rx="20"
+ sodipodi:cy="32.362183"
+ sodipodi:cx="90"
+ id="path3141-9"
+ style="color:#000000;fill:none;stroke:#b3b3b3;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceDisabled.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
+ <text
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro-min.png"
+ xml:space="preserve"
+ style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#dd8a3d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu Bold"
+ x="152.85562"
+ y="893.62335"
+ id="text3250"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3252"
+ x="152.85562"
+ y="893.62335"
+ style="font-size:32px;font-weight:bold;fill:#dd8a3d;fill-opacity:1;-inkscape-font-specification:Ubuntu Bold">Work in collaboration</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3254"
+ y="938.97327"
+ x="152.31161"
+ style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#dd8a3d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu Bold"
+ xml:space="preserve"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-intro-min.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"><tspan
+ style="font-size:32px;font-weight:bold;fill:#dd8a3d;fill-opacity:1;-inkscape-font-specification:Ubuntu Bold"
+ y="938.97327"
+ x="152.31161"
+ id="tspan3256"
+ sodipodi:role="line">And share with the rest</tspan></text>
</g>
</svg>
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -26,7 +26,6 @@
import cc.kune.core.shared.domain.RateResult;
import cc.kune.core.shared.domain.TagCloudResult;
import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.CommentDTO;
import cc.kune.core.shared.dto.ContentSimpleDTO;
import cc.kune.core.shared.dto.I18nLanguageDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
@@ -39,52 +38,47 @@
@RemoteServiceRelativePath("ContentService")
public interface ContentService extends RemoteService {
- void addAuthor(String userHash, StateToken token, String authorShortName) throws DefaultException;
+ void addAuthor(String userHash, StateToken token, String authorShortName) throws DefaultException;
- CommentDTO addComment(String userHash, StateToken token, Long parentCommentId, String commentText)
- throws DefaultException;
+ StateContentDTO addContent(String user, StateToken parentToken, String name, String typeId)
+ throws DefaultException;
- CommentDTO addComment(String userHash, StateToken token, String commentText) throws DefaultException;
+ StateContainerDTO addFolder(String hash, StateToken parentToken, String typeId, String title)
+ throws DefaultException;
- StateContentDTO addContent(String user, StateToken parentToken, String name, String typeId) throws DefaultException;
+ void addParticipant(String userHash, StateToken token, String participant) throws DefaultException;
- StateContainerDTO addFolder(String hash, StateToken parentToken, String typeId, String title)
- throws DefaultException;
+ StateContainerDTO addRoom(String user, StateToken parentToken, String name) throws DefaultException;
- void addParticipant(String userHash, StateToken token, String participant) throws DefaultException;
+ StateContentDTO delContent(String userHash, StateToken token) throws DefaultException;
- StateContainerDTO addRoom(String user, StateToken parentToken, String name) throws DefaultException;
+ StateAbstractDTO getContent(String userHash, StateToken token) throws DefaultException;
- StateContentDTO delContent(String userHash, StateToken token) throws DefaultException;
+ TagCloudResult getSummaryTags(String userHash, StateToken groupToken) throws DefaultException;
- StateAbstractDTO getContent(String userHash, StateToken token) throws DefaultException;
+ RateResult rateContent(String userHash, StateToken token, Double value) throws DefaultException;
- TagCloudResult getSummaryTags(String userHash, StateToken groupToken) throws DefaultException;
+ void removeAuthor(String userHash, StateToken token, String authorShortName) throws DefaultException;
- CommentDTO markCommentAsAbuse(String userHash, StateToken token, Long commentId) throws DefaultException;
+ StateAbstractDTO renameContainer(String userHash, StateToken token, String newName)
+ throws DefaultException;
- RateResult rateContent(String userHash, StateToken token, Double value) throws DefaultException;
+ StateAbstractDTO renameContent(String userHash, StateToken token, String newName)
+ throws DefaultException;
- void removeAuthor(String userHash, StateToken token, String authorShortName) throws DefaultException;
+ void save(String user, StateToken token, String content) throws DefaultException;
- StateAbstractDTO renameContainer(String userHash, StateToken token, String newName) throws DefaultException;
+ ContentSimpleDTO setAsDefaultContent(String userHash, StateToken token);
- StateAbstractDTO renameContent(String userHash, StateToken token, String newName) throws DefaultException;
+ I18nLanguageDTO setLanguage(String userHash, StateToken token, String languageCode)
+ throws DefaultException;
- void save(String user, StateToken token, String content) throws DefaultException;
+ void setPublishedOn(String userHash, StateToken token, Date date) throws DefaultException;
- ContentSimpleDTO setAsDefaultContent(String userHash, StateToken token);
+ StateAbstractDTO setStatus(String userHash, StateToken stateToken, ContentStatus status);
- I18nLanguageDTO setLanguage(String userHash, StateToken token, String languageCode) throws DefaultException;
+ StateAbstractDTO setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatus status);
- void setPublishedOn(String userHash, StateToken token, Date date) throws DefaultException;
+ TagCloudResult setTags(String userHash, StateToken token, String tags) throws DefaultException;
- StateAbstractDTO setStatus(String userHash, StateToken stateToken, ContentStatus status);
-
- StateAbstractDTO setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatus status);
-
- TagCloudResult setTags(String userHash, StateToken token, String tags) throws DefaultException;
-
- CommentDTO voteComment(String userHash, StateToken token, Long commentId, boolean votePositive)
- throws DefaultException;
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -26,7 +26,6 @@
import cc.kune.core.shared.domain.RateResult;
import cc.kune.core.shared.domain.TagCloudResult;
import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.CommentDTO;
import cc.kune.core.shared.dto.ContentSimpleDTO;
import cc.kune.core.shared.dto.I18nLanguageDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
@@ -37,58 +36,57 @@
public interface ContentServiceAsync {
- void addAuthor(String userHash, StateToken token, String authorShortName, AsyncCallback<Void> asyncCallback);
+ void addAuthor(String userHash, StateToken token, String authorShortName,
+ AsyncCallback<Void> asyncCallback);
- void addComment(String userHash, StateToken token, Long parentCommentId, String commentText,
- AsyncCallback<CommentDTO> asyncCallback);
+ void addContent(String user, StateToken parentToken, String name, String typeId,
+ AsyncCallback<StateContentDTO> callback);
- void addComment(String userHash, StateToken token, String commentText, AsyncCallback<CommentDTO> asyncCallback);
+ void addFolder(String hash, StateToken parentToken, String title, String typeId,
+ AsyncCallback<StateContainerDTO> callback);
- void addContent(String user, StateToken parentToken, String name, String typeId,
- AsyncCallback<StateContentDTO> callback);
+ void addParticipant(String userHash, StateToken token, String authorShortName,
+ AsyncCallback<Void> asyncCallback) throws DefaultException;
- void addFolder(String hash, StateToken parentToken, String title, String typeId,
- AsyncCallback<StateContainerDTO> callback);
+ void addRoom(String user, StateToken parentToken, String name,
+ AsyncCallback<StateContainerDTO> callback);
- void addParticipant(String userHash, StateToken token, String authorShortName, AsyncCallback<Void> asyncCallback)
- throws DefaultException;
+ void delContent(String userHash, StateToken token, AsyncCallback<StateContentDTO> asyncCallback);
- void addRoom(String user, StateToken parentToken, String name, AsyncCallback<StateContainerDTO> callback);
+ void getContent(String user, StateToken newState, AsyncCallback<StateAbstractDTO> callback);
- void delContent(String userHash, StateToken token, AsyncCallback<StateContentDTO> asyncCallback);
+ void getSummaryTags(String userHash, StateToken groupToken, AsyncCallback<TagCloudResult> asyncCallback);
- void getContent(String user, StateToken newState, AsyncCallback<StateAbstractDTO> callback);
+ void rateContent(String userHash, StateToken token, Double value,
+ AsyncCallback<RateResult> asyncCallback);
- void getSummaryTags(String userHash, StateToken groupToken, AsyncCallback<TagCloudResult> asyncCallback);
+ void removeAuthor(String userHash, StateToken token, String authorShortName,
+ AsyncCallback<Void> asyncCallback);
- void markCommentAsAbuse(String userHash, StateToken token, Long commentId, AsyncCallback<CommentDTO> asyncCallback);
+ void renameContainer(String userHash, StateToken token, String newName,
+ AsyncCallback<StateAbstractDTO> asyncCallback);
- void rateContent(String userHash, StateToken token, Double value, AsyncCallback<RateResult> asyncCallback);
+ void renameContent(String userHash, StateToken token, String newName,
+ AsyncCallback<StateAbstractDTO> asyncCallback);
- void removeAuthor(String userHash, StateToken token, String authorShortName, AsyncCallback<Void> asyncCallback);
+ void save(String user, StateToken token, String content, AsyncCallback<Void> asyncCallback);
- void renameContainer(String userHash, StateToken token, String newName,
- AsyncCallback<StateAbstractDTO> asyncCallback);
+ void setAsDefaultContent(String userHash, StateToken token,
+ AsyncCallback<ContentSimpleDTO> asyncCallback);
- void renameContent(String userHash, StateToken token, String newName, AsyncCallback<StateAbstractDTO> asyncCallback);
+ void setLanguage(String userHash, StateToken token, String languageCode,
+ AsyncCallback<I18nLanguageDTO> asyncCallback);
- void save(String user, StateToken token, String content, AsyncCallback<Void> asyncCallback);
+ void setPublishedOn(String userHash, StateToken token, Date publishedOn,
+ AsyncCallback<Void> asyncCallback);
- void setAsDefaultContent(String userHash, StateToken token, AsyncCallback<ContentSimpleDTO> asyncCallback);
+ void setStatus(String userHash, StateToken stateToken, ContentStatus status,
+ AsyncCallback<StateAbstractDTO> asyncCallback);
- void setLanguage(String userHash, StateToken token, String languageCode,
- AsyncCallback<I18nLanguageDTO> asyncCallback);
+ void setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatus status,
+ AsyncCallback<StateAbstractDTO> asyncCallback);
- void setPublishedOn(String userHash, StateToken token, Date publishedOn, AsyncCallback<Void> asyncCallback);
+ void setTags(String userHash, StateToken token, String tags,
+ AsyncCallback<TagCloudResult> asyncCallback);
- void setStatus(String userHash, StateToken stateToken, ContentStatus status,
- AsyncCallback<StateAbstractDTO> asyncCallback);
-
- void setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatus status,
- AsyncCallback<StateAbstractDTO> asyncCallback);
-
- void setTags(String userHash, StateToken token, String tags, AsyncCallback<TagCloudResult> asyncCallback);
-
- void voteComment(String userHash, StateToken token, Long commentId, boolean votePositive,
- AsyncCallback<CommentDTO> asyncCallback);
}
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -38,8 +38,6 @@
import cc.kune.core.server.auth.AuthorizatedMethodInterceptor;
import cc.kune.core.server.auth.SessionService;
import cc.kune.core.server.auth.SessionServiceDefault;
-import cc.kune.core.server.content.CommentManager;
-import cc.kune.core.server.content.CommentManagerDefault;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContainerManagerDefault;
import cc.kune.core.server.content.ContentManager;
@@ -95,7 +93,6 @@
import cc.kune.core.server.xmpp.XmppManager;
import cc.kune.core.server.xmpp.XmppManagerDefault;
import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.domain.Comment;
import cc.kune.domain.SocialNetwork;
import cc.kune.wave.server.KuneWaveManager;
import cc.kune.wave.server.KuneWaveManagerDefault;
@@ -104,80 +101,78 @@
import com.google.inject.matcher.Matchers;
public class PlatformServerModule extends AbstractExtendedModule {
- private void bindFinders() {
- // http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/Injector.html
- // (...) Just-in-time bindings created for child injectors will be
- // created in an ancestor injector whenever possible (...)
- // (This fails with finders, then we make explicit bindings)
+ private void bindFinders() {
+ // http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/Injector.html
+ // (...) Just-in-time bindings created for child injectors will be
+ // created in an ancestor injector whenever possible (...)
+ // (This fails with finders, then we make explicit bindings)
- bind(SocialNetwork.class);
- bind(Comment.class);
- }
+ bind(SocialNetwork.class);
+ }
- private void bindManagers() {
- bind(UserManager.class).to(UserManagerDefault.class);
- bind(GroupManager.class).to(GroupManagerDefault.class);
- bind(ContentManager.class).to(ContentManagerDefault.class);
- bind(ToolConfigurationManager.class).to(ToolConfigurationManagerDefault.class);
- bind(ContainerManager.class).to(ContainerManagerDefault.class);
- bind(LicenseManager.class).to(LicenseManagerDefault.class);
- bind(SocialNetworkManager.class).to(SocialNetworkManagerDefault.class);
- bind(XmppManager.class).to(XmppManagerDefault.class);
- bind(RateManager.class).to(RateManagerDefault.class);
- bind(I18nCountryManager.class).to(I18nCountryManagerDefault.class);
- bind(I18nLanguageManager.class).to(I18nLanguageManagerDefault.class);
- bind(I18nTranslationManager.class).to(I18nTranslationManagerDefault.class);
- bind(TagManager.class).to(TagManagerDefault.class);
- bind(TagUserContentManager.class).to(TagUserContentManagerDefault.class);
- bind(CommentManager.class).to(CommentManagerDefault.class);
- bind(FileManager.class).to(FileManagerDefault.class);
- bind(ExtMediaDescripManager.class).to(ExtMediaDescripManagerDefault.class);
- bind(KuneWaveManager.class).to(KuneWaveManagerDefault.class);
- }
+ private void bindManagers() {
+ bind(UserManager.class).to(UserManagerDefault.class);
+ bind(GroupManager.class).to(GroupManagerDefault.class);
+ bind(ContentManager.class).to(ContentManagerDefault.class);
+ bind(ToolConfigurationManager.class).to(ToolConfigurationManagerDefault.class);
+ bind(ContainerManager.class).to(ContainerManagerDefault.class);
+ bind(LicenseManager.class).to(LicenseManagerDefault.class);
+ bind(SocialNetworkManager.class).to(SocialNetworkManagerDefault.class);
+ bind(XmppManager.class).to(XmppManagerDefault.class);
+ bind(RateManager.class).to(RateManagerDefault.class);
+ bind(I18nCountryManager.class).to(I18nCountryManagerDefault.class);
+ bind(I18nLanguageManager.class).to(I18nLanguageManagerDefault.class);
+ bind(I18nTranslationManager.class).to(I18nTranslationManagerDefault.class);
+ bind(TagManager.class).to(TagManagerDefault.class);
+ bind(TagUserContentManager.class).to(TagUserContentManagerDefault.class);
+ bind(FileManager.class).to(FileManagerDefault.class);
+ bind(ExtMediaDescripManager.class).to(ExtMediaDescripManagerDefault.class);
+ bind(KuneWaveManager.class).to(KuneWaveManagerDefault.class);
+ }
- private void bindRPC() {
- bind(SiteService.class).to(SiteRPC.class);
- bind(GroupService.class).to(GroupRPC.class);
- bind(ContentService.class).to(ContentRPC.class);
- bind(UserService.class).to(UserRPC.class);
- bind(SocialNetworkService.class).to(SocialNetworkRPC.class);
- bind(I18nService.class).to(I18nRPC.class);
- }
+ private void bindRPC() {
+ bind(SiteService.class).to(SiteRPC.class);
+ bind(GroupService.class).to(GroupRPC.class);
+ bind(ContentService.class).to(ContentRPC.class);
+ bind(UserService.class).to(UserRPC.class);
+ bind(SocialNetworkService.class).to(SocialNetworkRPC.class);
+ bind(I18nService.class).to(I18nRPC.class);
+ }
- private void bindServices() {
- bind(UserInfoService.class).to(UserInfoServiceDefault.class);
- bind(CreationService.class).to(CreationServiceDefault.class);
- bind(AccessRightsService.class).to(AccessRightsServiceDefault.class);
- bind(AccessService.class).to(AccessServiceDefault.class);
- bind(FinderService.class).to(FinderServiceDefault.class);
- bind(StateService.class).to(StateServiceDefault.class);
- bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
- bind(SessionService.class).to(SessionServiceDefault.class);
- }
+ private void bindServices() {
+ bind(UserInfoService.class).to(UserInfoServiceDefault.class);
+ bind(CreationService.class).to(CreationServiceDefault.class);
+ bind(AccessRightsService.class).to(AccessRightsServiceDefault.class);
+ bind(AccessService.class).to(AccessServiceDefault.class);
+ bind(FinderService.class).to(FinderServiceDefault.class);
+ bind(StateService.class).to(StateServiceDefault.class);
+ bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
+ bind(SessionService.class).to(SessionServiceDefault.class);
+ }
- @Override
- protected void configure() {
- // install(PersistService.usingJpa().across(UnitOfWork.TRANSACTION).buildModule());
- bind(KunePersistenceService.class);
+ @Override
+ protected void configure() {
+ // install(PersistService.usingJpa().across(UnitOfWork.TRANSACTION).buildModule());
+ bind(KunePersistenceService.class);
- bindFinders();
- bindManagers();
- bindRPC();
- bindServices();
- bind(KuneProperties.class).to(KunePropertiesDefault.class);
- bind(Mapper.class).to(DozerMapper.class);
- bind(ServerToolRegistry.class);
- // bind(FileUploadManager.class).in(ServletScopes.REQUEST);
- bind(FileUploadManager.class);
- bind(FileDownloadManager.class);
- bind(EntityLogoUploadManager.class);
- bind(EntityLogoDownloadManager.class);
- bind(ParticipantUtils.class);
+ bindFinders();
+ bindManagers();
+ bindRPC();
+ bindServices();
+ bind(KuneProperties.class).to(KunePropertiesDefault.class);
+ bind(Mapper.class).to(DozerMapper.class);
+ bind(ServerToolRegistry.class);
+ // bind(FileUploadManager.class).in(ServletScopes.REQUEST);
+ bind(FileUploadManager.class);
+ bind(FileDownloadManager.class);
+ bind(EntityLogoUploadManager.class);
+ bind(EntityLogoDownloadManager.class);
+ bind(ParticipantUtils.class);
- bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authenticated.class),
- outermostCall(new AuthenticatedMethodInterceptor()));
- bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authorizated.class),
- outermostCall(new AuthorizatedMethodInterceptor()));
- }
+ bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authenticated.class),
+ outermostCall(new AuthenticatedMethodInterceptor()));
+ bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authorizated.class),
+ outermostCall(new AuthorizatedMethodInterceptor()));
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/access/FinderService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/access/FinderService.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/access/FinderService.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -19,10 +19,8 @@
*/
package cc.kune.core.server.access;
-
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.domain.Comment;
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
@@ -31,18 +29,16 @@
public interface FinderService {
- Comment getComment(Long commentId) throws DefaultException;
+ Content getContent(Long contentId) throws DefaultException;
- Content getContent(Long contentId) throws DefaultException;
+ Content getContent(StateToken token, Group defaultGroup) throws DefaultException;
- Content getContent(StateToken token, Group defaultGroup) throws DefaultException;
+ Container getFolder(Long folderId) throws DefaultException;
- Container getFolder(Long folderId) throws DefaultException;
+ Rate getRate(User user, Content content);
- Rate getRate(User user, Content content);
+ Double getRateAvg(Content content);
- Double getRateAvg(Content content);
+ Long getRateByUsers(Content content);
- Long getRateByUsers(Content content);
-
}
Modified: trunk/src/main/java/cc/kune/core/server/access/FinderServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/access/FinderServiceDefault.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/access/FinderServiceDefault.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -22,19 +22,16 @@
import javax.persistence.NoResultException;
import javax.persistence.PersistenceException;
-
import cc.kune.core.client.errors.ContentNotFoundException;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.GroupNotFoundException;
import cc.kune.core.client.errors.NoDefaultContentException;
import cc.kune.core.client.errors.ToolNotFoundException;
-import cc.kune.core.server.content.CommentManager;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.RateManager;
import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.domain.Comment;
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
@@ -46,150 +43,147 @@
@Singleton
public class FinderServiceDefault implements FinderService {
- private final GroupManager groupManager;
- private final ContentManager contentManager;
- private final ContainerManager containerManager;
- private final RateManager rateManager;
- private final CommentManager commentManager;
+ private final ContainerManager containerManager;
+ private final ContentManager contentManager;
+ private final GroupManager groupManager;
+ private final RateManager rateManager;
- @Inject
- public FinderServiceDefault(final GroupManager groupManager, final ContainerManager containerManager,
- final ContentManager contentManager, final RateManager rateManager, final CommentManager commentManager) {
- this.groupManager = groupManager;
- this.containerManager = containerManager;
- this.contentManager = contentManager;
- this.rateManager = rateManager;
- this.commentManager = commentManager;
- }
+ @Inject
+ public FinderServiceDefault(final GroupManager groupManager, final ContainerManager containerManager,
+ final ContentManager contentManager, final RateManager rateManager) {
+ this.groupManager = groupManager;
+ this.containerManager = containerManager;
+ this.contentManager = contentManager;
+ this.rateManager = rateManager;
+ }
- public Long checkAndParse(final String s) throws ContentNotFoundException {
- if (s != null) {
- try {
- return Long.parseLong(s);
- } catch (final NumberFormatException e) {
- throw new ContentNotFoundException();
- }
- }
- return null;
+ public Long checkAndParse(final String s) throws ContentNotFoundException {
+ if (s != null) {
+ try {
+ return Long.parseLong(s);
+ } catch (final NumberFormatException e) {
+ throw new ContentNotFoundException();
+ }
}
+ return null;
+ }
- public Comment getComment(final Long commentId) throws ContentNotFoundException {
- try {
- return commentManager.find(commentId);
- } catch (final PersistenceException e) {
- throw new ContentNotFoundException();
- }
+ private Content findByContentReference(final String groupName, final String toolName,
+ final Long folderId, final Long contentId) throws ContentNotFoundException {
+ final Content content = contentManager.find(contentId);
+ if (content == null) {
+ throw new ContentNotFoundException();
}
+ final Container container = content.getContainer();
- public Content getContent(final Long contentId) throws ContentNotFoundException {
- try {
- return contentManager.find(contentId);
- } catch (final PersistenceException e) {
- throw new ContentNotFoundException();
- }
+ if (!container.getId().equals(folderId)) {
+ throw new ContentNotFoundException();
}
+ if (!container.getToolName().equals(toolName)) {
+ throw new ContentNotFoundException();
+ }
+ if (!container.getOwner().getShortName().equals(groupName)) {
+ throw new ContentNotFoundException();
+ }
+ return content;
+ }
- public Content getContent(final StateToken token, final Group defaultGroup) throws DefaultException {
- final Long contentId = checkAndParse(token.getDocument());
- final Long folderId = checkAndParse(token.getFolder());
-
- String group = token.getGroup();
- if (token.hasAll()) {
- return findByContentReference(group, token.getTool(), folderId, contentId);
- } else if (token.hasGroupToolAndFolder()) {
- return findByFolderReference(group, folderId);
- } else if (token.hasGroupAndTool()) {
- return findByRootOnGroup(group, token.getTool());
- } else if (token.hasGroup()) {
- return findDefaultContentOfGroup(group);
- } else if (token.hasNothing()) {
- return findDefaultContentOfGroup(defaultGroup);
- } else {
- throw new ContentNotFoundException();
- }
+ private Content findByFolderReference(final String groupName, final Long folderId) {
+ final Container container = containerManager.find(folderId);
+ if (container == null) {
+ throw new ContentNotFoundException();
+ } else {
+ return generateFolderFakeContent(container);
}
+ }
- public Container getFolder(final Long folderId) throws ContentNotFoundException {
- try {
- return containerManager.find(folderId);
- } catch (final PersistenceException e) {
- throw new ContentNotFoundException();
- }
+ private Content findByRootOnGroup(final String groupName, final String toolName)
+ throws DefaultException {
+ try {
+ final Group group = groupManager.findByShortName(groupName);
+ if (!group.existToolConfig(toolName)) {
+ throw new ToolNotFoundException();
+ }
+ final Container container = group.getRoot(toolName);
+ return generateFolderFakeContent(container);
+ } catch (final NoResultException e) {
+ throw new GroupNotFoundException();
}
+ }
- public Rate getRate(final User user, final Content content) {
- return rateManager.find(user, content);
+ private Content findDefaultContentOfGroup(final Group group) {
+ final Content defaultContent = group.getDefaultContent();
+ if (defaultContent == null) {
+ throw new NoDefaultContentException();
+ } else {
+ return defaultContent;
}
+ }
- public Double getRateAvg(final Content content) {
+ private Content findDefaultContentOfGroup(final String groupName) throws GroupNotFoundException {
+ final Group group = groupManager.findByShortName(groupName);
+ return findDefaultContentOfGroup(group);
+ }
- return rateManager.getRateAvg(content);
- }
+ private Content generateFolderFakeContent(final Container container) {
+ final Content content = new Content();
+ content.setContainer(container);
+ return content;
+ }
- public Long getRateByUsers(final Content content) {
- return rateManager.getRateByUsers(content);
+ @Override
+ public Content getContent(final Long contentId) throws ContentNotFoundException {
+ try {
+ return contentManager.find(contentId);
+ } catch (final PersistenceException e) {
+ throw new ContentNotFoundException();
}
+ }
- private Content findByContentReference(final String groupName, final String toolName, final Long folderId,
- final Long contentId) throws ContentNotFoundException {
- final Content content = contentManager.find(contentId);
- if (content == null) {
- throw new ContentNotFoundException();
- }
- final Container container = content.getContainer();
+ @Override
+ public Content getContent(final StateToken token, final Group defaultGroup) throws DefaultException {
+ final Long contentId = checkAndParse(token.getDocument());
+ final Long folderId = checkAndParse(token.getFolder());
- if (!container.getId().equals(folderId)) {
- throw new ContentNotFoundException();
- }
- if (!container.getToolName().equals(toolName)) {
- throw new ContentNotFoundException();
- }
- if (!container.getOwner().getShortName().equals(groupName)) {
- throw new ContentNotFoundException();
- }
- return content;
+ final String group = token.getGroup();
+ if (token.hasAll()) {
+ return findByContentReference(group, token.getTool(), folderId, contentId);
+ } else if (token.hasGroupToolAndFolder()) {
+ return findByFolderReference(group, folderId);
+ } else if (token.hasGroupAndTool()) {
+ return findByRootOnGroup(group, token.getTool());
+ } else if (token.hasGroup()) {
+ return findDefaultContentOfGroup(group);
+ } else if (token.hasNothing()) {
+ return findDefaultContentOfGroup(defaultGroup);
+ } else {
+ throw new ContentNotFoundException();
}
+ }
- private Content findByFolderReference(final String groupName, final Long folderId) {
- final Container container = containerManager.find(folderId);
- if (container == null) {
- throw new ContentNotFoundException();
- } else {
- return generateFolderFakeContent(container);
- }
+ @Override
+ public Container getFolder(final Long folderId) throws ContentNotFoundException {
+ try {
+ return containerManager.find(folderId);
+ } catch (final PersistenceException e) {
+ throw new ContentNotFoundException();
}
+ }
- private Content findByRootOnGroup(final String groupName, final String toolName) throws DefaultException {
- try {
- final Group group = groupManager.findByShortName(groupName);
- if (!group.existToolConfig(toolName)) {
- throw new ToolNotFoundException();
- }
- final Container container = group.getRoot(toolName);
- return generateFolderFakeContent(container);
- } catch (final NoResultException e) {
- throw new GroupNotFoundException();
- }
- }
+ @Override
+ public Rate getRate(final User user, final Content content) {
+ return rateManager.find(user, content);
+ }
- private Content findDefaultContentOfGroup(final Group group) {
- final Content defaultContent = group.getDefaultContent();
- if (defaultContent == null) {
- throw new NoDefaultContentException();
- } else {
- return defaultContent;
- }
- }
+ @Override
+ public Double getRateAvg(final Content content) {
- private Content findDefaultContentOfGroup(final String groupName) throws GroupNotFoundException {
- final Group group = groupManager.findByShortName(groupName);
- return findDefaultContentOfGroup(group);
- }
+ return rateManager.getRateAvg(content);
+ }
- private Content generateFolderFakeContent(final Container container) {
- final Content content = new Content();
- content.setContainer(container);
- return content;
- }
+ @Override
+ public Long getRateByUsers(final Content content) {
+ return rateManager.getRateByUsers(content);
+ }
}
Deleted: trunk/src/main/java/cc/kune/core/server/content/CommentManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CommentManager.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/content/CommentManager.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.core.server.content;
-
-
-import cc.kune.core.client.errors.DefaultException;
-import cc.kune.core.server.manager.Manager;
-import cc.kune.domain.Comment;
-import cc.kune.domain.User;
-
-public interface CommentManager extends Manager<Comment, Long> {
-
- Comment addComment(User author, Long contentId, String commentText) throws DefaultException;
-
- Comment addComment(User author, Long contentId, String commentText, Long commentParentId) throws DefaultException;
-
- Comment markAsAbuse(User informer, Long contentId, Long commentId) throws DefaultException;
-
- Comment vote(User voter, Long contentId, Long commentId, boolean votePositive) throws DefaultException;
-
-}
Deleted: trunk/src/main/java/cc/kune/core/server/content/CommentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CommentManagerDefault.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/content/CommentManagerDefault.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,98 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.core.server.content;
-
-import javax.persistence.EntityManager;
-
-
-import cc.kune.core.client.errors.ContentNotFoundException;
-import cc.kune.core.client.errors.DefaultException;
-import cc.kune.core.server.access.FinderService;
-import cc.kune.core.server.manager.impl.DefaultManager;
-import cc.kune.domain.Comment;
-import cc.kune.domain.Content;
-import cc.kune.domain.User;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
- at Singleton
-public class CommentManagerDefault extends DefaultManager<Comment, Long> implements CommentManager {
-
- private final FinderService finder;
-
- @Inject
- public CommentManagerDefault(final Provider<EntityManager> provider, final FinderService finder) {
- super(provider, Comment.class);
- this.finder = finder;
- }
-
- public Comment addComment(final User author, final Long contentId, final String commentText)
- throws DefaultException {
- Comment comment = createComment(author, commentText, contentId);
- return persist(comment);
- }
-
- public Comment addComment(final User author, final Long contentId, final String commentText,
- final Long commentParentId) throws DefaultException {
- Comment comment = createComment(author, commentText, contentId);
- Comment parent = finder.getComment(commentParentId);
- comment.setParent(parent);
- return persist(comment);
- }
-
- public Comment markAsAbuse(final User informer, final Long contentId, final Long commentId) throws DefaultException {
- Comment comment = finder.getComment(commentId);
- checkCommentContent(contentId, comment);
- comment.addAbuseInformer(informer);
- return persist(comment);
- }
-
- public Comment vote(final User voter, final Long contentId, final Long commentId, final boolean votePositive)
- throws DefaultException {
- Comment comment = finder.getComment(commentId);
- checkCommentContent(contentId, comment);
- if (votePositive) {
- comment.addPositiveVoter(voter);
- return persist(comment);
- } else {
- comment.addNegativeVoter(voter);
- return persist(comment);
- }
- }
-
- private void checkCommentContent(final Long contentId, final Comment comment) throws ContentNotFoundException {
- if (!comment.getContent().getId().equals(contentId)) {
- throw new ContentNotFoundException();
- }
- }
-
- private Comment createComment(final User author, final String commentText, final Long contentId)
- throws DefaultException {
- final Content content = finder.getContent(contentId);
- Comment comment = new Comment();
- comment.setAuthor(author);
- comment.setText(commentText);
- comment.setContent(content);
- return comment;
- }
-
-}
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManager.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManager.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -33,56 +33,59 @@
public interface ContentManager extends Manager<Content, Long> {
- String[] DEF_GLOBAL_SEARCH_FIELDS = new String[] { "authors.name", "authors.shortName", "container.name",
- "language.code", "language.englishName", "language.nativeName", "lastRevision.body", "lastRevision.title" };
+ String[] DEF_GLOBAL_SEARCH_FIELDS = new String[] { "authors.name", "authors.shortName",
+ "container.name", "language.code", "language.englishName", "language.nativeName",
+ "lastRevision.body", "lastRevision.title" };
- String[] DEF_GLOBAL_SEARCH_FIELDS_WITH_MIME = new String[] { "authors.name", "authors.shortName", "container.name",
- "language.code", "language.englishName", "language.nativeName", "lastRevision.body", "lastRevision.title",
- "mimeType.mimetype" };
+ String[] DEF_GLOBAL_SEARCH_FIELDS_WITH_MIME = new String[] { "authors.name", "authors.shortName",
+ "container.name", "language.code", "language.englishName", "language.nativeName",
+ "lastRevision.body", "lastRevision.title", "mimeType.mimetype" };
- String[] DEF_GROUP_SEARCH_FIELDS_WITH_MIME = new String[] { "lastRevision.title", "container.owner_shortName",
- "mimeType.mimetype" };
+ String[] DEF_GROUP_SEARCH_FIELDS_WITH_MIME = new String[] { "lastRevision.title",
+ "container.owner_shortName", "mimeType.mimetype" };
- void addAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
+ void addAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
- void addParticipant(User user, Long contentId, String participant);
+ void addParticipant(User user, Long contentId, String participant);
- Content createContent(String title, String body, User author, Container container, String typeId);
+ Content createContent(String title, String body, User author, Container container, String typeId);
- boolean findIfExistsTitle(Container container, String title);
+ boolean findIfExistsTitle(Container container, String title);
- Double getRateAvg(Content content);
+ Double getRateAvg(Content content);
- Long getRateByUsers(Content content);
+ Long getRateByUsers(Content content);
- Double getRateContent(User user, Content content);
+ Double getRateContent(User user, Content content);
- RateResult rateContent(User rater, Long contentId, Double value) throws DefaultException;
+ RateResult rateContent(User rater, Long contentId, Double value) throws DefaultException;
- void removeAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
+ void removeAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
- Content renameContent(User user, Long contentId, String newName) throws DefaultException;
+ Content renameContent(User user, Long contentId, String newName) throws DefaultException;
- Content save(User user, Content content);
+ Content save(User user, Content content);
- Content save(User editor, Content content, String body);
+ Content save(User editor, Content content, String body);
- SearchResult<Content> search(String search);
+ SearchResult<Content> search(String search);
- SearchResult<Content> search(String search, Integer firstResult, Integer maxResults);
+ SearchResult<Content> search(String search, Integer firstResult, Integer maxResults);
- SearchResult<Content> searchMime(String search, Integer firstResult, Integer maxResults, String group,
- String mimetype);
+ SearchResult<Content> searchMime(String search, Integer firstResult, Integer maxResults, String group,
+ String mimetype);
- SearchResult<?> searchMime(String search, Integer firstResult, Integer maxResults, String group, String mimetype,
- String mimetype2);
+ SearchResult<?> searchMime(String search, Integer firstResult, Integer maxResults, String group,
+ String mimetype, String mimetype2);
- I18nLanguage setLanguage(User user, Long contentId, String languageCode) throws DefaultException;
+ I18nLanguage setLanguage(User user, Long contentId, String languageCode) throws DefaultException;
- void setPublishedOn(User user, Long contentId, Date publishedOn) throws DefaultException;
+ void setModifiedOn(Content content, long lastModifiedTime);
- Content setStatus(Long contentId, ContentStatus contentStatus);
+ void setPublishedOn(User user, Long contentId, Date publishedOn) throws DefaultException;
- void setTags(User user, Long contentId, String tags) throws DefaultException;
+ Content setStatus(Long contentId, ContentStatus contentStatus);
+ void setTags(User user, Long contentId, String tags) throws DefaultException;
+
}
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -113,7 +113,6 @@
@Override
public Content createContent(final String title, final String body, final User author,
final Container container, final String typeId) {
- String contentBody;
FilenameUtils.checkBasicFilename(title);
final String newtitle = findInexistentTitle(container, title);
final Content newContent = new Content();
@@ -128,11 +127,10 @@
if (newContent.isWave()) {
final WaveRef waveRef = kuneWaveManager.createWave(newtitle, body,
participantUtils.of(author.getShortName()));
- contentBody = JavaWaverefEncoder.encodeToUriPathSegment(waveRef);
- } else {
- contentBody = body;
+ newContent.setWaveId(JavaWaverefEncoder.encodeToUriPathSegment(waveRef));
+ newContent.setModifiedOn((new Date()).getTime());
}
- revision.setBody(contentBody);
+ revision.setBody(body);
newContent.addRevision(revision);
return persist(newContent);
}
@@ -179,7 +177,7 @@
private WaveRef getWaveRef(final Content content) {
try {
- return JavaWaverefEncoder.decodeWaveRefFromPath(String.valueOf(content.getLastRevision().getBody()));
+ return JavaWaverefEncoder.decodeWaveRefFromPath(String.valueOf(content.getWaveId()));
} catch (final InvalidWaveRefException e) {
throw new DefaultException("Error getting the wave");
}
@@ -297,6 +295,12 @@
}
@Override
+ public void setModifiedOn(final Content content, final long lastModifiedTime) {
+ content.setModifiedOn(lastModifiedTime);
+ persist(content);
+ }
+
+ @Override
public void setPublishedOn(final User user, final Long contentId, final Date publishedOn)
throws DefaultException {
final Content content = finder.getContent(contentId);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -36,7 +36,6 @@
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
-import cc.kune.core.server.content.CommentManager;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.content.ContentUtils;
@@ -54,7 +53,6 @@
import cc.kune.core.shared.domain.TagCloudResult;
import cc.kune.core.shared.domain.utils.AccessRights;
import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.CommentDTO;
import cc.kune.core.shared.dto.ContentSimpleDTO;
import cc.kune.core.shared.dto.I18nLanguageDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
@@ -62,7 +60,6 @@
import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.core.shared.dto.StateNoContentDTO;
import cc.kune.domain.AccessLists;
-import cc.kune.domain.Comment;
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
@@ -75,448 +72,404 @@
@Singleton
public class ContentRPC implements ContentService, RPC {
- private final AccessService accessService;
- private final CommentManager commentManager;
- private final ContainerManager containerManager;
- private final ContentManager contentManager;
- private final CreationService creationService;
- private final FinderService finderService;
- private final GroupManager groupManager;
- private final Mapper mapper;
- private final AccessRightsService rightsService;
- private final StateService stateService;
- private final TagUserContentManager tagManager;
- private final Provider<UserSession> userSessionProvider;
- private final XmppManager xmppManager;
+ private final AccessService accessService;
+ private final ContainerManager containerManager;
+ private final ContentManager contentManager;
+ private final CreationService creationService;
+ private final FinderService finderService;
+ private final GroupManager groupManager;
+ private final Mapper mapper;
+ private final AccessRightsService rightsService;
+ private final StateService stateService;
+ private final TagUserContentManager tagManager;
+ private final Provider<UserSession> userSessionProvider;
+ private final XmppManager xmppManager;
- @Inject
- public ContentRPC(final FinderService finderService, final Provider<UserSession> userSessionProvider,
- final AccessService accessService, final AccessRightsService rightsService,
- final StateService stateService, final CreationService creationService, final GroupManager groupManager,
- final XmppManager xmppManager, final ContentManager contentManager,
- final ContainerManager containerManager, final TagUserContentManager tagManager,
- final CommentManager commentManager, final Mapper mapper) {
- this.finderService = finderService;
- this.userSessionProvider = userSessionProvider;
- this.accessService = accessService;
- this.rightsService = rightsService;
- this.stateService = stateService;
- this.creationService = creationService;
- this.groupManager = groupManager;
- this.xmppManager = xmppManager;
- this.contentManager = contentManager;
- this.containerManager = containerManager;
- this.tagManager = tagManager;
- this.commentManager = commentManager;
- this.mapper = mapper;
- }
+ @Inject
+ public ContentRPC(final FinderService finderService, final Provider<UserSession> userSessionProvider,
+ final AccessService accessService, final AccessRightsService rightsService,
+ final StateService stateService, final CreationService creationService,
+ final GroupManager groupManager, final XmppManager xmppManager,
+ final ContentManager contentManager, final ContainerManager containerManager,
+ final TagUserContentManager tagManager, final Mapper mapper) {
+ this.finderService = finderService;
+ this.userSessionProvider = userSessionProvider;
+ this.accessService = accessService;
+ this.rightsService = rightsService;
+ this.stateService = stateService;
+ this.creationService = creationService;
+ this.groupManager = groupManager;
+ this.xmppManager = xmppManager;
+ this.contentManager = contentManager;
+ this.containerManager = containerManager;
+ this.tagManager = tagManager;
+ this.mapper = mapper;
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public void addAuthor(final String userHash, final StateToken token, final String authorShortName)
- throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final User user = getCurrentUser();
- contentManager.addAuthor(user, contentId, authorShortName);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public void addAuthor(final String userHash, final StateToken token, final String authorShortName)
+ throws DefaultException {
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final User user = getCurrentUser();
+ contentManager.addAuthor(user, contentId, authorShortName);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
- public CommentDTO addComment(final String userHash, final StateToken token, final Long parentCommentId,
- final String commentText) throws DefaultException {
- final User author = getCurrentUser();
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final Comment comment = commentManager.addComment(author, contentId, commentText, parentCommentId);
- return mapper.map(comment, CommentDTO.class);
- }
+ @Override
+ @Authenticated
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public StateContentDTO addContent(final String userHash, final StateToken parentToken,
+ final String title, final String typeId) throws DefaultException {
+ return createContent(parentToken, title, typeId);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
- public CommentDTO addComment(final String userHash, final StateToken token, final String commentText)
- throws DefaultException {
- final User author = getCurrentUser();
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final Comment comment = commentManager.addComment(author, contentId, commentText);
- return mapper.map(comment, CommentDTO.class);
- }
+ @Override
+ @Authenticated
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public StateContainerDTO addFolder(final String userHash, final StateToken parentToken,
+ final String title, final String contentTypeId) throws DefaultException {
+ final User user = getCurrentUser();
+ final Container container = createFolder(parentToken.getGroup(),
+ ContentUtils.parseId(parentToken.getFolder()), title, contentTypeId);
+ return getState(user, container);
+ }
- @Override
- @Authenticated
- @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public StateContentDTO addContent(final String userHash, final StateToken parentToken, final String title,
- final String typeId) throws DefaultException {
- return createContent(parentToken, title, typeId);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public void addParticipant(final String userHash, final StateToken token, final String participant)
+ throws DefaultException {
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final User user = getCurrentUser();
+ contentManager.addParticipant(user, contentId, participant);
+ }
- @Override
- @Authenticated
- @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public StateContainerDTO addFolder(final String userHash, final StateToken parentToken, final String title,
- final String contentTypeId) throws DefaultException {
- final User user = getCurrentUser();
- final Container container = createFolder(parentToken.getGroup(), ContentUtils.parseId(parentToken.getFolder()),
- title, contentTypeId);
- return getState(user, container);
- }
+ @Override
+ @Authenticated
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor)
+ @Transactional
+ public StateContainerDTO addRoom(final String userHash, final StateToken parentToken,
+ final String roomName) throws DefaultException {
+ // final String groupShortName = parentToken.getGroup();
+ // final User user = getCurrentUser();
+ // final String userShortName = user.getShortName();
+ // final ChatConnection connection = xmppManager.login(userShortName,
+ // user.getPassword(), userHash);
+ // xmppManager.createRoom(connection, roomName, userShortName +
+ // userHash);
+ // xmppManager.disconnect(connection);
+ // try {
+ // final Container container = createFolder(groupShortName,
+ // ContentUtils.parseId(parentToken.getFolder()),
+ // roomName, ChatServerTool.TYPE_ROOM);
+ // return getState(user, container);
+ // } catch (final ContentNotFoundException e) {
+ // xmppManager.destroyRoom(connection, roomName);
+ // throw new ContentNotFoundException();
+ // } catch (final AccessViolationException e) {
+ // xmppManager.destroyRoom(connection, roomName);
+ // throw new AccessViolationException();
+ // } catch (final GroupNotFoundException e) {
+ // xmppManager.destroyRoom(connection, roomName);
+ // throw new GroupNotFoundException();
+ // }
+ return null;
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public void addParticipant(final String userHash, final StateToken token, final String participant)
- throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final User user = getCurrentUser();
- contentManager.addParticipant(user, contentId, participant);
- }
+ private StateContentDTO createContent(final StateToken parentToken, final String title,
+ final String typeId) {
+ final User user = getCurrentUser();
+ final Container container = accessService.accessToContainer(
+ ContentUtils.parseId(parentToken.getFolder()), user, AccessRol.Editor);
+ final String body = "";
+ final Content addedContent = creationService.createContent(title, body, user, container, typeId);
+ return getState(user, addedContent);
+ }
- @Override
- @Authenticated
- @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor)
- @Transactional
- public StateContainerDTO addRoom(final String userHash, final StateToken parentToken, final String roomName)
- throws DefaultException {
- // final String groupShortName = parentToken.getGroup();
- // final User user = getCurrentUser();
- // final String userShortName = user.getShortName();
- // final ChatConnection connection = xmppManager.login(userShortName,
- // user.getPassword(), userHash);
- // xmppManager.createRoom(connection, roomName, userShortName +
- // userHash);
- // xmppManager.disconnect(connection);
- // try {
- // final Container container = createFolder(groupShortName,
- // ContentUtils.parseId(parentToken.getFolder()),
- // roomName, ChatServerTool.TYPE_ROOM);
- // return getState(user, container);
- // } catch (final ContentNotFoundException e) {
- // xmppManager.destroyRoom(connection, roomName);
- // throw new ContentNotFoundException();
- // } catch (final AccessViolationException e) {
- // xmppManager.destroyRoom(connection, roomName);
- // throw new AccessViolationException();
- // } catch (final GroupNotFoundException e) {
- // xmppManager.destroyRoom(connection, roomName);
- // throw new GroupNotFoundException();
- // }
- return null;
- }
+ private Container createFolder(final String groupShortName, final Long parentFolderId,
+ final String title, final String typeId) throws DefaultException {
+ final User user = getCurrentUser();
+ final Group group = groupManager.findByShortName(groupShortName);
+ final Container container = creationService.createFolder(group, parentFolderId, title,
+ user.getLanguage(), typeId);
+ return container;
+ }
- private StateContentDTO createContent(final StateToken parentToken, final String title, final String typeId) {
- final User user = getCurrentUser();
- final Container container = accessService.accessToContainer(ContentUtils.parseId(parentToken.getFolder()),
- user, AccessRol.Editor);
- final String body = "";
- final Content addedContent = creationService.createContent(title, body, user, container, typeId);
- return getState(user, addedContent);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Administrator)
+ @Transactional
+ public StateContentDTO delContent(final String userHash, final StateToken token)
+ throws DefaultException {
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ return getState(getCurrentUser(), contentManager.setStatus(contentId, ContentStatus.inTheDustbin));
+ }
- private Container createFolder(final String groupShortName, final Long parentFolderId, final String title,
- final String typeId) throws DefaultException {
- final User user = getCurrentUser();
- final Group group = groupManager.findByShortName(groupShortName);
- final Container container = creationService.createFolder(group, parentFolderId, title, user.getLanguage(),
- typeId);
- return container;
+ @Override
+ @Authenticated(mandatory = false)
+ @Transactional
+ public StateAbstractDTO getContent(final String userHash, final StateToken token)
+ throws DefaultException {
+ Group defaultGroup;
+ final User user = getCurrentUser();
+ if (isUserLoggedIn()) {
+ defaultGroup = groupManager.getGroupOfUserWithId(user.getId());
+ if (groupManager.findEnabledTools(defaultGroup.getId()).size() == 0) {
+ // Groups with no homepage
+ defaultGroup = groupManager.getSiteDefaultGroup();
+ }
+ } else {
+ defaultGroup = groupManager.getSiteDefaultGroup();
}
-
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Administrator)
- @Transactional
- public StateContentDTO delContent(final String userHash, final StateToken token) throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- return getState(getCurrentUser(), contentManager.setStatus(contentId, ContentStatus.inTheDustbin));
+ try {
+ final Content content = finderService.getContent(token, defaultGroup);
+ return getContentOrDefContent(userHash, content.getStateToken(), user, content);
+ } catch (final NoResultException e) {
+ throw new ContentNotFoundException();
+ } catch (final ToolNotFoundException e) {
+ throw new ContentNotFoundException();
+ } catch (final NoDefaultContentException e) {
+ return mapper.map(stateService.createNoHome(user, token.getGroup()), StateNoContentDTO.class);
}
+ }
- @Override
- @Authenticated(mandatory = false)
- @Transactional
- public StateAbstractDTO getContent(final String userHash, final StateToken token) throws DefaultException {
- Group defaultGroup;
- final User user = getCurrentUser();
- if (isUserLoggedIn()) {
- defaultGroup = groupManager.getGroupOfUserWithId(user.getId());
- if (groupManager.findEnabledTools(defaultGroup.getId()).size() == 0) {
- // Groups with no homepage
- defaultGroup = groupManager.getSiteDefaultGroup();
- }
- } else {
- defaultGroup = groupManager.getSiteDefaultGroup();
- }
- try {
- final Content content = finderService.getContent(token, defaultGroup);
- return getContentOrDefContent(userHash, content.getStateToken(), user, content);
- } catch (final NoResultException e) {
- throw new ContentNotFoundException();
- } catch (final ToolNotFoundException e) {
- throw new ContentNotFoundException();
- } catch (final NoDefaultContentException e) {
- return mapper.map(stateService.createNoHome(user, token.getGroup()), StateNoContentDTO.class);
- }
+ @Authenticated(mandatory = false)
+ @Authorizated(accessRolRequired = AccessRol.Viewer)
+ private StateAbstractDTO getContentOrDefContent(final String userHash, final StateToken stateToken,
+ final User user, final Content content) {
+ final Long id = content.getId();
+ if (id != null) {
+ // Content
+ return mapState(stateService.create(user, content), user);
+ } else {
+ // Container
+ final Container container = content.getContainer();
+ return mapState(stateService.create(user, container), user);
}
+ }
- @Authenticated(mandatory = false)
- @Authorizated(accessRolRequired = AccessRol.Viewer)
- private StateAbstractDTO getContentOrDefContent(final String userHash, final StateToken stateToken,
- final User user, final Content content) {
- final Long id = content.getId();
- if (id != null) {
- // Content
- return mapState(stateService.create(user, content), user);
- } else {
- // Container
- final Container container = content.getContainer();
- return mapState(stateService.create(user, container), user);
- }
- }
+ private User getCurrentUser() {
+ return getUserSession().getUser();
+ }
- private User getCurrentUser() {
- return getUserSession().getUser();
- }
+ private StateContainerDTO getState(final User user, final Container container) {
+ final StateContainer state = stateService.create(user, container);
+ return mapState(state, user);
+ }
- private StateContainerDTO getState(final User user, final Container container) {
- final StateContainer state = stateService.create(user, container);
- return mapState(state, user);
- }
+ private StateContentDTO getState(final User user, final Content content) {
+ final StateContent state = stateService.create(user, content);
+ return mapState(state, user);
+ }
- private StateContentDTO getState(final User user, final Content content) {
- final StateContent state = stateService.create(user, content);
- return mapState(state, user);
- }
+ private TagCloudResult getSummaryTags(final Group group) {
+ final TagCloudResult result = tagManager.getTagCloudResultByGroup(group);
+ return result;
+ }
- private TagCloudResult getSummaryTags(final Group group) {
- final TagCloudResult result = tagManager.getTagCloudResultByGroup(group);
- return result;
- }
+ @Override
+ @Authenticated(mandatory = false)
+ @Authorizated(accessRolRequired = AccessRol.Viewer)
+ @Transactional
+ public TagCloudResult getSummaryTags(final String userHash, final StateToken groupToken) {
+ final Group group = groupManager.findByShortName(groupToken.getGroup());
+ return getSummaryTags(group);
+ }
- @Override
- @Authenticated(mandatory = false)
- @Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
- public TagCloudResult getSummaryTags(final String userHash, final StateToken groupToken) {
- final Group group = groupManager.findByShortName(groupToken.getGroup());
- return getSummaryTags(group);
- }
+ private UserSession getUserSession() {
+ return userSessionProvider.get();
+ }
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
+ private boolean isUserLoggedIn() {
+ return getUserSession().isUserLoggedIn();
+ }
- private boolean isUserLoggedIn() {
- return getUserSession().isUserLoggedIn();
- }
+ private void mapContentRightsInstate(final User user, final AccessLists groupAccessList,
+ final ContentSimpleDTO siblingDTO) {
+ final Content sibling = contentManager.find(siblingDTO.getId());
+ final AccessLists lists = sibling.hasAccessList() ? sibling.getAccessLists() : groupAccessList;
+ siblingDTO.setRights(mapper.map(rightsService.get(user, lists), AccessRights.class));
+ }
- private void mapContentRightsInstate(final User user, final AccessLists groupAccessList,
- final ContentSimpleDTO siblingDTO) {
- final Content sibling = contentManager.find(siblingDTO.getId());
- final AccessLists lists = sibling.hasAccessList() ? sibling.getAccessLists() : groupAccessList;
- siblingDTO.setRights(mapper.map(rightsService.get(user, lists), AccessRights.class));
+ private StateContainerDTO mapState(final StateContainer state, final User user) {
+ final StateContainerDTO stateDTO = mapper.map(state, StateContainerDTO.class);
+ final AccessLists groupAccessList = state.getGroup().getSocialNetwork().getAccessLists();
+ for (final ContentSimpleDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
+ mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
-
- private StateContainerDTO mapState(final StateContainer state, final User user) {
- final StateContainerDTO stateDTO = mapper.map(state, StateContainerDTO.class);
- final AccessLists groupAccessList = state.getGroup().getSocialNetwork().getAccessLists();
- for (final ContentSimpleDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
- mapContentRightsInstate(user, groupAccessList, siblingDTO);
- }
- for (final ContentSimpleDTO siblingDTO : stateDTO.getContainer().getContents()) {
- mapContentRightsInstate(user, groupAccessList, siblingDTO);
- }
- return stateDTO;
+ for (final ContentSimpleDTO siblingDTO : stateDTO.getContainer().getContents()) {
+ mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
+ return stateDTO;
+ }
- private StateContentDTO mapState(final StateContent state, final User user) {
- final StateContentDTO stateDTO = mapper.map(state, StateContentDTO.class);
- final AccessLists groupAccessList = state.getGroup().getSocialNetwork().getAccessLists();
- for (final ContentSimpleDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
- mapContentRightsInstate(user, groupAccessList, siblingDTO);
- }
- for (final ContentSimpleDTO siblingDTO : stateDTO.getContainer().getContents()) {
- mapContentRightsInstate(user, groupAccessList, siblingDTO);
- }
- return stateDTO;
+ private StateContentDTO mapState(final StateContent state, final User user) {
+ final StateContentDTO stateDTO = mapper.map(state, StateContentDTO.class);
+ final AccessLists groupAccessList = state.getGroup().getSocialNetwork().getAccessLists();
+ for (final ContentSimpleDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
+ mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
-
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
- public CommentDTO markCommentAsAbuse(final String userHash, final StateToken token, final Long commentId)
- throws DefaultException {
- final User informer = getCurrentUser();
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final Comment comment = commentManager.markAsAbuse(informer, contentId, commentId);
- return mapper.map(comment, CommentDTO.class);
+ for (final ContentSimpleDTO siblingDTO : stateDTO.getContainer().getContents()) {
+ mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
+ return stateDTO;
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
- public RateResult rateContent(final String userHash, final StateToken token, final Double value)
- throws DefaultException {
- final User rater = getCurrentUser();
- final Long contentId = ContentUtils.parseId(token.getDocument());
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Viewer)
+ @Transactional
+ public RateResult rateContent(final String userHash, final StateToken token, final Double value)
+ throws DefaultException {
+ final User rater = getCurrentUser();
+ final Long contentId = ContentUtils.parseId(token.getDocument());
- if (isUserLoggedIn()) {
- return contentManager.rateContent(rater, contentId, value);
- } else {
- throw new AccessViolationException();
- }
+ if (isUserLoggedIn()) {
+ return contentManager.rateContent(rater, contentId, value);
+ } else {
+ throw new AccessViolationException();
}
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public void removeAuthor(final String userHash, final StateToken token, final String authorShortName)
- throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final User user = getCurrentUser();
- contentManager.removeAuthor(user, contentId, authorShortName);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public void removeAuthor(final String userHash, final StateToken token, final String authorShortName)
+ throws DefaultException {
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final User user = getCurrentUser();
+ contentManager.removeAuthor(user, contentId, authorShortName);
+ }
- @Override
- @Authenticated
- @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public StateAbstractDTO renameContainer(final String userHash, final StateToken token, final String newName)
- throws DefaultException {
- renameFolder(token.getGroup(), ContentUtils.parseId(token.getFolder()), newName);
- return getContent(userHash, token);
- }
+ @Override
+ @Authenticated
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public StateAbstractDTO renameContainer(final String userHash, final StateToken token,
+ final String newName) throws DefaultException {
+ renameFolder(token.getGroup(), ContentUtils.parseId(token.getFolder()), newName);
+ return getContent(userHash, token);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public StateAbstractDTO renameContent(final String userHash, final StateToken token, final String newName)
- throws DefaultException {
- final User user = getCurrentUser();
- try {
- accessService.accessToContent(ContentUtils.parseId(token.getDocument()), user, AccessRol.Editor);
- } catch (final NoResultException e) {
- throw new AccessViolationException();
- }
- renameContent(token.getDocument(), newName);
- return getContent(userHash, token);
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public StateAbstractDTO renameContent(final String userHash, final StateToken token,
+ final String newName) throws DefaultException {
+ final User user = getCurrentUser();
+ try {
+ accessService.accessToContent(ContentUtils.parseId(token.getDocument()), user, AccessRol.Editor);
+ } catch (final NoResultException e) {
+ throw new AccessViolationException();
}
+ renameContent(token.getDocument(), newName);
+ return getContent(userHash, token);
+ }
- private Content renameContent(final String documentId, final String newName) throws ContentNotFoundException,
- DefaultException {
- final Long contentId = ContentUtils.parseId(documentId);
- final User user = getCurrentUser();
- return contentManager.renameContent(user, contentId, newName);
- }
+ private Content renameContent(final String documentId, final String newName)
+ throws ContentNotFoundException, DefaultException {
+ final Long contentId = ContentUtils.parseId(documentId);
+ final User user = getCurrentUser();
+ return contentManager.renameContent(user, contentId, newName);
+ }
- private Container renameFolder(final String groupShortName, final Long folderId, final String newName)
- throws DefaultException {
- final Group group = groupManager.findByShortName(groupShortName);
- final User user = getCurrentUser();
- final Container container = accessService.accessToContainer(folderId, user, AccessRol.Editor);
- return containerManager.renameFolder(group, container, newName);
- }
+ private Container renameFolder(final String groupShortName, final Long folderId, final String newName)
+ throws DefaultException {
+ final Group group = groupManager.findByShortName(groupShortName);
+ final User user = getCurrentUser();
+ final Container container = accessService.accessToContainer(folderId, user, AccessRol.Editor);
+ return containerManager.renameFolder(group, container, newName);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public void save(final String userHash, final StateToken token, final String textContent) throws DefaultException {
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public void save(final String userHash, final StateToken token, final String textContent)
+ throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final User user = getCurrentUser();
- final Content content = accessService.accessToContent(contentId, user, AccessRol.Editor);
- creationService.saveContent(user, content, textContent);
- }
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final User user = getCurrentUser();
+ final Content content = accessService.accessToContent(contentId, user, AccessRol.Editor);
+ creationService.saveContent(user, content, textContent);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Administrator)
- @Transactional
- public ContentSimpleDTO setAsDefaultContent(final String userHash, final StateToken token) {
- final Content content = contentManager.find(ContentUtils.parseId(token.getDocument()));
- groupManager.setDefaultContent(token.getGroup(), content);
- return mapper.map(content, ContentSimpleDTO.class);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Administrator)
+ @Transactional
+ public ContentSimpleDTO setAsDefaultContent(final String userHash, final StateToken token) {
+ final Content content = contentManager.find(ContentUtils.parseId(token.getDocument()));
+ groupManager.setDefaultContent(token.getGroup(), content);
+ return mapper.map(content, ContentSimpleDTO.class);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public I18nLanguageDTO setLanguage(final String userHash, final StateToken token, final String languageCode)
- throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final User user = getCurrentUser();
- return mapper.map(contentManager.setLanguage(user, contentId, languageCode), I18nLanguageDTO.class);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public I18nLanguageDTO setLanguage(final String userHash, final StateToken token,
+ final String languageCode) throws DefaultException {
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final User user = getCurrentUser();
+ return mapper.map(contentManager.setLanguage(user, contentId, languageCode), I18nLanguageDTO.class);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public void setPublishedOn(final String userHash, final StateToken token, final Date publishedOn)
- throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final User user = getCurrentUser();
- contentManager.setPublishedOn(user, contentId, publishedOn);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public void setPublishedOn(final String userHash, final StateToken token, final Date publishedOn)
+ throws DefaultException {
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final User user = getCurrentUser();
+ contentManager.setPublishedOn(user, contentId, publishedOn);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor)
- @Transactional
- public StateAbstractDTO setStatus(final String userHash, final StateToken token, final ContentStatus status) {
- if (status.equals(ContentStatus.publishedOnline) || status.equals(ContentStatus.rejected)
- || status.equals(ContentStatus.inTheDustbin)) {
- throw new AccessViolationException();
- }
- final Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
- ContentStatus.valueOf(status.toString()));
- return getState(getCurrentUser(), content);
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor)
+ @Transactional
+ public StateAbstractDTO setStatus(final String userHash, final StateToken token,
+ final ContentStatus status) {
+ if (status.equals(ContentStatus.publishedOnline) || status.equals(ContentStatus.rejected)
+ || status.equals(ContentStatus.inTheDustbin)) {
+ throw new AccessViolationException();
}
+ final Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
+ ContentStatus.valueOf(status.toString()));
+ return getState(getCurrentUser(), content);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Administrator)
- @Transactional
- public StateAbstractDTO setStatusAsAdmin(final String userHash, final StateToken token, final ContentStatus status) {
- final Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
- ContentStatus.valueOf(status.toString()));
- return getState(getCurrentUser(), content);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Administrator)
+ @Transactional
+ public StateAbstractDTO setStatusAsAdmin(final String userHash, final StateToken token,
+ final ContentStatus status) {
+ final Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
+ ContentStatus.valueOf(status.toString()));
+ return getState(getCurrentUser(), content);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
- @Transactional
- public TagCloudResult setTags(final String userHash, final StateToken token, final String tags)
- throws DefaultException {
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final User user = getCurrentUser();
- final Group group = groupManager.findByShortName(token.getGroup());
- contentManager.setTags(user, contentId, tags);
- return getSummaryTags(group);
- }
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public TagCloudResult setTags(final String userHash, final StateToken token, final String tags)
+ throws DefaultException {
+ final Long contentId = ContentUtils.parseId(token.getDocument());
+ final User user = getCurrentUser();
+ final Group group = groupManager.findByShortName(token.getGroup());
+ contentManager.setTags(user, contentId, tags);
+ return getSummaryTags(group);
+ }
- @Override
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Viewer)
- @Transactional
- public CommentDTO voteComment(final String userHash, final StateToken token, final Long commentId,
- final boolean votePositive) throws DefaultException {
- final User voter = getCurrentUser();
- final Long contentId = ContentUtils.parseId(token.getDocument());
- final Comment comment = commentManager.vote(voter, contentId, commentId, votePositive);
- return mapper.map(comment, CommentDTO.class);
- }
-
}
Modified: trunk/src/main/java/cc/kune/core/server/state/StateContent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateContent.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/state/StateContent.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -34,8 +34,8 @@
private Double currentUserRate;
private String documentId;
private boolean isParticipant;
- private boolean isWave;
private BasicMimeType mimeType;
+ private Date modifiedOn;
private Date publishedOn;
private Double rate;
private Integer rateByUsers;
@@ -75,6 +75,10 @@
return mimeType;
}
+ public Date getModifiedOn() {
+ return modifiedOn;
+ }
+
public Date getPublishedOn() {
return publishedOn;
}
@@ -139,6 +143,10 @@
this.mimeType = mimeType;
}
+ public void setModifiedOn(final Date modifiedOn) {
+ this.modifiedOn = modifiedOn;
+ }
+
public void setPublishedOn(final Date publishedOn) {
this.publishedOn = publishedOn;
}
Modified: trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -19,6 +19,8 @@
*/
package cc.kune.core.server.state;
+import java.sql.Date;
+
import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
@@ -103,13 +105,18 @@
final char[] text = revision.getBody();
final String textBody = text == null ? null : new String(text);
if (content.isWave()) {
- state.setWaveRef(textBody);
+ final String waveId = content.getWaveId();
+ state.setWaveRef(waveId);
try {
final Wavelet wavelet = kuneWaveManager.fetchWavelet(
- JavaWaverefEncoder.decodeWaveRefFromPath(textBody),
- content.getAuthors().get(0).getShortName());
+ JavaWaverefEncoder.decodeWaveRefFromPath(waveId), content.getAuthors().get(0).getShortName());
state.setContent(wavelet.getRootBlip().getContent());
+ // Well we "cache" the last modified time of waves in db (w'll find
+ // another way to
+ // do it better in the future with db persitence of waves)
+ contentManager.setModifiedOn(content, wavelet.getLastModifiedTime());
state.setTitle(wavelet.getTitle());
+ state.setModifiedOn(new Date(wavelet.getLastModifiedTime()));
state.setIsParticipant(userLogged != User.UNKNOWN_USER ? kuneWaveManager.isParticipant(wavelet,
userLogged.getShortName()) : false);
} catch (final InvalidWaveRefException e) {
Deleted: trunk/src/main/java/cc/kune/core/shared/dto/CommentDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/CommentDTO.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/shared/dto/CommentDTO.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,173 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.core.shared.dto;
-
-import java.util.List;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-public class CommentDTO implements IsSerializable {
-
- private Long id;
- // private ContentDTO content;
- private Long publishedOn;
- private UserSimpleDTO author;
- private CommentDTO parent;
- private List<CommentDTO> childs;
- private int positiveVotersCount;
- private int negativeVotersCount;
- private int abuseInformersCount;
- private String text;
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final CommentDTO other = (CommentDTO) obj;
- if (author == null) {
- if (other.author != null) {
- return false;
- }
- } else if (!author.equals(other.author)) {
- return false;
- }
- if (id == null) {
- if (other.id != null) {
- return false;
- }
- } else if (!id.equals(other.id)) {
- return false;
- }
- if (parent == null) {
- if (other.parent != null) {
- return false;
- }
- } else if (!parent.equals(other.parent)) {
- return false;
- }
- if (publishedOn == null) {
- if (other.publishedOn != null) {
- return false;
- }
- } else if (!publishedOn.equals(other.publishedOn)) {
- return false;
- }
- if (text == null) {
- if (other.text != null) {
- return false;
- }
- } else if (!text.equals(other.text)) {
- return false;
- }
- return true;
- }
-
- public int getAbuseInformersCount() {
- return abuseInformersCount;
- }
-
- public UserSimpleDTO getAuthor() {
- return author;
- }
-
- public List<CommentDTO> getChilds() {
- return childs;
- }
-
- public Long getId() {
- return id;
- }
-
- public int getNegativeVotersCount() {
- return negativeVotersCount;
- }
-
- public CommentDTO getParent() {
- return parent;
- }
-
- public int getPositiveVotersCount() {
- return positiveVotersCount;
- }
-
- public Long getPublishedOn() {
- return publishedOn;
- }
-
- public String getText() {
- return text;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (author == null ? 0 : author.hashCode());
- result = prime * result + (id == null ? 0 : id.hashCode());
- result = prime * result + (parent == null ? 0 : parent.hashCode());
- result = prime * result + (publishedOn == null ? 0 : publishedOn.hashCode());
- result = prime * result + (text == null ? 0 : text.hashCode());
- return result;
- }
-
- public void setAbuseInformersCount(final int abuseInformersCount) {
- this.abuseInformersCount = abuseInformersCount;
- }
-
- public void setAuthor(final UserSimpleDTO author) {
- this.author = author;
- }
-
- public void setChilds(final List<CommentDTO> childs) {
- this.childs = childs;
- }
-
- public void setId(final Long id) {
- this.id = id;
- }
-
- public void setNegativeVotersCount(final int negativeVotersCount) {
- this.negativeVotersCount = negativeVotersCount;
- }
-
- public void setParent(final CommentDTO parent) {
- this.parent = parent;
- }
-
- public void setPositiveVotersCount(final int positiveVotersCount) {
- this.positiveVotersCount = positiveVotersCount;
- }
-
- public void setPublishedOn(final Long publishedOn) {
- this.publishedOn = publishedOn;
- }
-
- public void setText(final String text) {
- this.text = text;
- }
-
-}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -27,68 +27,86 @@
public class ContentSimpleDTO implements IsSerializable {
- private Long id;
- private String title;
- private String typeId;
- private StateToken stateToken;
- private ContentStatus status;
- private AccessRights rights;
- private BasicMimeTypeDTO mimeType;
+ private Long id;
+ private BasicMimeTypeDTO mimeType;
+ private Long modifiedOn;
+ private AccessRights rights;
+ private StateToken stateToken;
+ private ContentStatus status;
+ private String title;
+ private String typeId;
+ private String waveId;
- public Long getId() {
- return id;
- }
+ public Long getId() {
+ return id;
+ }
- public BasicMimeTypeDTO getMimeType() {
- return mimeType;
- }
+ public BasicMimeTypeDTO getMimeType() {
+ return mimeType;
+ }
- public AccessRights getRights() {
- return rights;
- }
+ public Long getModifiedOn() {
+ return modifiedOn;
+ }
- public StateToken getStateToken() {
- return stateToken;
- }
+ public AccessRights getRights() {
+ return rights;
+ }
- public ContentStatus getStatus() {
- return status;
- }
+ public StateToken getStateToken() {
+ return stateToken;
+ }
- public String getTitle() {
- return title;
- }
+ public ContentStatus getStatus() {
+ return status;
+ }
- public String getTypeId() {
- return typeId;
- }
+ public String getTitle() {
+ return title;
+ }
- public void setId(final Long id) {
- this.id = id;
- }
+ public String getTypeId() {
+ return typeId;
+ }
- public void setMimeType(final BasicMimeTypeDTO mimeType) {
- this.mimeType = mimeType;
- }
+ public String getWaveId() {
+ return waveId;
+ }
- public void setRights(final AccessRights rights) {
- this.rights = rights;
- }
+ public void setId(final Long id) {
+ this.id = id;
+ }
- public void setStateToken(final StateToken stateToken) {
- this.stateToken = stateToken;
- }
+ public void setMimeType(final BasicMimeTypeDTO mimeType) {
+ this.mimeType = mimeType;
+ }
- public void setStatus(final ContentStatus status) {
- this.status = status;
- }
+ public void setModifiedOn(final Long modifiedOn) {
+ this.modifiedOn = modifiedOn;
+ }
- public void setTitle(final String title) {
- this.title = title;
- }
+ public void setRights(final AccessRights rights) {
+ this.rights = rights;
+ }
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
- }
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
+ }
+ public void setStatus(final ContentStatus status) {
+ this.status = status;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
+
+ public void setWaveId(final String waveId) {
+ this.waveId = waveId;
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -37,6 +37,7 @@
private String documentId;
private boolean isParticipant;
private BasicMimeTypeDTO mimeType;
+ private Date modifiedOn;
private Date publishedOn;
private Double rate;
private Integer rateByUsers;
@@ -76,6 +77,10 @@
return mimeType;
}
+ public Date getModifiedOn() {
+ return modifiedOn;
+ }
+
public Date getPublishedOn() {
return publishedOn;
}
@@ -140,6 +145,10 @@
this.mimeType = mimeType;
}
+ public void setModifiedOn(final Date modifiedOn) {
+ this.modifiedOn = modifiedOn;
+ }
+
public void setPublishedOn(final Date publishedOn) {
this.publishedOn = publishedOn;
}
Deleted: trunk/src/main/java/cc/kune/domain/Comment.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Comment.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/domain/Comment.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,222 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.domain;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.hibernate.annotations.Fetch;
-import org.hibernate.annotations.FetchMode;
-import org.hibernate.search.annotations.DocumentId;
-import org.hibernate.search.annotations.Field;
-import org.hibernate.search.annotations.Index;
-import org.hibernate.search.annotations.IndexedEmbedded;
-import org.hibernate.search.annotations.Store;
-
- at Entity
- at Table(name = "comment")
-public class Comment {
-
- @IndexedEmbedded
- @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
- private List<User> abuseInformers;
-
- @IndexedEmbedded
- @OneToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
- private User author;
-
- @Fetch(FetchMode.JOIN)
- @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
- private Set<Comment> childs;
-
- @ManyToOne
- @JoinColumn
- @IndexedEmbedded
- private Content content;
-
- @Id
- @GeneratedValue
- @DocumentId
- private Long id;
-
- @IndexedEmbedded
- @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
- private List<User> negativeVoters;
-
- // Parent/Child pattern:
- // http://www.hibernate.org/hib_docs/reference/en/html/example-parentchild.html
- // http://www.researchkitchen.co.uk/blog/archives/57
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn
- private Comment parent;
-
- @IndexedEmbedded
- @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
- private List<User> positiveVoters;
-
- @Basic(optional = false)
- private Long publishedOn;
-
- @Field(index = Index.TOKENIZED, store = Store.NO)
- private String text;
-
- public Comment() {
- this.publishedOn = System.currentTimeMillis();
- this.childs = new HashSet<Comment>();
- this.positiveVoters = new ArrayList<User>();
- this.negativeVoters = new ArrayList<User>();
- this.abuseInformers = new ArrayList<User>();
- }
-
- public void addAbuseInformer(final User informer) {
- if (!abuseInformers.contains(informer)) {
- abuseInformers.add(informer);
- }
- }
-
- public void addNegativeVoter(final User voter) {
- if (!negativeVoters.contains(voter)) {
- negativeVoters.add(voter);
- }
- if (positiveVoters.contains(voter)) {
- positiveVoters.remove(voter);
- }
- }
-
- public void addPositiveVoter(final User voter) {
- if (!positiveVoters.contains(voter)) {
- positiveVoters.add(voter);
- }
- if (negativeVoters.contains(voter)) {
- negativeVoters.remove(voter);
- }
- }
-
- public List<User> getAbuseInformers() {
- return abuseInformers;
- }
-
- @Transient
- public int getAbuseInformersCount() {
- return abuseInformers.size();
- }
-
- public User getAuthor() {
- return author;
- }
-
- public Set<Comment> getChilds() {
- return childs;
- }
-
- public Content getContent() {
- return content;
- }
-
- public Long getId() {
- return id;
- }
-
- public List<User> getNegativeVoters() {
- return negativeVoters;
- }
-
- @Transient
- public int getNegativeVotersCount() {
- return negativeVoters.size();
- }
-
- public Comment getParent() {
- return parent;
- }
-
- public List<User> getPositiveVoters() {
- return positiveVoters;
- }
-
- @Transient
- public int getPositiveVotersCount() {
- return positiveVoters.size();
- }
-
- public Long getPublishedOn() {
- return publishedOn;
- }
-
- public String getText() {
- return text;
- }
-
- public void setAbuseInformers(final List<User> abuseInformers) {
- this.abuseInformers = abuseInformers;
- }
-
- public void setAuthor(final User author) {
- this.author = author;
- }
-
- public void setChilds(final Set<Comment> childs) {
- this.childs = childs;
- }
-
- public void setContent(final Content content) {
- this.content = content;
- }
-
- public void setId(final Long id) {
- this.id = id;
- }
-
- public void setNegativeVoters(final List<User> negativeVoters) {
- this.negativeVoters = negativeVoters;
- }
-
- public void setParent(final Comment parent) {
- this.parent = parent;
- }
-
- public void setPositiveVoters(final List<User> positiveVoters) {
- this.positiveVoters = positiveVoters;
- }
-
- public void setPublishedOn(final Long publishedOn) {
- this.publishedOn = publishedOn;
- }
-
- public void setText(final String text) {
- this.text = text;
- }
-}
Modified: trunk/src/main/java/cc/kune/domain/Content.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Content.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/domain/Content.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,5 +1,6 @@
/*
*
+
* Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
* This file is part of kune.
*
@@ -21,9 +22,7 @@
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
@@ -48,7 +47,6 @@
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
-import org.hibernate.search.annotations.ContainedIn;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
@@ -78,11 +76,6 @@
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
private List<User> authors;
- @Fetch(FetchMode.JOIN)
- @ContainedIn
- @OneToMany(mappedBy = "content", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
- private Set<Comment> comments;
-
@ManyToOne
@JoinColumn
@IndexedEmbedded
@@ -123,6 +116,9 @@
private BasicMimeType mimeType;
@Basic(optional = true)
+ private Long modifiedOn;
+
+ @Basic(optional = true)
private Date publishedOn;
@Enumerated(EnumType.STRING)
@@ -138,10 +134,11 @@
@Version
private int version;
+ private String waveId;
+
public Content() {
translations = new ArrayList<ContentTranslation>();
authors = new ArrayList<User>();
- comments = new HashSet<Comment>();
createdOn = System.currentTimeMillis();
lastRevision = new Revision(this);
accessLists = null;
@@ -154,13 +151,6 @@
}
}
- public void addComment(final Comment comment) {
- // FIXME: something related with lazy initialization (workaround using
- // size())
- comments.size();
- comments.add(comment);
- }
-
public void addRevision(final Revision revision) {
if (lastRevision == null) {
lastRevision = revision;
@@ -179,10 +169,6 @@
return authors;
}
- public Set<Comment> getComments() {
- return comments;
- }
-
public Container getContainer() {
return container;
}
@@ -219,6 +205,10 @@
return mimeType;
}
+ public Long getModifiedOn() {
+ return modifiedOn;
+ }
+
public Group getOwner(final Group group) {
return container.getOwner();
}
@@ -258,6 +248,10 @@
return version;
}
+ public String getWaveId() {
+ return waveId;
+ }
+
@Transient
public boolean hasAccessList() {
return accessLists != null;
@@ -280,10 +274,6 @@
this.authors = authors;
}
- public void setComments(final Set<Comment> comments) {
- this.comments = comments;
- }
-
public void setContainer(final Container container) {
this.container = container;
}
@@ -321,6 +311,10 @@
this.mimeType = mimeType;
}
+ public void setModifiedOn(final Long modifiedOn) {
+ this.modifiedOn = modifiedOn;
+ }
+
public void setPublishedOn(final Date publishedOn) {
this.publishedOn = publishedOn;
}
@@ -341,6 +335,10 @@
this.version = version;
}
+ public void setWaveId(final String waveId) {
+ this.waveId = waveId;
+ }
+
@Override
public String toString() {
return "Content[(" + getStateTokenEncoded() + "): " + getTitle() + "]";
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/RenameAction.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -20,6 +20,7 @@
package cc.kune.gspace.client.actions;
import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.errors.ErrorHandler;
import cc.kune.core.client.errors.NameInUseException;
import cc.kune.core.client.errors.NameNotPermittedException;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -34,15 +35,17 @@
public class RenameAction {
private final Provider<ContentServiceAsync> contentService;
+ private final ErrorHandler errorHandler;
private final I18nTranslationService i18n;
private final Session session;
@Inject
public RenameAction(final I18nTranslationService i18n, final Session session,
- final Provider<ContentServiceAsync> contentService) {
+ final Provider<ContentServiceAsync> contentService, final ErrorHandler errorHandler) {
this.i18n = i18n;
this.session = session;
this.contentService = contentService;
+ this.errorHandler = errorHandler;
}
public void rename(final StateToken token, final String oldName, final String newName,
@@ -60,9 +63,10 @@
NotifyUser.error(i18n.tWithNT("This name is not permitted",
"It is used when a file or a folder does not have a permitted name"));
} else {
+ errorHandler.process(caught);
NotifyUser.error(i18n.t("Error renaming"));
}
- listener.onFail(token, newName);
+ listener.onFail(token, oldName);
}
@Override
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -24,70 +24,77 @@
import cc.kune.core.shared.domain.utils.StateToken;
public class FolderItemDescriptor {
- private final GuiActionDescCollection actionCollection;
- private final boolean allowDrag;
- private final boolean allowDrop;
- private final ContentStatus contentStatus;
- private final Object icon;
- private final String id;
- private final String parentId;
- private final String text;
- private final StateToken token;
- private final String tooltip;
+ private final GuiActionDescCollection actionCollection;
+ private final boolean allowDrag;
+ private final boolean allowDrop;
+ private final ContentStatus contentStatus;
+ private final Object icon;
+ private final String id;
+ private final long modififiedOn;
+ private final String parentId;
+ private final String text;
+ private final StateToken token;
+ private final String tooltip;
- public FolderItemDescriptor(final String id, final String parentId, final Object icon, final String text,
- final String tooltip, final ContentStatus contentStatus, final StateToken token, final boolean allowDrag,
- final boolean allowDrop, final GuiActionDescCollection actionCollection) {
- this.id = id;
- this.parentId = parentId;
- this.icon = icon;
- this.text = text;
- this.tooltip = tooltip;
- this.contentStatus = contentStatus;
- this.token = token;
- this.allowDrag = allowDrag;
- this.allowDrop = allowDrop;
- this.actionCollection = actionCollection;
- }
+ public FolderItemDescriptor(final String id, final String parentId, final Object icon,
+ final String text, final String tooltip, final ContentStatus contentStatus,
+ final StateToken token, final long modififiedOn, final boolean allowDrag, final boolean allowDrop,
+ final GuiActionDescCollection actionCollection) {
+ this.id = id;
+ this.parentId = parentId;
+ this.icon = icon;
+ this.text = text;
+ this.tooltip = tooltip;
+ this.contentStatus = contentStatus;
+ this.token = token;
+ this.modififiedOn = modififiedOn;
+ this.allowDrag = allowDrag;
+ this.allowDrop = allowDrop;
+ this.actionCollection = actionCollection;
+ }
- public GuiActionDescCollection getActionCollection() {
- return actionCollection;
- }
+ public GuiActionDescCollection getActionCollection() {
+ return actionCollection;
+ }
- public ContentStatus getContentStatus() {
- return contentStatus;
- }
+ public ContentStatus getContentStatus() {
+ return contentStatus;
+ }
- public Object getIcon() {
- return icon;
- }
+ public Object getIcon() {
+ return icon;
+ }
- public String getId() {
- return id;
- }
+ public String getId() {
+ return id;
+ }
- public String getParentId() {
- return parentId;
- }
+ public long getModififiedOn() {
+ return modififiedOn;
+ }
- public StateToken getStateToken() {
- return token;
- }
+ public String getParentId() {
+ return parentId;
+ }
- public String getText() {
- return text;
- }
+ public StateToken getStateToken() {
+ return token;
+ }
- public String getTooltip() {
- return tooltip;
- }
+ public String getText() {
+ return text;
+ }
- public boolean isDraggable() {
- return allowDrag;
- }
+ public String getTooltip() {
+ return tooltip;
+ }
- public boolean isDroppable() {
- return allowDrop;
- }
+ public boolean isDraggable() {
+ return allowDrag;
+ }
+ public boolean isDroppable() {
+ return allowDrop;
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -40,6 +40,8 @@
@UiField
SimplePanel menu;
@UiField
+ InlineLabel modified;
+ @UiField
InlineLabel title;
public FolderItemWidget(final ImageResource iconResource, final String title) {
@@ -102,6 +104,14 @@
menu.add(toolbar);
}
+ public void setMenuVisible(final boolean visible) {
+ menu.getElement().getStyle().setOpacity(visible ? 1d : 0.2d);
+ }
+
+ public void setModifiedText(final String text) {
+ modified.setText(text);
+ }
+
public void setSelect(final boolean selected) {
clearFocusStyles();
focusPanel.removeStyleDependentName(selected ? "noselected" : "selected");
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml 2011-05-05 14:46:37 UTC (rev 1346)
@@ -35,6 +35,17 @@
outline: 0;
}
+ .modified {
+ margin-right: 5px;
+ color: #A05A2C;
+ font-size: 17px;
+ line-height: 1.3em;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ float: right;
+ font-style: italic;
+ }
+
.title {
margin-left: 5px;
color: #A05A2C;
@@ -57,6 +68,8 @@
<g:Image styleName="{style.icon}" ui:field="icon" />
<g:InlineLabel styleName="{style.title}" ui:field="title" />
<g:SimplePanel styleName="{style.menu}" ui:field="menu" />
+ <g:InlineLabel styleName="{style.modified}"
+ ui:field="modified" />
</g:FlowPanel>
</g:FocusPanel>
</ui:UiBinder>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,5 +1,7 @@
package cc.kune.gspace.client.viewers;
+import org.waveprotocol.wave.client.common.util.DateUtils;
+
import cc.kune.common.client.actions.ui.ActionSimplePanel;
import cc.kune.common.client.actions.ui.bind.GuiProvider;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
@@ -9,6 +11,7 @@
import cc.kune.core.shared.dto.StateContainerDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter.FolderViewerView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -57,12 +60,17 @@
final FolderItemWidget itemWidget = new FolderItemWidget((ImageResource) item.getIcon(),
item.getText());
final ActionSimplePanel toolbar = new ActionSimplePanel(guiProvider);
+ final long modifiedOn = item.getModififiedOn();
+ if (modifiedOn != FolderViewerView.NO_DATE) {
+ // String dateFormat = session.getCurrentLanguage().getDateFormatShort();
+ itemWidget.setModifiedText(DateUtils.getInstance().formatPastDate(modifiedOn));
+ }
itemWidget.setMenu(toolbar);
// Tooltip.to(itemWidget, item.getTooltip());
final MenuDescriptor menu = new MenuDescriptor(i18n.t("Actions"));
menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
menu.setStandalone(false);
- menu.setVisible(false);
+ itemWidget.setMenuVisible(false);
toolbar.add(menu);
for (final GuiActionDescrip menuItem : item.getActionCollection()) {
menuItem.setParent(menu);
@@ -82,7 +90,8 @@
itemWidget.getRowMouse().addMouseOutHandler(new MouseOutHandler() {
@Override
public void onMouseOut(final MouseOutEvent event) {
- menu.setVisible(false);
+ itemWidget.setMenuVisible(false);
+ // menu.setVisible(false);
// itemWidget.setSelect(false);
// menu.hide();
}
@@ -90,7 +99,8 @@
itemWidget.getRowMouse().addMouseOverHandler(new MouseOverHandler() {
@Override
public void onMouseOver(final MouseOverEvent event) {
- menu.setVisible(true);
+ // menu.setVisible(true);
+ itemWidget.setMenuVisible(true);
}
});
flex.setWidget(rowCount + 1, 0, itemWidget);
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -55,6 +55,8 @@
public interface FolderViewerView extends View {
+ long NO_DATE = 0;
+
void addItem(FolderItemDescriptor item, ClickHandler clickHandler,
DoubleClickHandler doubleClickHandler);
@@ -111,11 +113,11 @@
private void addItem(final String title, final String contentTypeId, final BasicMimeTypeDTO mimeType,
final ContentStatus status, final StateToken stateToken, final StateToken parentStateToken,
- final AccessRights rights) {
+ final AccessRights rights, final long modifiedOn) {
final Object icon = getIcon(stateToken, contentTypeId, mimeType);
final String tooltip = getTooltip(stateToken, mimeType);
final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken),
- genId(parentStateToken), icon, title, tooltip, status, stateToken,
+ genId(parentStateToken), icon, title, tooltip, status, stateToken, modifiedOn,
capabilitiesRegistry.isDragable(contentTypeId) && rights.isAdministrable(),
capabilitiesRegistry.isDropable(contentTypeId) && rights.isAdministrable(),
actionsRegistry.getCurrentActions(stateToken, contentTypeId, session.isLogged(), rights,
@@ -155,12 +157,13 @@
addItem(childFolder.getName(), childFolder.getTypeId(), null, ContentStatus.publishedOnline,
childFolder.getStateToken(),
childFolder.getStateToken().copy().setFolder(childFolder.getParentFolderId()),
- containerRights);
+ containerRights, FolderViewerView.NO_DATE);
}
// Other contents (docs, etc)
for (final ContentSimpleDTO content : container.getContents()) {
addItem(content.getTitle(), content.getTypeId(), content.getMimeType(), content.getStatus(),
- content.getStateToken(), content.getStateToken().copy().clearDocument(), content.getRights());
+ content.getStateToken(), content.getStateToken().copy().clearDocument(),
+ content.getRights(), content.getModifiedOn());
}
}
}
Modified: trunk/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/src/main/resources/META-INF/persistence.xml 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/resources/META-INF/persistence.xml 2011-05-05 14:46:37 UTC (rev 1346)
@@ -11,7 +11,6 @@
<!-- src/main/java/cc/kune/domain$ ls -1 *.java | sed 's/.java/<\/class>/g' | sed 's/^/<class>cc.kune.domain./g' -->
<class>cc.kune.domain.AccessLists</class>
<class>cc.kune.domain.BasicMimeType</class>
- <class>cc.kune.domain.Comment</class>
<class>cc.kune.domain.Container</class>
<class>cc.kune.domain.ContainerTranslation</class>
<class>cc.kune.domain.Content</class>
@@ -68,7 +67,6 @@
<!-- JPA entities must be registered here -->
<class>cc.kune.domain.AccessLists</class>
<class>cc.kune.domain.BasicMimeType</class>
- <class>cc.kune.domain.Comment</class>
<class>cc.kune.domain.Container</class>
<class>cc.kune.domain.ContainerTranslation</class>
<class>cc.kune.domain.Content</class>
@@ -121,7 +119,6 @@
<!-- JPA entities must be registered here -->
<class>cc.kune.domain.AccessLists</class>
<class>cc.kune.domain.BasicMimeType</class>
- <class>cc.kune.domain.Comment</class>
<class>cc.kune.domain.Container</class>
<class>cc.kune.domain.ContainerTranslation</class>
<class>cc.kune.domain.Content</class>
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2011-05-05 14:46:37 UTC (rev 1346)
@@ -209,34 +209,6 @@
<class-b>cc.kune.domain.Tag</class-b>
</mapping>
<mapping>
- <class-a> cc.kune.domain.Comment </class-a>
- <class-b> cc.kune.core.shared.dto.CommentDTO </class-b>
- <field>
- <a>author</a>
- <b>author</b>
- <a-hint> cc.kune.domain.User </a-hint>
- <b-hint> cc.kune.core.shared.dto.UserSimpleDTO </b-hint>
- </field>
- <field>
- <a>childs</a>
- <b>childs</b>
- <a-hint> cc.kune.domain.Comment </a-hint>
- <b-hint> cc.kune.core.shared.dto.CommentDTO </b-hint>
- </field>
- <field type="one-way">
- <a get-method="getPositiveVotersCount"> positiveVotersCount </a>
- <b>positiveVotersCount</b>
- </field>
- <field type="one-way">
- <a get-method="getNegativeVotersCount"> negativeVotersCount </a>
- <b>negativeVotersCount</b>
- </field>
- <field type="one-way">
- <a get-method="getAbuseInformersCount"> abuseInformersCount </a>
- <b>abuseInformersCount</b>
- </field>
- </mapping>
- <mapping>
<class-a>cc.kune.core.shared.dto.LinkDTO</class-a>
<class-b>cc.kune.domain.User</class-b>
<field>
Modified: trunk/src/test/java/cc/kune/core/server/TestConstants.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/TestConstants.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/test/java/cc/kune/core/server/TestConstants.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,12 +1,12 @@
package cc.kune.core.server;
public final class TestConstants {
- // test: use memory
- // test_db: use mysql
- // public static final String PERSISTENCE_UNIT = "test_db";
- public static final String PERSISTENCE_UNIT = "test";
- public static final String WAVE_TEST_PROPFILE = "wave-server-testing.properties";
+ // test: use memory
+ // test_db: use mysql
+ // public static final String PERSISTENCE_UNIT = "test_db";
+ public static final String PERSISTENCE_UNIT = "test";
+ public static final String WAVE_TEST_PROPFILE = "wave-server-testing.properties";
- private TestConstants() {
- }
+ private TestConstants() {
+ }
}
Modified: trunk/src/test/java/cc/kune/core/server/access/FinderTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/access/FinderTest.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/test/java/cc/kune/core/server/access/FinderTest.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -22,14 +22,11 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
-import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import cc.kune.core.client.errors.ContentNotFoundException;
import cc.kune.core.server.TestDomainHelper;
-import cc.kune.core.server.access.FinderServiceDefault;
-import cc.kune.core.server.content.CommentManager;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.manager.GroupManager;
@@ -42,147 +39,139 @@
public class FinderTest {
- private GroupManager groupManager;
- private ContainerManager containerManager;
- private ContentManager contentManager;
- private RateManager rateManager;
- private FinderServiceDefault finder;
- private CommentManager commentManager;
+ private ContainerManager containerManager;
+ private ContentManager contentManager;
+ private FinderServiceDefault finder;
+ private GroupManager groupManager;
+ private RateManager rateManager;
- @Test(expected = ContentNotFoundException.class)
- public void contentAndFolderMatch() throws Exception {
- final Content descriptor = new Content();
- final Container container = TestDomainHelper.createFolderWithIdAndToolName(5, "toolName2");
- descriptor.setContainer(container);
- Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
+ @Test(expected = ContentNotFoundException.class)
+ public void contentAndFolderMatch() throws Exception {
+ final Content descriptor = new Content();
+ final Container container = TestDomainHelper.createFolderWithIdAndToolName(5, "toolName2");
+ descriptor.setContainer(container);
+ Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
- finder.getContent(new StateToken("groupShortName", "toolName", "5", "1"), null);
- }
+ finder.getContent(new StateToken("groupShortName", "toolName", "5", "1"), null);
+ }
- @Test(expected = ContentNotFoundException.class)
- public void contentAndGrouplMatch() throws Exception {
- final Content descriptor = new Content();
- final Container container = TestDomainHelper.createFolderWithIdAndGroupAndTool(5, "groupOther", "toolName");
- descriptor.setContainer(container);
- Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
+ @Test(expected = ContentNotFoundException.class)
+ public void contentAndGrouplMatch() throws Exception {
+ final Content descriptor = new Content();
+ final Container container = TestDomainHelper.createFolderWithIdAndGroupAndTool(5, "groupOther",
+ "toolName");
+ descriptor.setContainer(container);
+ Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
- finder.getContent(new StateToken("groupShortName", "toolName", "5", "1"), null);
- }
+ finder.getContent(new StateToken("groupShortName", "toolName", "5", "1"), null);
+ }
- @Test(expected = ContentNotFoundException.class)
- public void contentAndToolMatch() throws Exception {
- final Content descriptor = new Content();
- final Container container = TestDomainHelper.createFolderWithId(1);
- descriptor.setContainer(container);
- Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
+ @Test(expected = ContentNotFoundException.class)
+ public void contentAndToolMatch() throws Exception {
+ final Content descriptor = new Content();
+ final Container container = TestDomainHelper.createFolderWithId(1);
+ descriptor.setContainer(container);
+ Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
- finder.getContent(new StateToken("groupShortName", "toolName", "5", "1"), null);
- }
+ finder.getContent(new StateToken("groupShortName", "toolName", "5", "1"), null);
+ }
- @Before
- public void createSession() {
- this.groupManager = Mockito.mock(GroupManager.class);
- this.containerManager = Mockito.mock(ContainerManager.class);
- this.contentManager = Mockito.mock(ContentManager.class);
- this.rateManager = Mockito.mock(RateManager.class);
- this.commentManager = Mockito.mock(CommentManager.class);
- this.finder = new FinderServiceDefault(groupManager, containerManager, contentManager, rateManager,
- commentManager);
- }
+ @Test
+ public void getGroupDefaultContent() throws Exception {
+ final Group group = new Group();
+ final Content descriptor = new Content();
+ group.setDefaultContent(descriptor);
+ Mockito.when(groupManager.findByShortName("groupShortName")).thenReturn(group);
- @Test
- public void getGroupDefaultContent() throws Exception {
- final Group group = new Group();
- final Content descriptor = new Content();
- group.setDefaultContent(descriptor);
- Mockito.when(groupManager.findByShortName("groupShortName")).thenReturn(group);
+ final Content content = finder.getContent(new StateToken("groupShortName", null, null, null), null);
+ assertSame(descriptor, content);
+ }
- final Content content = finder.getContent(new StateToken("groupShortName", null, null, null), null);
- assertSame(descriptor, content);
- }
+ @Test
+ public void testCompleteToken() throws Exception {
+ final Container container = TestDomainHelper.createFolderWithIdAndGroupAndTool(1, "groupShortName",
+ "toolName");
+ final Content descriptor = new Content();
+ descriptor.setId(1L);
+ descriptor.setContainer(container);
- @Test
- public void testCompleteToken() throws Exception {
- final Container container = TestDomainHelper.createFolderWithIdAndGroupAndTool(1, "groupShortName", "toolName");
- final Content descriptor = new Content();
- descriptor.setId(1L);
- descriptor.setContainer(container);
+ Mockito.when(contentManager.find(2L)).thenReturn(descriptor);
- Mockito.when(contentManager.find(2L)).thenReturn(descriptor);
+ final Content content = finder.getContent(new StateToken("groupShortName", "toolName", "1", "2"),
+ null);
+ assertSame(descriptor, content);
+ }
- final Content content = finder.getContent(new StateToken("groupShortName", "toolName", "1", "2"), null);
- assertSame(descriptor, content);
- }
+ @Test(expected = ContentNotFoundException.class)
+ public void testContainerExistsButContentNotFound() throws Exception {
+ finder.getContent(new StateToken("groupShortName", "toolName", "1", "999"), null);
+ }
- @Test(expected = ContentNotFoundException.class)
- public void testContainerExistsButContentNotFound() throws Exception {
- finder.getContent(new StateToken("groupShortName", "toolName", "1", "999"), null);
- }
+ @Test
+ public void testDefaultGroupContent() throws Exception {
+ final Group userGroup = new Group();
+ final Content descriptor = TestDomainHelper.createDescriptor(1L, "title", "content");
+ userGroup.setDefaultContent(descriptor);
- @Test
- public void testDefaultGroupContent() throws Exception {
- final Group userGroup = new Group();
- final Content descriptor = TestDomainHelper.createDescriptor(1L, "title", "content");
- userGroup.setDefaultContent(descriptor);
+ final Content content = finder.getContent(new StateToken(), userGroup);
+ assertSame(descriptor, content);
+ }
- final Content content = finder.getContent(new StateToken(), userGroup);
- assertSame(descriptor, content);
- }
+ @Test
+ public void testDefaultGroupContentHasDefLicense() throws Exception {
+ final Group userGroup = new Group();
+ final Content descriptor = TestDomainHelper.createDescriptor(1L, "title", "content");
+ userGroup.setDefaultContent(descriptor);
- @Test
- public void testDefaultGroupContentHasDefLicense() throws Exception {
- final Group userGroup = new Group();
- final Content descriptor = TestDomainHelper.createDescriptor(1L, "title", "content");
- userGroup.setDefaultContent(descriptor);
+ final Content content = finder.getContent(new StateToken(), userGroup);
+ assertSame(userGroup.getDefaultLicense(), content.getLicense());
+ }
- final Content content = finder.getContent(new StateToken(), userGroup);
- assertSame(userGroup.getDefaultLicense(), content.getLicense());
- }
+ @Test
+ public void testDefaultUserContent() throws Exception {
+ final Content content = new Content();
+ final Group group = new Group();
+ group.setDefaultContent(content);
+ final Content response = finder.getContent(new StateToken(), group);
+ assertSame(content, response);
+ }
- @Test
- public void testDefaultUserContent() throws Exception {
- final Content content = new Content();
- final Group group = new Group();
- group.setDefaultContent(content);
- final Content response = finder.getContent(new StateToken(), group);
- assertSame(content, response);
- }
+ @Test
+ public void testDocMissing() throws Exception {
+ final Container container = new Container();
+ Mockito.when(containerManager.find(1L)).thenReturn(container);
- @Test
- public void testDocMissing() throws Exception {
- final Container container = new Container();
- Mockito.when(containerManager.find(1L)).thenReturn(container);
+ final Content content = finder.getContent(new StateToken("groupShortName", "toolName", "1", null),
+ null);
+ assertNotNull(content);
+ assertSame(container, content.getContainer());
+ }
- final Content content = finder.getContent(new StateToken("groupShortName", "toolName", "1", null), null);
- assertNotNull(content);
- assertSame(container, content.getContainer());
- }
+ @Test
+ public void testFolderMissing() throws Exception {
+ final Group group = new Group();
+ final ToolConfiguration config = group.setToolConfig("toolName", new ToolConfiguration());
+ final Container container = config.setRoot(new Container());
+ Mockito.when(groupManager.findByShortName("groupShortName")).thenReturn(group);
- @Test
- public void testFolderMissing() throws Exception {
- final Group group = new Group();
- final ToolConfiguration config = group.setToolConfig("toolName", new ToolConfiguration());
- final Container container = config.setRoot(new Container());
- Mockito.when(groupManager.findByShortName("groupShortName")).thenReturn(group);
+ final StateToken token = new StateToken("groupShortName", "toolName", null, null);
+ final Content content = finder.getContent(token, null);
+ assertSame(container, content.getContainer());
+ }
- final StateToken token = new StateToken("groupShortName", "toolName", null, null);
- final Content content = finder.getContent(token, null);
- assertSame(container, content.getContainer());
- }
+ @Test(expected = ContentNotFoundException.class)
+ public void testIds() throws Exception {
+ final Content descriptor = new Content();
+ final Container container = TestDomainHelper.createFolderWithIdAndToolName(5, "toolName");
+ descriptor.setContainer(container);
+ Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
- @Test(expected = ContentNotFoundException.class)
- public void testIds() throws Exception {
- final Content descriptor = new Content();
- final Container container = TestDomainHelper.createFolderWithIdAndToolName(5, "toolName");
- descriptor.setContainer(container);
- Mockito.when(contentManager.find(1L)).thenReturn(descriptor);
+ finder.getContent(new StateToken("groupShortName", "toolName", "5", "1a"), null);
+ }
- finder.getContent(new StateToken("groupShortName", "toolName", "5", "1a"), null);
- }
+ @Test(expected = ContentNotFoundException.class)
+ public void voyAJoder() throws Exception {
+ finder.getContent(new StateToken(null, "toolName", "1", "2"), null);
+ }
- @Test(expected = ContentNotFoundException.class)
- public void voyAJoder() throws Exception {
- finder.getContent(new StateToken(null, "toolName", "1", "2"), null);
- }
-
}
Deleted: trunk/src/test/java/cc/kune/core/server/integration/content/ContentCommentServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/content/ContentCommentServiceTest.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentCommentServiceTest.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -1,61 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.server.integration.content;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import cc.kune.core.client.errors.DefaultException;
-import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.integration.IntegrationTestHelper;
-import cc.kune.core.shared.dto.CommentDTO;
-import cc.kune.core.shared.dto.StateContainerDTO;
-
-public class ContentCommentServiceTest extends ContentServiceIntegrationTest {
-
- private StateContainerDTO defaultContent;
-
- @Test
- public void commentDefaultContent() throws Exception {
- doLogin();
- final String commentText = "Some comment";
- final CommentDTO commentDTO = contentService.addComment(session.getHash(), defaultContent.getStateToken(),
- commentText);
- assertEquals(commentDTO.getText(), commentText);
- assertEquals(commentDTO.getPositiveVotersCount(), 0);
- assertEquals(commentDTO.getNegativeVotersCount(), 0);
- assertEquals(commentDTO.getAbuseInformersCount(), 0);
- }
-
- @Test(expected = UserMustBeLoggedException.class)
- public void commentWithoutLoginMustFail() throws DefaultException {
- final String commentText = "Some comment";
- contentService.addComment(session.getHash(), defaultContent.getStateToken(), commentText);
- }
-
- @Before
- public void init() throws Exception {
- new IntegrationTestHelper(this);
- defaultContent = getSiteDefaultContent();
- }
-
-}
Modified: trunk/src/test/java/cc/kune/core/server/manager/ContentManagerTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/ContentManagerTest.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/test/java/cc/kune/core/server/manager/ContentManagerTest.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -33,87 +33,86 @@
public class ContentManagerTest extends PersistencePreLoadedDataTest {
- private static final String BODY = "body";
- private static final String MIMETYPE = "image";
- private static final String TITLE = "title";
+ private static final String BODY = "body";
+ private static final String MIMETYPE = "image";
+ private static final String TITLE = "title";
- private void createContent() {
- final Content cnt = contentManager.createContent(TITLE, BODY, user, container, TYPE_UPLOADEDFILE);
- persist(cnt);
- }
+ private void createContent() {
+ final Content cnt = contentManager.createContent(TITLE, BODY, user, container, TYPE_UPLOADEDFILE);
+ persist(cnt);
+ }
- private void createContentWithMimeAndCheck(final String mimetype) {
- final Content cnt = contentManager.createContent(TITLE, BODY, user, container, TYPE_UPLOADEDFILE);
- cnt.setMimeType(new BasicMimeType(mimetype));
- persist(cnt);
- final Content newCnt = contentManager.find(cnt.getId());
- assertEquals(mimetype, newCnt.getMimeType().toString());
- }
+ private void createContentWithMimeAndCheck(final String mimetype) {
+ final Content cnt = contentManager.createContent(TITLE, BODY, user, container, TYPE_UPLOADEDFILE);
+ cnt.setMimeType(new BasicMimeType(mimetype));
+ persist(cnt);
+ final Content newCnt = contentManager.find(cnt.getId());
+ assertEquals(mimetype, newCnt.getMimeType().toString());
+ }
- @Ignore
- @Test
- public void testBasicBodySearch() {
- createContent();
- final SearchResult<Content> search = contentManager.search(BODY);
- contentManager.reIndex();
- assertEquals(1, search.getSize());
- }
+ @Test
+ public void testBasicBodySearch() {
+ createContent();
+ final SearchResult<Content> search = contentManager.search(BODY);
+ contentManager.reIndex();
+ assertEquals(1, search.getSize());
+ }
- @Test
- public void testBasicMimePersist() {
- final String mimetype = "application/pdf";
- createContentWithMimeAndCheck(mimetype);
- }
+ @Test
+ public void testBasicMimePersist() {
+ final String mimetype = "application/pdf";
+ createContentWithMimeAndCheck(mimetype);
+ }
- @Test
- public void testBasicMimePersistWithoutSubtype() {
- final String mimetype = "application";
- createContentWithMimeAndCheck(mimetype);
- }
+ @Test
+ public void testBasicMimePersistWithoutSubtype() {
+ final String mimetype = "application";
+ createContentWithMimeAndCheck(mimetype);
+ }
- @Test
- public void testBasicMimeSearchWithQueriesAndFields() {
- createContentWithMimeAndCheck(MIMETYPE + "/png");
- contentManager.reIndex();
- final SearchResult<Content> search = contentManager.search(new String[] { MIMETYPE },
- new String[] { "mimeType.mimetype" }, 0, 10);
- assertEquals(1, search.getSize());
- }
+ @Test
+ public void testBasicMimeSearchWithQueriesAndFields() {
+ createContentWithMimeAndCheck(MIMETYPE + "/png");
+ contentManager.reIndex();
+ final SearchResult<Content> search = contentManager.search(new String[] { MIMETYPE },
+ new String[] { "mimeType.mimetype" }, 0, 10);
+ assertEquals(1, search.getSize());
+ }
- @Test
- public void testBasicSearchWithQueriesAndFields() {
- createContentWithMimeAndCheck(MIMETYPE);
- final SearchResult<Content> search = contentManager.search(new String[] { BODY },
- new String[] { "lastRevision.body" }, 0, 10);
- contentManager.reIndex();
- assertEquals(1, search.getSize());
- }
+ @Test
+ public void testBasicSearchWithQueriesAndFields() {
+ createContentWithMimeAndCheck(MIMETYPE);
+ final SearchResult<Content> search = contentManager.search(new String[] { BODY },
+ new String[] { "lastRevision.body" }, 0, 10);
+ contentManager.reIndex();
+ assertEquals(1, search.getSize());
+ }
- @Test
- public void testBasicTitleSearch() {
- createContent();
- final SearchResult<Content> search = contentManager.search(TITLE);
- contentManager.reIndex();
- assertEquals(1, search.getSize());
- }
+ @Test
+ public void testBasicTitleSearch() {
+ createContent();
+ final SearchResult<Content> search = contentManager.search(TITLE);
+ contentManager.reIndex();
+ assertEquals(1, search.getSize());
+ }
- @Ignore
- @Test
- public void testtMimeSearch() {
- createContentWithMimeAndCheck(MIMETYPE + "/png");
- contentManager.reIndex();
- final SearchResult<Content> search = contentManager.searchMime(BODY, 0, 10, "asb", MIMETYPE);
- assertEquals(1, search.getSize());
- }
+ @Ignore
+ @Test
+ public void testtMimeSearch() {
+ createContentWithMimeAndCheck(MIMETYPE + "/png");
+ contentManager.reIndex();
+ final SearchResult<Content> search = contentManager.searchMime(BODY, 0, 10, "asb", MIMETYPE);
+ assertEquals(1, search.getSize());
+ }
- /**
- * This normally fails with mysql (not configured for utf-8), see the
- * INSTALL mysql section
- */
- @Test
- public void testUTF8Persist() {
- final Content cnt = contentManager.createContent("汉语/漢語", "汉语/漢語", user, container, TYPE_DOCUMENT);
- final Content newCnt = contentManager.find(cnt.getId());
- assertEquals("汉语/漢語", newCnt.getTitle());
- }
+ /**
+ * This normally fails with mysql (not configured for utf-8), see the INSTALL
+ * mysql section
+ */
+ @Test
+ public void testUTF8Persist() {
+ final Content cnt = contentManager.createContent("汉语/漢語", "汉语/漢語", user, container, TYPE_DOCUMENT);
+ final Content newCnt = contentManager.find(cnt.getId());
+ assertEquals("汉语/漢語", newCnt.getTitle());
+ }
}
Modified: trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java 2011-05-05 03:41:52 UTC (rev 1345)
+++ trunk/src/test/java/cc/kune/core/server/mapper/MapperTest.java 2011-05-05 14:46:37 UTC (rev 1346)
@@ -39,7 +39,6 @@
import cc.kune.core.shared.domain.UserSNetVisibility;
import cc.kune.core.shared.domain.utils.AccessRights;
import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.CommentDTO;
import cc.kune.core.shared.dto.ContainerDTO;
import cc.kune.core.shared.dto.ContainerSimpleDTO;
import cc.kune.core.shared.dto.ContentSimpleDTO;
@@ -50,7 +49,6 @@
import cc.kune.core.shared.dto.SocialNetworkDataDTO;
import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.domain.BasicMimeType;
-import cc.kune.domain.Comment;
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
@@ -146,41 +144,6 @@
}
@Test
- public void testCommentMapper() {
- final Content d = createDefContent();
- final Comment comment = new Comment();
- comment.setContent(d);
- comment.setText("Some text");
- final User user = new User();
- comment.addPositiveVoter(user);
- comment.addPositiveVoter(user);
- CommentDTO commentDTO = mapper.map(comment, CommentDTO.class);
- assertEquals(0, commentDTO.getNegativeVotersCount());
- assertEquals(0, commentDTO.getAbuseInformersCount());
- assertEquals(1, commentDTO.getPositiveVotersCount());
- comment.addNegativeVoter(user);
- comment.addNegativeVoter(user);
- commentDTO = mapper.map(comment, CommentDTO.class);
- assertEquals(1, commentDTO.getNegativeVotersCount());
- assertEquals(0, commentDTO.getAbuseInformersCount());
- assertEquals(0, commentDTO.getPositiveVotersCount());
- comment.addAbuseInformer(user);
- comment.addAbuseInformer(user);
- commentDTO = mapper.map(comment, CommentDTO.class);
- assertEquals(1, commentDTO.getNegativeVotersCount());
- assertEquals(1, commentDTO.getAbuseInformersCount());
- assertEquals(0, commentDTO.getPositiveVotersCount());
- final Comment childComment = new Comment();
- childComment.setContent(d);
- childComment.setParent(comment);
- comment.getChilds().add(childComment);
- commentDTO = mapper.map(comment, CommentDTO.class);
- final CommentDTO childCommentDTO = mapper.map(childComment, CommentDTO.class);
- assertEquals(1, comment.getChilds().size());
- assertEquals(commentDTO, childCommentDTO.getParent());
- }
-
- @Test
public void testContentDescriptorMapping() {
final Content d = createDefContent();
final StateToken expectedToken = new StateToken(TESTGROUPSHORTNAME, TESTTOOL, "1", "1");
More information about the kune-commits
mailing list