r1559 - in xwiki-apps/gelc/gelcv1/trunk: . gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets

Ludovic Dubost ludovic at users.forge.objectweb.org
Wed Nov 15 02:06:04 CET 2006


Author: ludovic
Date: 2006-11-15 02:05:27 +0100 (Wed, 15 Nov 2006)
New Revision: 1559

Modified:
   xwiki-apps/gelc/gelcv1/trunk/gelc.iws
   xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetConstant.java
   xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetManagerPlugin.java
Log:
Fix JIRA CURRIKI-86 rights constants which have changed and broke rights assignement
Fix saving of asset by an admin which stole rights from asset owner

Modified: xwiki-apps/gelc/gelcv1/trunk/gelc.iws
===================================================================
--- xwiki-apps/gelc/gelcv1/trunk/gelc.iws	2006-11-14 22:43:29 UTC (rev 1558)
+++ xwiki-apps/gelc/gelcv1/trunk/gelc.iws	2006-11-15 01:05:27 UTC (rev 1559)
@@ -185,7 +185,7 @@
       <file leaf-file-name="DateClass.java" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/xwiki/core/src/main/java/com/xpn/xwiki/objects/classes/DateClass.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="166" column="21" selection-start="5195" selection-end="5195" vertical-scroll-proportion="0.021683674">
+            <state line="166" column="21" selection-start="5195" selection-end="5195" vertical-scroll-proportion="0.030797102">
               <folding />
             </state>
           </provider>
@@ -194,46 +194,48 @@
       <file leaf-file-name="calendar.js" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/xwiki/web/standard/src/main/webapp/yui/calendar/calendar.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="1028" column="63" selection-start="34119" selection-end="34119" vertical-scroll-proportion="0.022106633">
+            <state line="1028" column="63" selection-start="34119" selection-end="34119" vertical-scroll-proportion="0.031657357">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="AssetManagerPlugin.java" pinned="false" current="false" current-in-tab="false">
+      <file leaf-file-name="AssetManagerPlugin.java" pinned="false" current="true" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetManagerPlugin.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="542" column="16" selection-start="21827" selection-end="21827" vertical-scroll-proportion="0.55396616">
+            <state line="71" column="8" selection-start="2402" selection-end="2402" vertical-scroll-proportion="0.031657357">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
+      <file leaf-file-name="AssetConstant.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetConstant.java">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="64" column="66" selection-start="2970" selection-end="2970" vertical-scroll-proportion="0.6331471">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
       <file leaf-file-name="xwiki.cfg" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/xwiki/web/standard/src/main/webapp/WEB-INF/xwiki.cfg">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="76" column="0" selection-start="3753" selection-end="3753" vertical-scroll-proportion="0.86736023">
+            <state line="76" column="0" selection-start="3753" selection-end="3753" vertical-scroll-proportion="1.2420857">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="xwiki.cfg" pinned="false" current="true" current-in-tab="true">
+      <file leaf-file-name="xwiki.cfg" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/gelc/src/main/web/WEB-INF/xwiki.cfg">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="74" column="51" selection-start="3606" selection-end="3606" vertical-scroll-proportion="0.8790637">
+            <state line="52" column="29" selection-start="2757" selection-end="2757" vertical-scroll-proportion="0.5623836">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="calrt.gif" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/xwiki/web/standard/src/main/webapp/yui/calendar/assets/calrt.gif">
-          <provider selected="true" editor-type-id="images">
-            <state />
-          </provider>
-        </entry>
-      </file>
       <file leaf-file-name="calx.gif" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/xwiki/web/standard/src/main/webapp/yui/calendar/assets/calx.gif">
           <provider selected="true" editor-type-id="images">
@@ -262,7 +264,7 @@
       <file leaf-file-name="DateMetaClass.java" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/xwiki/core/src/main/java/com/xpn/xwiki/objects/meta/DateMetaClass.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="55" column="34" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.55739796">
+            <state line="55" column="34" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.7916667">
               <folding />
             </state>
           </provider>
@@ -905,7 +907,7 @@
     </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="1" y="1" width="1678" height="954" extended-state="0" />
+    <frame x="1" y="1" width="1678" height="954" extended-state="1" />
     <editor active="true" />
     <layout>
       <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
@@ -914,9 +916,9 @@
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32928178" order="7" />
       <window_info id="Checkstyle" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33024693" order="0" />
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.44675642" order="1" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39412484" order="1" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="1" />
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2753978" order="8" />
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2753978" order="8" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="6" />
       <window_info id="Profile" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
       <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
@@ -1019,13 +1021,6 @@
     <option name="myLastEditedConfigurable" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/gelc/src/main/web/META-INF/context.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="1" column="16" selection-start="55" selection-end="55" vertical-scroll-proportion="0.029565217">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/gelcplugins/src/main/java/org/outerj/daisy/textextraction/impl/MSPowerPointTextExtractor.java">
       <provider selected="true" editor-type-id="text-editor">
         <state line="10" column="37" selection-start="245" selection-end="245" vertical-scroll-proportion="0.15525115">
