Index: lams_central/conf/language/lams/ApplicationResources.properties
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v
diff -u -r1.52 -r1.53
--- lams_central/conf/language/lams/ApplicationResources.properties 30 Jan 2009 05:59:52 -0000 1.52
+++ lams_central/conf/language/lams/ApplicationResources.properties 3 Feb 2009 05:47:41 -0000 1.53
@@ -252,5 +252,5 @@
msg.planner.not.saved =Are you sure you want to close? If you have not saved the design, changes you have made will be lost.
label.planner.editing.advice=Editing advice
-
+public.folder=Public Folder
#======= End labels: Exported 222 labels for en AU =====
Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources_en_AU.properties,v
diff -u -r1.49 -r1.50
--- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 30 Jan 2009 05:59:52 -0000 1.49
+++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 3 Feb 2009 05:47:41 -0000 1.50
@@ -252,5 +252,5 @@
msg.planner.not.saved =Are you sure you want to close? If you have not saved the design, changes you have made will be lost.
label.planner.editing.advice=Editing advice
-
+public.folder=Public Folder
#======= End labels: Exported 222 labels for en AU =====
Index: lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java,v
diff -u -r1.21 -r1.22
--- lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 3 Jan 2008 01:31:51 -0000 1.21
+++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 3 Feb 2009 05:47:41 -0000 1.22
@@ -291,8 +291,18 @@
* @throws IOException
*/
public FolderContentDTO getUserWorkspaceFolder(Integer userID)throws IOException;
-
+
/**
+ * This method returns the public workspace folder for the server.
+ *
+ * @param userID The user_id
of the user for whom the
+ * folders have to fetched
+ * @return FolderContentDTO for the public workspace folder
+ * @throws IOException
+ */
+ public FolderContentDTO getPublicWorkspaceFolder(Integer userID) throws IOException;
+
+ /**
* This method renames the workspaceFolder/learning design with the
* given resourceID
to newName
.
*
Index: lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java,v
diff -u -r1.49 -r1.50
--- lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 15 Aug 2008 04:37:41 -0000 1.49
+++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 3 Feb 2009 05:47:41 -0000 1.50
@@ -381,6 +381,8 @@
} else {
if ( WorkspaceFolder.RUN_SEQUENCES.equals(workspaceFolder.getWorkspaceFolderType()) ) {
permission = WorkspaceFolder.READ_ACCESS;
+ } else if( WorkspaceFolder.PUBLIC_SEQUENCES.equals(workspaceFolder.getWorkspaceFolderType()) ) {
+ permission = WorkspaceFolder.MEMBERSHIP_ACCESS;
} else if (workspaceFolder.getUserID().equals(user.getUserId())) {
permission = WorkspaceFolder.OWNER_ACCESS;
} else if (isSysAuthorAdmin(user)){
@@ -1194,6 +1196,31 @@
return null;
}
+
+ /**
+ * (non-Javadoc)
+ * @see org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService#getPublicWorkspaceFolder(java.lang.Integer)
+ */
+ public FolderContentDTO getPublicWorkspaceFolder(Integer userID) throws IOException {
+ User user = (User)baseDAO.find(User.class,userID);
+
+ if (user != null) {
+ WorkspaceFolder publicFolder = null;
+ List list = baseDAO.findByProperty(WorkspaceFolder.class, "workspaceFolderType", WorkspaceFolder.PUBLIC_SEQUENCES);
+
+ if (list != null && list.size() > 0) {
+ publicFolder = (WorkspaceFolder) list.get(0);
+ }
+
+ if(publicFolder != null) {
+ publicFolder.setName(messageService.getMessage("public.folder"));
+ Integer permissions = getPermissions(publicFolder, user);
+ return new FolderContentDTO(publicFolder, permissions);
+ }
+ }
+
+ return null;
+ }
/**
* This a utility method that checks whether user has write access. He can
Index: lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java,v
diff -u -r1.22 -r1.23
--- lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java 2 Nov 2006 01:32:35 -0000 1.22
+++ lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java 3 Feb 2009 05:47:41 -0000 1.23
@@ -221,7 +221,7 @@
if ( BOOTSTRAP_FOLDER_ID.equals(folderID )) {
MessageService msgService = workspaceManagementService.getMessageService();
- // return back the dummy org DTO and the user's workspace folder
+ // return back the dummy org DTO, the user's workspace folder and public folder
Vector folders = new Vector();
FolderContentDTO userFolder = workspaceManagementService.getUserWorkspaceFolder(userID);
if ( userFolder != null )
@@ -235,6 +235,10 @@
folders.add(dummyOrgFolder);
+ FolderContentDTO publicFolder = workspaceManagementService.getPublicWorkspaceFolder(userID);
+ if ( publicFolder != null )
+ folders.add(publicFolder);
+
packet = createFolderContentPacket(null, BOOTSTRAP_FOLDER_ID, folders);
} else if ( ORG_FOLDER_ID.equals(folderID) ) {
Index: lams_central/web/lams_authoring.swf
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/lams_authoring.swf,v
diff -u -r1.502 -r1.503
Binary files differ
Index: lams_central/web/lams_authoring_library.swf
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/lams_authoring_library.swf,v
diff -u -r1.402 -r1.403
Binary files differ
Index: lams_common/db/sql/insert_lams_users.sql
===================================================================
RCS file: /usr/local/cvsroot/lams_common/db/sql/insert_lams_users.sql,v
diff -u -r1.1 -r1.2
--- lams_common/db/sql/insert_lams_users.sql 23 Apr 2007 00:55:02 -0000 1.1
+++ lams_common/db/sql/insert_lams_users.sql 3 Feb 2009 05:48:01 -0000 1.2
@@ -18,6 +18,7 @@
insert into lams_workspace (workspace_id, name, default_fld_id) values(8,'Four Test',8);
insert into lams_workspace (workspace_id, name, default_fld_id, def_run_seq_fld_id) values(50,'Moodle Test',40,41);
insert into lams_workspace (workspace_id, name, default_fld_id) values(51,'System Administrator',45);
+insert into lams_workspace (workspace_id, name, default_fld_id) values(52,'Public Folder',46);
insert into lams_workspace_folder (workspace_folder_id,parent_folder_id,name,user_id,create_date_time,last_modified_date_time,lams_workspace_folder_type_id)
values(1,null,'ROOT',1,'20041223','20041223',1);
@@ -58,6 +59,9 @@
insert into lams_workspace_folder (workspace_folder_id,parent_folder_id,name,user_id,create_date_time,last_modified_date_time,lams_workspace_folder_type_id)
values(45,null,'System Administrator',1,'20061101','20061101',1);
+insert into lams_workspace_folder (workspace_folder_id,parent_folder_id,name,user_id,create_date_time,last_modified_date_time,lams_workspace_folder_type_id)
+values(46,1,'Public Folder',1,'20041223','20041223',3);
+
insert into lams_wkspc_wkspc_folder (id, workspace_id, workspace_folder_id) values (1, 1,1);
insert into lams_wkspc_wkspc_folder (id, workspace_id, workspace_folder_id) values (2, 2,2);
insert into lams_wkspc_wkspc_folder (id, workspace_id, workspace_folder_id) values (3, 2,22);
@@ -70,6 +74,7 @@
insert into lams_wkspc_wkspc_folder (id, workspace_id, workspace_folder_id) values (10, 8,8);
insert into lams_wkspc_wkspc_folder (id, workspace_id, workspace_folder_id) values (11, 50,40);
insert into lams_wkspc_wkspc_folder (id, workspace_id, workspace_folder_id) values (12, 51,45);
+insert into lams_wkspc_wkspc_folder (id, workspace_id, workspace_folder_id) values (13, 52,46);
INSERT INTO lams_organisation (organisation_id, name, code, description, parent_organisation_id, organisation_type_id, create_date, created_by, workspace_id, locale_id, organisation_state_id)
VALUES (1, 'Root', null, 'Root Organisation',null,1,NOW(),1,1,1,1);
@@ -85,8 +90,7 @@
VALUES (6, 'Tutorial Group B', 'TUTB', 'Tutorial Group B',4,3,NOW(),1,null,2,1);
INSERT INTO lams_organisation (organisation_id, name, code, description, parent_organisation_id, organisation_type_id, create_date, created_by, workspace_id, locale_id, organisation_state_id)
VALUES (7, 'Moodle', 'Moodle', 'Moodle Test',1,2,NOW(),1,50,1,2);
-
-
+
-- users
INSERT INTO lams_user (user_id,login,password,title,first_name,last_name,address_line_1,address_line_2,address_line_3,
city,state,country,day_phone,evening_phone,mobile_phone,fax,email,
@@ -170,7 +174,7 @@
'0211111113','test4@xx.os',
0,'20041223',1,8,1,1,2);
---- sysadmin only belongs to root
+--- sysadmin only belongs to root and public
INSERT INTO lams_user_organisation (user_organisation_id, organisation_id, user_id) VALUES (1, 1, 1);
--- all other users belong to Playpen
Index: lams_common/db/sql/insert_types_data.sql
===================================================================
RCS file: /usr/local/cvsroot/lams_common/db/sql/insert_types_data.sql,v
diff -u -r1.83 -r1.84
--- lams_common/db/sql/insert_types_data.sql 7 Jan 2009 02:25:51 -0000 1.83
+++ lams_common/db/sql/insert_types_data.sql 3 Feb 2009 05:48:01 -0000 1.84
@@ -113,6 +113,7 @@
INSERT into lams_workspace_folder_type VALUES (1, 'NORMAL');
INSERT into lams_workspace_folder_type VALUES (2, 'RUN SEQUENCES');
+INSERT into lams_workspace_folder_type VALUES (3, 'PUBLIC SEQUENCES');
INSERT INTO lams_authentication_method VALUES (1, 1, 'LAMS-Database');
INSERT INTO lams_authentication_method VALUES (2, 2, 'Oxford-WebAuth');
Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/WorkspaceFolder.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/usermanagement/WorkspaceFolder.java,v
diff -u -r1.18 -r1.19
--- lams_common/src/java/org/lamsfoundation/lams/usermanagement/WorkspaceFolder.java 1 May 2008 04:09:33 -0000 1.18
+++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/WorkspaceFolder.java 3 Feb 2009 05:47:42 -0000 1.19
@@ -46,6 +46,7 @@
/******************************************************************/
public static final Integer NORMAL = new Integer(1);
public static final Integer RUN_SEQUENCES = new Integer(2);
+ public static final Integer PUBLIC_SEQUENCES = new Integer(3);
/******************************************************************/
/** static final variables indicating the permissions on the workspaceFolder */
@@ -55,7 +56,7 @@
public static final Integer OWNER_ACCESS = new Integer(3);
public static final Integer NO_ACCESS = new Integer(4);
/******************************************************************/
-
+
/** identifier field */
private Integer workspaceFolderId;
Index: lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java,v
diff -u -r1.12 -r1.13
--- lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java 29 Jan 2009 02:35:15 -0000 1.12
+++ lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java 3 Feb 2009 05:47:42 -0000 1.13
@@ -48,6 +48,7 @@
public Date lastModifiedDateTime;
public String formattedLastModifiedDateTime;
public String resourceType;
+ public Long resourceTypeID;
public Long resourceID;
public Integer permissionCode;
public Vector versionDetails;
@@ -96,6 +97,7 @@
this.lastModifiedDateTime = workspaceFolder.getLastModifiedDate();
this.formattedLastModifiedDateTime = formatLastModifiedDateTime();
this.resourceType = FOLDER;
+ this.resourceTypeID = new Long(workspaceFolder.getWorkspaceFolderType().intValue());
this.resourceID = new Long(workspaceFolder.getWorkspaceFolderId().intValue());
this.permissionCode = permissionCode;
this.licenseID = null;
@@ -169,6 +171,12 @@
return resourceType!=null?resourceType:WDDXTAGS.STRING_NULL_VALUE;
}
/**
+ * @return Returns the resourceTypeID.
+ */
+ public Long getResourceTypeID() {
+ return resourceTypeID!=null?resourceTypeID:WDDXTAGS.NUMERIC_NULL_VALUE_LONG;
+ }
+ /**
* @return Returns the versionDetails.
*/
public Vector getVersionDetails() {
Index: lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/Workspace.as
===================================================================
RCS file: /usr/local/cvsroot/lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/Workspace.as,v
diff -u -r1.4 -r1.5
--- lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/Workspace.as 21 Oct 2008 03:08:58 -0000 1.4
+++ lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/Workspace.as 3 Feb 2009 05:48:10 -0000 1.5
@@ -43,6 +43,10 @@
public static var MODE_READONLY:String = "READONLY";
public static var MODE_INSERT:String = "INSERT";
+ public static var NORMAL_TYPE:Number = 1;
+ public static var RUN_SEQ_TYPE:Number = 2;
+ public static var PUBLIC_SEQ_TYPE:Number = 3;
+
//Model
private var workspaceModel:WorkspaceModel;
Index: lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as
===================================================================
RCS file: /usr/local/cvsroot/lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as,v
diff -u -r1.3 -r1.4
--- lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as 21 Oct 2008 03:08:58 -0000 1.3
+++ lams_flash/src/common/flash/org/lamsfoundation/lams/common/ws/WorkspaceController.as 3 Feb 2009 05:48:10 -0000 1.4
@@ -270,8 +270,12 @@
_global.breakpoint();
if(tgt.indexOf("copy_btn") != -1){
- _workspaceModel.setClipboardItem(snode.attributes.data);
+ if(isUserPrivateFolder(snode) || isPublicFolder(snode)) { clearBusy(); return; }
+
+ if(!snodeData.readOnly)
+ _workspaceModel.setClipboardItem(snode.attributes.data);
+
}else if(tgt.indexOf("paste_btn") != -1){
var itemToPaste = _workspaceModel.getClipboardItem();
if(itemToPaste != null){
@@ -304,7 +308,7 @@
}else if(tgt.indexOf("delete_btn") != -1){
- if(isUserPrivateFolder(snode)) { LFMessage.showMessageAlert(Dictionary.getValue('ws_no_permission'),null,null); clearBusy(); return; }
+ if(isUserPrivateFolder(snode) || isPublicFolder(snode)) { LFMessage.showMessageAlert(Dictionary.getValue('ws_no_permission'),null,null); clearBusy(); return; }
var snodeData = workspaceDialogue.treeview.selectedNode.attributes.data;
@@ -342,7 +346,7 @@
}else if(tgt.indexOf("rename_btn") != -1){
//check we can rename a folder here
- if(isUserPrivateFolder(snode)) { LFMessage.showMessageAlert(Dictionary.getValue('ws_no_permission'),null,null); clearBusy(); return; }
+ if(isUserPrivateFolder(snode) || isPublicFolder(snode)) { LFMessage.showMessageAlert(Dictionary.getValue('ws_no_permission'),null,null); clearBusy(); return; }
var snodeData = workspaceDialogue.treeview.selectedNode.attributes.data;
if(snodeData != null){
@@ -417,6 +421,20 @@
}
}
+ /**
+ * Determine if node is representing the public folder
+ *
+ * @param snode Node to check
+ * @return
+ */
+ private function isPublicFolder(snode:XMLNode) {
+ if(_workspaceModel.getWorkspaceResource(_workspaceModel.RT_FOLDER + "_" + WorkspaceModel.ROOT_VFOLDER).lastChild == snode && snode.attributes.data.resourceTypeID == Workspace.PUBLIC_SEQ_TYPE) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
public function setBusy(){
_isBusy = true;