Index: lams_build/lib/lams/lams-contentrepository.jar
===================================================================
RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams-contentrepository.jar,v
diff -u -r1.24 -r1.25
Binary files differ
Index: lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveAction.java,v
diff -u -r1.3 -r1.4
--- lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveAction.java 24 Aug 2006 06:15:43 -0000 1.3
+++ lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveAction.java 6 Sep 2006 01:29:26 -0000 1.4
@@ -85,6 +85,8 @@
String fileName = file.getFileName();
log.debug("got file: "+fileName+" of type: "+file.getContentType()+" with size: "+file.getFileSize());
+ User user = (User)getService().getUserByLogin(request.getRemoteUser());
+
// check if file is an image using the MIME content type
String mediaType = file.getContentType().split("/",2)[0];
if (!mediaType.equals("image")) {
@@ -109,7 +111,7 @@
if (file!= null && !StringUtils.isEmpty(fileName)) {
try {
//InputStream is = file.getInputStream();
- node = centralToolContentHandler.uploadFile(is, fileName, file.getContentType(), IToolContentHandler.TYPE_ONLINE);
+ node = centralToolContentHandler.uploadFile(is, fileName, file.getContentType(), IToolContentHandler.TYPE_ONLINE, user.getUserId());
is.close();
} catch (Exception e) {
request.setAttribute("errorMessage", e.getMessage());
@@ -119,7 +121,6 @@
log.debug("saved file with uuid: "+node.getUuid()+" and version: "+node.getVersion());
- User user = (User)getService().getUserByLogin(request.getRemoteUser());
// delete old portrait file (we only want to keep the user's current portrait)
if (user.getPortraitUuid()!=null) centralToolContentHandler.deleteFile(user.getPortraitUuid());
user.setPortraitUuid(node.getUuid());
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.16 -r1.17
--- lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 5 Sep 2006 02:38:29 -0000 1.16
+++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 6 Sep 2006 01:29:26 -0000 1.17
@@ -222,11 +222,12 @@
* holds this content
* @param mimeType The MIME type of the file
* @param path The physical location of the file from where it has to be read
+ * @param userID The User
who has requested this opeartion
* @return String The acknowledgement/error message in WDDX format for the
* FLASH client.
* @throws Exception
*/
- public String createWorkspaceFolderContent(Integer contentTypeID, String name, String description, Integer workspaceFolderID, String mimeType, String path) throws Exception;
+ public String createWorkspaceFolderContent(Integer contentTypeID, String name, String description, Integer workspaceFolderID, String mimeType, String path, Integer userId) throws Exception;
/**
* This method updates an existing file(workspaceFolderContet
)
@@ -235,10 +236,11 @@
* @param folderContentID The folder_content_id
of the file
* to be updated
* @param path The physical location of the file from where it has to be read
+ * @param userID The User
who has requested this opeartion
* @return String The acknowledgement/error message in WDDX format for FLASH
* @throws Exception
*/
- public String updateWorkspaceFolderContent(Long folderContentID,String path)throws Exception;
+ public String updateWorkspaceFolderContent(Long folderContentID,String path, Integer userId)throws Exception;
/**
* This method is called when the user knows which version of the
@@ -347,4 +349,4 @@
*/
public String getUserOrganisation(Integer userID, Integer organisationId) throws IOException;
-}
+}
\ No newline at end of file
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.34 -r1.35
--- lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 5 Sep 2006 02:38:29 -0000 1.34
+++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 6 Sep 2006 01:29:26 -0000 1.35
@@ -53,10 +53,10 @@
import org.lamsfoundation.lams.dao.IBaseDAO;
import org.lamsfoundation.lams.learningdesign.LearningDesign;
import org.lamsfoundation.lams.learningdesign.dao.ILearningDesignDAO;
+import org.lamsfoundation.lams.usermanagement.Organisation;
import org.lamsfoundation.lams.usermanagement.OrganisationState;
import org.lamsfoundation.lams.usermanagement.Role;
import org.lamsfoundation.lams.usermanagement.User;
-import org.lamsfoundation.lams.usermanagement.Organisation;
import org.lamsfoundation.lams.usermanagement.UserOrganisation;
import org.lamsfoundation.lams.usermanagement.UserOrganisationRole;
import org.lamsfoundation.lams.usermanagement.Workspace;
@@ -71,7 +71,6 @@
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.wddx.FlashMessage;
import org.lamsfoundation.lams.workspace.WorkspaceFolderContent;
-import org.lamsfoundation.lams.workspace.dao.IWorkspaceFolderContentDAO;
import org.lamsfoundation.lams.workspace.dto.FolderContentDTO;
import org.lamsfoundation.lams.workspace.dto.UpdateContentDTO;
@@ -378,8 +377,6 @@
public Integer getPermissions(WorkspaceFolder workspaceFolder, User user){
Integer permission = null;
- WorkspaceFolder userDefaultFolder = user.getWorkspace().getDefaultFolder();
-
if ( workspaceFolder==null || user==null ) {
permission = WorkspaceFolder.NO_ACCESS;
} else if (workspaceFolder.getUserID().equals(user.getUserId())) {
@@ -391,25 +388,7 @@
}
return permission;
}
- /** This method checks if the given workspaceFolder is a subFolder of the
- * given rootFolder. Returns false if they are the same folder. */
- private boolean isSubFolder(WorkspaceFolder workspaceFolder,WorkspaceFolder rootFolder){
- if ( rootFolder != null ) {
- // is it the same folder?
- if ( rootFolder.getWorkspaceFolderId().equals(workspaceFolder.getWorkspaceFolderId()) ) {
- return false;
- }
- // check the parent hierarchy
- WorkspaceFolder folder = workspaceFolder;
- while ( folder != null && ! rootFolder.getWorkspaceFolderId().equals(folder.getWorkspaceFolderId()) ) {
- folder = folder.getParentWorkspaceFolder();
- }
- return ( folder != null );
- }
- return false;
-
- }
-
+
private Vector getFolderContentDTO(List designs, Integer permissions,Vector folderContent){
Iterator iterator = designs.iterator();
while(iterator.hasNext()){
@@ -812,9 +791,9 @@
}
/**
- * @see org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService#createWorkspaceFolderContent(java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.String)
+ * @see org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService#createWorkspaceFolderContent(java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer)
*/
- public String createWorkspaceFolderContent(Integer contentTypeID,String name,String description,Integer workspaceFolderID, String mimeType, String path) throws Exception{
+ public String createWorkspaceFolderContent(Integer contentTypeID,String name,String description,Integer workspaceFolderID, String mimeType, String path, Integer userId) throws Exception{
// TODO add some validation so that a non-unique name doesn't result in an index violation
// bit hard for the user to understand.
@@ -829,7 +808,7 @@
try{
InputStream stream = new FileInputStream(path);
- NodeKey nodeKey = addFileToRepository(stream,name,mimeType);
+ NodeKey nodeKey = addFileToRepository(stream,name,mimeType,userId);
workspaceFolderContent.setUuid(nodeKey.getUuid());
workspaceFolderContent.setVersionID(nodeKey.getVersion());
baseDAO.update(workspaceFolderContent);
@@ -892,13 +871,13 @@
/**
* (non-Javadoc)
- * @see org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService#updateWorkspaceFolderContent(java.lang.Long, java.io.InputStream)
+ * @see org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService#updateWorkspaceFolderContent(java.lang.Long, java.io.InputStream, java.lang.Integer)
*/
- public String updateWorkspaceFolderContent(Long folderContentID,String path)throws Exception{
+ public String updateWorkspaceFolderContent(Long folderContentID,String path, Integer userId)throws Exception{
InputStream stream = new FileInputStream(path);
WorkspaceFolderContent workspaceFolderContent = (WorkspaceFolderContent)baseDAO.find(WorkspaceFolderContent.class,folderContentID);
if(workspaceFolderContent!=null){
- NodeKey nodeKey = updateFileInRepository(workspaceFolderContent,stream);
+ NodeKey nodeKey = updateFileInRepository(workspaceFolderContent,stream, userId);
UpdateContentDTO contentDTO = new UpdateContentDTO(nodeKey.getUuid(), nodeKey.getVersion(),folderContentID);
flashMessage = new FlashMessage(MSG_KEY_UPDATE_WKF_CONTENT,contentDTO);
}else
@@ -916,15 +895,16 @@
* @param stream The InputStream
representing the data to be added
* @param fileName The name of the file being added
* @param mimeType The MIME type of the file (eg. TXT, DOC, GIF etc)
+ * @param userId The user who is creating the content
* @return NodeKey Represents the two part key - UUID and Version.
* @throws AccessDeniedException
* @throws FileException
* @throws InvalidParameterException
*/
- private NodeKey addFileToRepository(InputStream stream, String fileName, String mimeType)throws AccessDeniedException,
+ private NodeKey addFileToRepository(InputStream stream, String fileName, String mimeType, Integer userId)throws AccessDeniedException,
FileException,InvalidParameterException{
ITicket ticket = getRepositoryLoginTicket();
- NodeKey nodeKey = repositoryService.addFileItem(ticket,stream,fileName,mimeType,null);
+ NodeKey nodeKey = repositoryService.addFileItem(ticket,stream,fileName,mimeType,null,userId);
return nodeKey;
}
/**
@@ -940,11 +920,11 @@
* @throws Exception
*/
private NodeKey updateFileInRepository(WorkspaceFolderContent workspaceFolderContent,
- InputStream stream)throws Exception{
+ InputStream stream, Integer userId)throws Exception{
ITicket ticket = getRepositoryLoginTicket();
NodeKey nodeKey = repositoryService.updateFileItem(ticket,workspaceFolderContent.getUuid(),
workspaceFolderContent.getName(),
- stream,workspaceFolderContent.getMimeType(),null);
+ stream,workspaceFolderContent.getMimeType(),null,userId);
workspaceFolderContent.setUuid(nodeKey.getUuid());
workspaceFolderContent.setVersionID(nodeKey.getVersion());
baseDAO.update(workspaceFolderContent);
@@ -1382,4 +1362,4 @@
-}
+}
\ No newline at end of file
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.18 -r1.19
--- lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java 5 Sep 2006 02:39:49 -0000 1.18
+++ lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java 6 Sep 2006 01:29:26 -0000 1.19
@@ -32,6 +32,7 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.log4j.Logger;
@@ -46,6 +47,7 @@
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.util.wddx.FlashMessage;
import org.lamsfoundation.lams.web.action.LamsDispatchAction;
+import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.workspace.dto.FolderContentDTO;
import org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService;
@@ -68,6 +70,13 @@
public static final String RESOURCE_TYPE = "resourceType";
public static final String ROLE_DELIMITER = ",";
+ private Integer getUserId(HttpServletRequest request) {
+ // return new Integer(WebUtil.readIntParam(request,AttributeNames.PARAM_USER_ID));
+ HttpSession ss = SessionManager.getSession();
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ return user != null ? user.getUserID() : null;
+ }
+
/**
* Special value for folderID on getFolderContents(). Triggers getting the
* dummy value for the organisations (see ORG_FOLDER_ID) and the user's
@@ -144,7 +153,7 @@
return returnWDDXPacket(errorPacket, response);
String folderName = (String)WebUtil.readStrParam(request,"name");
- Integer userID = new Integer(WebUtil.readIntParam(request,AttributeNames.PARAM_USER_ID));
+ Integer userID = getUserId(request);
IWorkspaceManagementService workspaceManagementService = getWorkspaceManagementService();
String wddxPacket = workspaceManagementService.createFolderForFlash(parentFolderID,folderName,userID);
return returnWDDXPacket(wddxPacket, response);
@@ -385,6 +394,7 @@
Integer workspaceFolderID = new Integer(WebUtil.readIntParam(request,"workspaceFolderID"));
String mimeType = WebUtil.readStrParam(request,"mimeType");
String path = WebUtil.readStrParam(request,"path");
+ Integer userId = getUserId(request);
String errorPacket = checkResourceNotDummyValue("createWorkspaceFolderContent", workspaceFolderID, FolderContentDTO.FOLDER);
if ( errorPacket != null)
@@ -395,7 +405,7 @@
IWorkspaceManagementService workspaceManagementService = getWorkspaceManagementService();
wddxPacket = workspaceManagementService.createWorkspaceFolderContent(contentTypeID,name,description,
workspaceFolderID,
- mimeType,path);
+ mimeType,path,userId);
} catch (Exception e) {
log.error("createWorkspaceFolderContent: Exception occured. contentTypeID "+contentTypeID+" name "+name+" workspaceFolderID "+workspaceFolderID, e);
FlashMessage flashMessage = FlashMessage.getExceptionOccured(IWorkspaceManagementService.MSG_KEY_CREATE_WKF_CONTENT, e.getMessage());
@@ -421,11 +431,11 @@
HttpServletResponse response)throws ServletException, Exception{
Long folderContentID = new Long(WebUtil.readLongParam(request,"folderContentID"));
String path = WebUtil.readStrParam(request,"path");
-
+ Integer userId = getUserId(request);
String wddxPacket = null;
try {
IWorkspaceManagementService workspaceManagementService = getWorkspaceManagementService();
- wddxPacket = workspaceManagementService.updateWorkspaceFolderContent(folderContentID,path);
+ wddxPacket = workspaceManagementService.updateWorkspaceFolderContent(folderContentID,path,userId);
} catch (Exception e) {
log.error("updateWorkspaceFolderContent: Exception occured. path "+path+" folderContentID "+folderContentID, e);
FlashMessage flashMessage = FlashMessage.getExceptionOccured(IWorkspaceManagementService.MSG_KEY_UPDATE_WKF_CONTENT, e.getMessage());
@@ -448,7 +458,7 @@
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)throws IOException{
- Integer userID = new Integer(WebUtil.readIntParam(request,AttributeNames.PARAM_USER_ID));
+ Integer userID = getUserId(request);
Long resourceID = new Long(WebUtil.readLongParam(request,RESOURCE_ID));
String resourceType = WebUtil.readStrParam(request,RESOURCE_TYPE);
@@ -510,7 +520,7 @@
HttpServletRequest request,
HttpServletResponse response)throws Exception{
- Integer userID = new Integer(WebUtil.readIntParam(request,AttributeNames.PARAM_USER_ID));
+ Integer userID = getUserId(request);
String roles_str = WebUtil.readStrParam(request, "roles");
String[] roles = roles_str.split(ROLE_DELIMITER);
@@ -582,7 +592,7 @@
HttpServletRequest request,
HttpServletResponse response)throws Exception{
- Integer userID = new Integer(WebUtil.readIntParam(request,AttributeNames.PARAM_USER_ID));
+ Integer userID = getUserId(request);
Integer orgId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID,true);
String wddxPacket = null;
@@ -596,4 +606,3 @@
}
return returnWDDXPacket(wddxPacket, response); }
}
-
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java,v
diff -u -r1.33 -r1.34
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java 21 Aug 2006 05:39:13 -0000 1.33
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java 6 Sep 2006 01:35:43 -0000 1.34
@@ -541,8 +541,17 @@
}
/**
* Import tool content
+ * TODO Remove once all tools converted to supply user id.
*/
public Object importToolContent(String toolContentPath, IToolContentHandler toolContentHandler) throws ImportToolContentException{
+ log.error("importToolContent(String toolContentPath, IToolContentHandler toolContentHandler) to be removed - it sets the owner of files in the content repository to 1. Some tool needs to be updated.");
+ return importToolContent(toolContentPath, toolContentHandler, new Integer(1));
+ }
+
+ /**
+ * Import tool content
+ */
+ public Object importToolContent(String toolContentPath, IToolContentHandler toolContentHandler, Integer userId ) throws ImportToolContentException{
Object toolPOJO = null;
// change xml to Tool POJO
XStream toolXml = new XStream();
@@ -621,10 +630,10 @@
//upload to repository: file or pacakge
NodeKey key;
if(!isPackage)
- key = toolContentHandler.uploadFile(is,fileName,mimeType,fileProperty);
+ key = toolContentHandler.uploadFile(is,fileName,mimeType,fileProperty, userId);
else{
String packageDirectory = ZipFileUtil.expandZip(is, realFileName);
- key = toolContentHandler.uploadPackage(packageDirectory,initalItem);
+ key = toolContentHandler.uploadPackage(packageDirectory,initalItem, userId);
}
//refresh file node Uuid and Version value to latest.
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/IExportToolContentService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/IExportToolContentService.java,v
diff -u -r1.9 -r1.10
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/IExportToolContentService.java 2 Aug 2006 06:15:37 -0000 1.9
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/IExportToolContentService.java 6 Sep 2006 01:35:44 -0000 1.10
@@ -93,7 +93,21 @@
*/
Long importLearningDesign(String learningDesignPath,User importer, Integer workspaceFolderUid, List toolsErrorMsgs) throws ImportToolContentException;
+ /**
+ * Import the tool content. This is called by tools to do the actual content import, once the tool
+ * has set up whatever it needs to do.
+ * TODO To be removed from the system and replaced with the call with the user id.
+ * @Deprecated
+ */
Object importToolContent(String toolContentPath, IToolContentHandler toolContentHandler)
+ throws ImportToolContentException;
+
+ /**
+ * Import the tool content. This is called by tools to do the actual content import, once the tool
+ * has set up whatever it needs to do. To be removed from the system and replaced with the call with the
+ * user id.
+ */
+ Object importToolContent(String toolContentPath, IToolContentHandler toolContentHandler, Integer userId)
throws ImportToolContentException;
/**
Index: lams_common/src/java/org/lamsfoundation/lams/tool/BasicToolVO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/BasicToolVO.java,v
diff -u -r1.5 -r1.6
--- lams_common/src/java/org/lamsfoundation/lams/tool/BasicToolVO.java 3 Apr 2006 23:36:52 -0000 1.5
+++ lams_common/src/java/org/lamsfoundation/lams/tool/BasicToolVO.java 6 Sep 2006 01:35:40 -0000 1.6
@@ -73,8 +73,11 @@
/** persistent field */
private String moderationUrl;
-
+
/** persistent field */
+ private String helpUrl;
+
+ /** persistent field */
private boolean supportsRunOffline;
/** persistent field */
@@ -124,6 +127,7 @@
String monitorUrl,
String contributeUrl,
String moderationUrl,
+ String helpUrl,
boolean supportsRunOffline,
long defaultToolContentId,
String toolSignature,
@@ -147,6 +151,7 @@
this.monitorUrl=monitorUrl;
this.contributeUrl=contributeUrl;
this.moderationUrl=moderationUrl;
+ this.helpUrl = helpUrl;
this.supportsRunOffline=supportsRunOffline;
this.defaultToolContentId=defaultToolContentId;
this.toolSignature=toolSignature;
@@ -222,6 +227,21 @@
}
/* (non-Javadoc)
+ * @see org.lamsfoundation.lams.tool.IToolVO#getHelpUrl()
+ */
+ public String getHelpUrl() {
+ return helpUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.lamsfoundation.lams.tool.IToolVO#setHelpUrl(java.lang.String)
+ */
+ public void setHelpUrl(String helpUrl) {
+ this.helpUrl = helpUrl;
+ }
+
+
+ /* (non-Javadoc)
* @see org.lamsfoundation.lams.tool.IToolVO#getCreateDateTime()
*/
public Date getCreateDateTime() {
Index: lams_common/src/java/org/lamsfoundation/lams/tool/IToolVO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/IToolVO.java,v
diff -u -r1.5 -r1.6
--- lams_common/src/java/org/lamsfoundation/lams/tool/IToolVO.java 10 May 2006 23:15:06 -0000 1.5
+++ lams_common/src/java/org/lamsfoundation/lams/tool/IToolVO.java 6 Sep 2006 01:35:40 -0000 1.6
@@ -35,6 +35,10 @@
public abstract void setContributeUrl(String contributeUrl);
+ public abstract String getHelpUrl();
+
+ public abstract void setHelpUrl(String helpUrl);
+
public abstract Date getCreateDateTime();
public abstract void setCreateDateTime(Date createDateTime);
Index: lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java,v
diff -u -r1.3 -r1.4
--- lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java 21 Jun 2006 12:05:30 -0000 1.3
+++ lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java 6 Sep 2006 01:35:39 -0000 1.4
@@ -80,6 +80,9 @@
private String contributeUrl;
/** persistent field */
+ private String helpUrl;
+
+ /** persistent field */
private Date createDateTime;
/**
@@ -100,6 +103,7 @@
String exportPortfolioClassUrl,
String monitorUrl,
String contributeUrl,
+ String helpUrl,
Date createDateTime)
{
this.systemToolId = systemToolId;
@@ -114,6 +118,7 @@
this.exportPortfolioClassUrl = exportPortfolioClassUrl;
this.monitorUrl = monitorUrl;
this.contributeUrl = contributeUrl;
+ this.helpUrl = helpUrl;
this.createDateTime = createDateTime;
}
@@ -290,7 +295,23 @@
this.monitorUrl = monitorUrl;
}
-
+ /**
+ * @hibernate.property column="help_url" length="65535" not-null="false"
+ * @return Returns the helpUrl.
+ */
+ public String getHelpUrl()
+ {
+ return helpUrl;
+ }
+ /**
+ * @param helpUrl The helpUrl to set.
+ */
+ public void setHelpUrl(String helpUrl)
+ {
+ this.helpUrl = helpUrl;
+ }
+
+
public String toString() {
return new ToStringBuilder(this)
.append("systemToolId", getSystemToolId())
Index: lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java,v
diff -u -r1.17 -r1.18
--- lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java 3 Apr 2006 23:36:52 -0000 1.17
+++ lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java 6 Sep 2006 01:35:40 -0000 1.18
@@ -75,6 +75,9 @@
private String moderationUrl;
/** persistent field */
+ private String helpUrl;
+
+ /** persistent field */
private boolean supportsRunOffline;
/** persistent field */
@@ -516,6 +519,22 @@
this.monitorUrl = monitorUrl;
}
+ /**
+ * @hibernate.property column="help_url" length="65535" not-null="false"
+ * @return Returns the helpUrl.
+ */
+ public String getHelpUrl()
+ {
+ return helpUrl;
+ }
+ /**
+ * @param helpUrl The helpUrl to set.
+ */
+ public void setHelpUrl(String helpUrl)
+ {
+ this.helpUrl = helpUrl;
+ }
+
/**
* @hibernate.property column="tool_identifier" length="64"
@@ -589,6 +608,7 @@
this.monitorUrl,
this.contributeUrl,
this.moderationUrl,
+ this.helpUrl,
this.supportsRunOffline,
this.defaultToolContentId,
this.toolSignature,
Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/Organisation.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/usermanagement/Organisation.java,v
diff -u -r1.12 -r1.13
--- lams_common/src/java/org/lamsfoundation/lams/usermanagement/Organisation.java 13 Aug 2006 23:09:57 -0000 1.12
+++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/Organisation.java 6 Sep 2006 01:35:44 -0000 1.13
@@ -60,6 +60,9 @@
private Date createDate;
/** persistent field */
+ private User createdBy;
+
+ /** persistent field */
private Workspace workspace;
/** persistent field */
@@ -91,14 +94,16 @@
private Boolean courseAdminCanCreateGuestAccounts;
/** full constructor */
- public Organisation(String name, String description, Organisation parentOrganisation, Date createDate, Workspace workspace,
+ public Organisation(String name, String description, Organisation parentOrganisation,
+ Date createDate, User createdBy, Workspace workspace,
OrganisationType organisationType, Set userOrganisations, Set childOrganisations, Set lessons,
Boolean courseAdminCanAddNewUsers, Boolean courseAdminCanBrowseAllUsers, Boolean courseAdminCanChangeStatusOfCourse,
Boolean courseAdminCanCreateGuestAccounts) {
this.name = name;
this.description = description;
this.parentOrganisation = parentOrganisation;
this.createDate = createDate;
+ this.createdBy = createdBy;
this.workspace = workspace;
this.organisationType = organisationType;
this.userOrganisations = userOrganisations;
@@ -120,8 +125,9 @@
}
/** minimal constructor */
- public Organisation(Date createDate, Workspace workspace, OrganisationType organisationType, Set userOrganisations, Set lessons) {
+ public Organisation(Date createDate, User createdBy, Workspace workspace, OrganisationType organisationType, Set userOrganisations, Set lessons) {
this.createDate = createDate;
+ this.createdBy = createdBy;
this.workspace = workspace;
this.organisationType = organisationType;
this.userOrganisations = userOrganisations;
@@ -135,12 +141,14 @@
}
public Organisation(String name,
String description,
- Date createDate,
+ Date createDate,
+ User createdBy,
OrganisationType organisationType) {
super();
this.name = name;
this.description = description;
this.createDate = createDate;
+ this.createdBy = createdBy;
this.organisationType = organisationType;
}
@@ -229,6 +237,20 @@
this.createDate = createDate;
}
+ /**
+ * @hibernate.many-to-one not-null="true"
+ * @hibernate.column name="created_by"
+ *
+ */
+ public User getCreatedBy() {
+ return this.createdBy;
+ }
+
+ public void setCreatedBy(User createdBy) {
+ this.createdBy = createdBy;
+ }
+
+
/**
* @hibernate.many-to-one
* cascade="all"
Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/service/UserManagementService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/usermanagement/service/UserManagementService.java,v
diff -u -r1.55 -r1.56
--- lams_common/src/java/org/lamsfoundation/lams/usermanagement/service/UserManagementService.java 6 Sep 2006 00:35:07 -0000 1.55
+++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/service/UserManagementService.java 6 Sep 2006 01:35:44 -0000 1.56
@@ -439,9 +439,12 @@
public Organisation saveOrganisation( Organisation organisation, Integer userID )
{
+ User creator = (User)findById(User.class,userID);
+
if ( organisation.getOrganisationId() == null ) {
Date createDateTime = new Date();
- organisation.setCreateDate(createDateTime);
+ organisation.setCreateDate(createDateTime);
+ organisation.setCreatedBy(creator);
if(organisation.getOrganisationType().getOrganisationTypeId().equals(OrganisationType.COURSE_TYPE)){
Workspace workspace = createWorkspaceForOrganisation(organisation.getName(), userID, createDateTime);