@@ -1080,46 +1075,53 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/xwiki/core/src/main/java/com/xpn/xwiki/objects/meta/DateMetaClass.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="55" column="34" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.55739796">
+        <state line="55" column="34" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.7916667">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/xwiki/core/src/main/java/com/xpn/xwiki/objects/classes/DateClass.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="166" column="21" selection-start="5195" selection-end="5195" vertical-scroll-proportion="0.021683674">
+        <state line="166" column="21" selection-start="5195" selection-end="5195" vertical-scroll-proportion="0.030797102">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/xwiki/web/standard/src/main/webapp/yui/calendar/calendar.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="1028" column="63" selection-start="34119" selection-end="34119" vertical-scroll-proportion="0.022106633">
+        <state line="1028" column="63" selection-start="34119" selection-end="34119" vertical-scroll-proportion="0.031657357">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetManagerPlugin.java">
+    <entry file="file://$PROJECT_DIR$/xwiki/web/standard/src/main/webapp/WEB-INF/xwiki.cfg">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="542" column="16" selection-start="21827" selection-end="21827" vertical-scroll-proportion="0.55396616">
+        <state line="76" column="0" selection-start="3753" selection-end="3753" vertical-scroll-proportion="1.2420857">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/xwiki/web/standard/src/main/webapp/WEB-INF/xwiki.cfg">
+    <entry file="file://$PROJECT_DIR$/gelc/src/main/web/WEB-INF/xwiki.cfg">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="76" column="0" selection-start="3753" selection-end="3753" vertical-scroll-proportion="0.86736023">
+        <state line="52" column="29" selection-start="2757" selection-end="2757" vertical-scroll-proportion="0.5623836">
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/gelc/src/main/web/WEB-INF/xwiki.cfg">
+    <entry file="file://$PROJECT_DIR$/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetConstant.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="74" column="51" selection-start="3606" selection-end="3606" vertical-scroll-proportion="0.8790637">
+        <state line="64" column="66" selection-start="2970" selection-end="2970" vertical-scroll-proportion="0.6331471">
           <folding />
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetManagerPlugin.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="71" column="8" selection-start="2402" selection-end="2402" vertical-scroll-proportion="0.031657357">
+          <folding />
+        </state>
+      </provider>
+    </entry>
   </component>
 </project>
 

Modified: xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetConstant.java
===================================================================
--- xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetConstant.java	2006-11-14 22:43:29 UTC (rev 1558)
+++ xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetConstant.java	2006-11-15 01:05:27 UTC (rev 1559)
@@ -55,27 +55,27 @@
     public static final String ASSET_ITEM_DESCRIPTION = "description";
     public static final String ASSET_ITEM_KEYWORDS = "keywords";
     public static final String ASSET_ITEM_AGGREGATION_LEVEL = "aggregation_level";
-    public static final String ASSET_ITEM_AGGREGATION_LEVEL_VALUES = "Asset|Material|Lecture|Unit|Course"; 
+    public static final String ASSET_ITEM_AGGREGATION_LEVEL_VALUES = "choose=Choose from list...|asset=Individual Asset(s)|resource=Learning Resource|lession=Lesson Collection|course=Course/Curriculum"; 
     public static final String ASSET_ITEM_CATEGORY = "category";
     public static final String ASSET_ITEM_FRAMEWORK_ITEMS = "fw_items";
 
     public static final String ASSET_ITEM_STATUS = "status";
-    public static final String ASSET_ITEM_STATUS_VALUES = "Draft|Final|Revised|Unavailable";
+    public static final String ASSET_ITEM_STATUS_VALUES = "choose=Choose from list...|draft=Draft|final=Final|revised=Revised";
 
-    public static final String ASSET_ITEM_LEARNING_RESOURCE_TYPE = "learning_resource_type";
-    public static final String ASSET_ITEM_LEARNING_RESOURCE_TYPE_VALUES = "Animation|Activity|Audio|Collection|Diagram|Exam/Assessment|Exercise|Experiment|Figure|Graph|Graphic/Image|Index|Lecture|Narrative text|Problem statement|Question bank|Question/Item|Questionnaire/Quiz|Self-assessment|Simulation|Slide|Table|Video|Other|Lesson Plan|Content resource|Text|Text book|Book (Other)|Links|Learning Object|Curriculum Package|Zip Archive";
+    public static final String ASSET_ITEM_INSTRUCTIONAL_COMPONENT = "instructional_component";
+    public static final String ASSET_ITEM_INSTRUCTIONAL_COMPONENT_VALUES = "choose=Choose from list...|activity=Activity|animation=Animation/Simulation|application=Application|assesment=Assessment/Test|audio=Audio/Voice/Song|book=Book|textbook=Book Text Book|course=Course/Curriculum|collection=Collection (of related assets)|diagram=Diagram/Illustration|exercise=Exercise/Problem Set|experiment=Experiment/Lab|graph=Graph/Table|graphic=Graphic/Image|index=Index|image=Image/Photograph|learningobject=Learning Object (SCORM)|lessonplan=Lesson Plan|lecture=Lecture|presentation=Presentation/Slide Show|professionaldevelopment=Professional Development|resourceslist=Resource List/Link(s)|text=Text/Notes/Transcript|video=Video|website=Web Site|worksheet=Worksheet/Graphic Organizer|other=Other…";
 
-    public static final String ASSET_ITEM_DIFICULTY = "dificulty";
-    public static final String ASSET_ITEM_DIFICULTY_VALUES = "Very easy|Easy|Medium|Difficult|Very difficult";
+    public static final String ASSET_ITEM_DIFFICULTY = "difficulty";
+    public static final String ASSET_ITEM_DIFFICULTY_VALUES = "Very easy|Easy|Medium|Difficult|Very difficult";
 
     public static final String ASSET_ITEM_EDUCATIONAL_LEVEL = "educational_level";
-    public static final String ASSET_ITEM_EDUCATIONAL_LEVEL_VALUES = "Preschool|Early Elementary|Upper Elementary|Middle School|High School|Higher Ed|Professional";
+    public static final String ASSET_ITEM_EDUCATIONAL_LEVEL_VALUES = "choose=Choose from list...|preschool=Preschool|earlyelementary=Early Elementary|upperelementary=Upper Elementary|middleschool=Middle School|highschool=High School|highered=Higher Ed|professional=Professional|na=NA";
 
     public static final String ASSET_ITEM_RIGHT = "rights";
-    public static final String ASSET_ITEM_RIGHT_PUBLIC = "Public";
-    public static final String ASSET_ITEM_RIGHT_MEMBERS = "Members";
-    public static final String ASSET_ITEM_RIGHT_PRIVATE = "Private";
-    public static final String ASSET_ITEM_RIGHT_VALUES = "Public|Members|Private";
+    public static final String ASSET_ITEM_RIGHT_PUBLIC = "public";
+    public static final String ASSET_ITEM_RIGHT_MEMBERS = "members";
+    public static final String ASSET_ITEM_RIGHT_PRIVATE = "private";
+    public static final String ASSET_ITEM_RIGHT_VALUES = "public=Public: Available to anyone who visits Curriki.|members=Members: Available only to Curriki community members.|private=Private: Available only to you";
     
 
     /**

Modified: xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetManagerPlugin.java
===================================================================
--- xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetManagerPlugin.java	2006-11-14 22:43:29 UTC (rev 1558)
+++ xwiki-apps/gelc/gelcv1/trunk/gelcplugins/src/main/java/org/gelc/xwiki/plugins/assets/AssetManagerPlugin.java	2006-11-15 01:05:27 UTC (rev 1559)
@@ -131,13 +131,13 @@
             asset.set("allow", 1);
         }
         else {
-            asset.set("users", context.getUser());
+            asset.set("users", ("".equals(asset.getCreator())) ? context.getUser() : asset.getCreator());
             asset.set("levels", "view");
             asset.set("allow", 1);            
         }
         obj = asset.newObject("XWiki.XWikiRights");
         asset.use(obj);
-        asset.set("users", context.getUser());
+        asset.set("users", ("".equals(asset.getCreator())) ? context.getUser() : asset.getCreator());
         asset.set("levels", "edit");
         asset.set("allow", 1);
 
@@ -184,7 +184,7 @@
 
         obj = doc.newObject("XWiki.XWikiRights");
         doc.use(obj);
-        doc.set("users", context.getUser());
+        doc.set("users", ("".equals(doc.getCreator())) ? context.getUser() : doc.getCreator());
         doc.set("levels", "edit");
         doc.set("allow", 1);
     }
@@ -417,8 +417,8 @@
         needsUpdate |= bclass.addDBTreeListField(ASSET_ITEM_FRAMEWORK_ITEMS, "Framework Items", 10, true, hql);
         ((DBTreeListClass)bclass.get(ASSET_ITEM_FRAMEWORK_ITEMS)).setPicker(true);        
 
-        needsUpdate |= bclass.addStaticListField(ASSET_ITEM_LEARNING_RESOURCE_TYPE, "Learnign resource Type", ASSET_ITEM_LEARNING_RESOURCE_TYPE_VALUES);
-        needsUpdate |= bclass.addStaticListField(ASSET_ITEM_DIFICULTY, "Dificulty", ASSET_ITEM_DIFICULTY_VALUES);
+        needsUpdate |= bclass.addStaticListField(ASSET_ITEM_INSTRUCTIONAL_COMPONENT, "Instructional Component", ASSET_ITEM_INSTRUCTIONAL_COMPONENT_VALUES);
+        // needsUpdate |= bclass.addStaticListField(ASSET_ITEM_DIFFICULTY, "Difficulty", ASSET_ITEM_DIFICULTY_VALUES);
         needsUpdate |= bclass.addStaticListField(ASSET_ITEM_EDUCATIONAL_LEVEL, "Educational Level", ASSET_ITEM_EDUCATIONAL_LEVEL_VALUES);
         needsUpdate |= bclass.addStaticListField(ASSET_ITEM_RIGHT, "Right", ASSET_ITEM_RIGHT_VALUES);
 





More information about the Xwiki-notifications mailing list