Index: lams_tool_larsrc/build.properties =================================================================== diff -u -r0a704617c31a5847217132f6b7cd73a4b9b43c9f -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/build.properties (.../build.properties) (revision 0a704617c31a5847217132f6b7cd73a4b9b43c9f) +++ lams_tool_larsrc/build.properties (.../build.properties) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -9,4 +9,4 @@ ### project properties ### signature=larsrc11 project.displayname = lams share resources tool - +weblib=lib Index: lams_tool_larsrc/build.xml =================================================================== diff -u -ra3299505c1f0a51ade0247a7117581df5c7b6066 -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/build.xml (.../build.xml) (revision a3299505c1f0a51ade0247a7117581df5c7b6066) +++ lams_tool_larsrc/build.xml (.../build.xml) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -225,6 +225,7 @@ + @@ -261,20 +262,25 @@ - + - - - - + - + + + + + + + + + Index: lams_tool_larsrc/conf/xdoclet/struts-actions.xml =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -1,10 +1,11 @@ + - + parameter="initPage" + validate="false"> + - --> + \ No newline at end of file Index: lams_tool_larsrc/db/model/resource.clay =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/db/model/resource.clay (.../resource.clay) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/db/model/resource.clay (.../resource.clay) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -14,7 +14,7 @@ - + @@ -114,9 +114,85 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- + @@ -281,7 +357,7 @@
- + @@ -296,6 +372,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -337,7 +473,7 @@
- + @@ -438,7 +574,7 @@
- + Fisheye: Tag 2116db454fd0ec719a6deeaacd9d10306d341b93 refers to a dead (removed) revision in file `lams_tool_larsrc/db/sql/cleanup_lams_tool_forum.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 2116db454fd0ec719a6deeaacd9d10306d341b93 refers to a dead (removed) revision in file `lams_tool_larsrc/db/sql/create_lams_tool_forum.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_larsrc/db/sql/create_lams_tool_rsrc.sql =================================================================== diff -u --- lams_tool_larsrc/db/sql/create_lams_tool_rsrc.sql (revision 0) +++ lams_tool_larsrc/db/sql/create_lams_tool_rsrc.sql (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -0,0 +1,85 @@ +SET FOREIGN_KEY_CHECKS=0; +drop table if exists tl_larsrc11_attachment; +drop table if exists tl_larsrc11_item_instruction; +drop table if exists tl_larsrc11_resource; +drop table if exists tl_larsrc11_resource_item; +drop table if exists tl_larsrc11_session; +drop table if exists tl_larsrc11_user; +create table tl_larsrc11_attachment ( + uid bigint not null auto_increment, + file_version_id bigint, + file_type varchar(255), + file_name varchar(255), + file_uuid bigint, + create_date datetime, + resource_uid bigint, + primary key (uid) +); +create table tl_larsrc11_item_instruction ( + uid bigint not null auto_increment, + description varchar(255), + sequence_id integer, + item_uid bigint, + primary key (uid) +); +create table tl_larsrc11_resource ( + uid bigint not null auto_increment, + create_date datetime, + update_date datetime, + create_by bigint, + title varchar(255), + run_offline bit, + lock_on_finished bit, + instructions text, + online_instructions text, + offline_instructions text, + content_in_use bit, + define_later bit, + content_id bigint unique, + allow_add_files bit, + allow_add_urls bit, + min_view_resource_number integer, + allow_auto_run bit, + primary key (uid) +); +create table tl_larsrc11_resource_item ( + uid bigint not null auto_increment, + cr_uuid bigint, + cr_version_id bigint, + description varchar(255), + ims_schema varchar(255), + init_item varchar(255), + organization_xml text, + title varchar(255), + resource_uid bigint, + primary key (uid) +); +create table tl_larsrc11_session ( + uid bigint not null auto_increment, + session_end_date datetime, + session_start_date datetime, + status integer, + resource_uid bigint, + session_id bigint, + session_name varchar(250), + primary key (uid) +); +create table tl_larsrc11_user ( + uid bigint not null auto_increment, + user_id bigint, + last_name varchar(255), + first_name varchar(255), + login_name varchar(255), + session_id bigint, + primary key (uid) +); +alter table tl_larsrc11_attachment add index FK1E7009430E79035 (resource_uid), add constraint FK1E7009430E79035 foreign key (resource_uid) references tl_larsrc11_resource (uid); +alter table tl_larsrc11_item_instruction add index FKA5665013980570ED (item_uid), add constraint FKA5665013980570ED foreign key (item_uid) references tl_larsrc11_resource_item (uid); +alter table tl_larsrc11_resource add index FK89093BF758092FB (create_by), add constraint FK89093BF758092FB foreign key (create_by) references tl_larsrc11_user (uid); +alter table tl_larsrc11_resource_item add index FKF52D1F9330E79035 (resource_uid), add constraint FKF52D1F9330E79035 foreign key (resource_uid) references tl_larsrc11_resource (uid); +alter table tl_larsrc11_session add index FK24AA78C530E79035 (resource_uid), add constraint FK24AA78C530E79035 foreign key (resource_uid) references tl_larsrc11_resource (uid); +alter table tl_larsrc11_user add index FK30113BFC506CD584 (session_id), add constraint FK30113BFC506CD584 foreign key (session_id) references tl_larsrc11_session (uid); + + +INSERT INTO tl_larsrc11_resource(title,instructions,online_instructions,offline_instructions,content_id,run_offline,lock_on_finished,content_in_use,define_later) VALUES("LAMS Shared Resources","Instruction","Online instruction","Offline instruction",${default_content_id},0,0,0,0); +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Fisheye: Tag 2116db454fd0ec719a6deeaacd9d10306d341b93 refers to a dead (removed) revision in file `lams_tool_larsrc/db/sql/drop_lams_tool_forum.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_larsrc/db/sql/drop_lams_tool_rsrc.sql =================================================================== diff -u --- lams_tool_larsrc/db/sql/drop_lams_tool_rsrc.sql (revision 0) +++ lams_tool_larsrc/db/sql/drop_lams_tool_rsrc.sql (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -0,0 +1,13 @@ +SET FOREIGN_KEY_CHECKS=0; +drop table if exists tl_larsrc11_attachment; +drop table if exists tl_larsrc11_item_instruction; +drop table if exists tl_larsrc11_resource; +drop table if exists tl_larsrc11_resource_item; +drop table if exists tl_larsrc11_session; +drop table if exists tl_larsrc11_user; +SET FOREIGN_KEY_CHECKS=1; + + + + + Fisheye: Tag 2116db454fd0ec719a6deeaacd9d10306d341b93 refers to a dead (removed) revision in file `lams_tool_larsrc/db/sql/insert_lams_tool_forum_data.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_larsrc/db/sql/table-schema.sql =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/db/sql/table-schema.sql (.../table-schema.sql) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/db/sql/table-schema.sql (.../table-schema.sql) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -1,9 +1,11 @@ alter table tl_larsrc11_attachment drop foreign key FK1E7009430E79035; +alter table tl_larsrc11_item_instruction drop foreign key FKA5665013980570ED; alter table tl_larsrc11_resource drop foreign key FK89093BF758092FB; alter table tl_larsrc11_resource_item drop foreign key FKF52D1F9330E79035; alter table tl_larsrc11_session drop foreign key FK24AA78C530E79035; alter table tl_larsrc11_user drop foreign key FK30113BFC506CD584; drop table if exists tl_larsrc11_attachment; +drop table if exists tl_larsrc11_item_instruction; drop table if exists tl_larsrc11_resource; drop table if exists tl_larsrc11_resource_item; drop table if exists tl_larsrc11_session; @@ -18,6 +20,13 @@ resource_uid bigint, primary key (uid) ); +create table tl_larsrc11_item_instruction ( + uid bigint not null auto_increment, + description varchar(255), + sequence_id integer, + item_uid bigint, + primary key (uid) +); create table tl_larsrc11_resource ( uid bigint not null auto_increment, create_date datetime, @@ -40,6 +49,13 @@ ); create table tl_larsrc11_resource_item ( uid bigint not null auto_increment, + cr_uuid bigint, + cr_version_id bigint, + description varchar(255), + ims_schema varchar(255), + init_item varchar(255), + organization_xml text, + title varchar(255), resource_uid bigint, primary key (uid) ); @@ -63,6 +79,7 @@ primary key (uid) ); alter table tl_larsrc11_attachment add index FK1E7009430E79035 (resource_uid), add constraint FK1E7009430E79035 foreign key (resource_uid) references tl_larsrc11_resource (uid); +alter table tl_larsrc11_item_instruction add index FKA5665013980570ED (item_uid), add constraint FKA5665013980570ED foreign key (item_uid) references tl_larsrc11_resource_item (uid); alter table tl_larsrc11_resource add index FK89093BF758092FB (create_by), add constraint FK89093BF758092FB foreign key (create_by) references tl_larsrc11_user (uid); alter table tl_larsrc11_resource_item add index FKF52D1F9330E79035 (resource_uid), add constraint FKF52D1F9330E79035 foreign key (resource_uid) references tl_larsrc11_resource (uid); alter table tl_larsrc11_session add index FK24AA78C530E79035 (resource_uid), add constraint FK24AA78C530E79035 foreign key (resource_uid) references tl_larsrc11_resource (uid); Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java =================================================================== diff -u --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java (revision 0) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -0,0 +1,38 @@ +/* + *Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * + *This program is free software; you can redistribute it and/or modify + *it under the terms of the GNU General Public License as published by + *the Free Software Foundation; either version 2 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 General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + *USA + * + *http://www.gnu.org/licenses/gpl.txt + */ +package org.lamsfoundation.lams.tool.rsrc; + +public class ResourceConstants { + public static final String TOOL_SIGNNATURE = "larsrc11"; + public static final String RESOURCE_SERVICE = "resourceService"; + + //for action forward name + public static final String SUCCESS = "success"; + public static final String ERROR = "error"; + + //for parameters' name + public static final String PARAM_TOOL_CONTENT_ID = "toolContentID"; + + //for request attribute name + public static final String AUTHORING_RESOURCE_LIST = "resourceList"; + public static final String INSTRUCTION_ATTACHMENT_LIST = "instructionAttachmentList"; + +} Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/dao/ResourceDAO.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/dao/ResourceDAO.java (.../ResourceDAO.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/dao/ResourceDAO.java (.../ResourceDAO.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -20,6 +20,12 @@ */ package org.lamsfoundation.lams.tool.rsrc.dao; +import org.lamsfoundation.lams.tool.rsrc.model.Resource; + public interface ResourceDAO extends DAO { + Resource getByContentId(Long contentId); + + Resource getByUid(Long resourceUid); + } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/dao/hibernate/ResourceDAOHibernate.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/dao/hibernate/ResourceDAOHibernate.java (.../ResourceDAOHibernate.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/dao/hibernate/ResourceDAOHibernate.java (.../ResourceDAOHibernate.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -21,8 +21,23 @@ package org.lamsfoundation.lams.tool.rsrc.dao.hibernate; import org.lamsfoundation.lams.tool.rsrc.dao.ResourceDAO; +import org.lamsfoundation.lams.tool.rsrc.model.Resource; - +/** + * + * @author Steve.Ni + * + * @version $Revision$ + */ public class ResourceDAOHibernate extends BaseDAOHibernate implements ResourceDAO{ + private static final String GET_RESOURCE_BY_CONTENTID = "from "+Resource.class.getName()+" as r where r.contentId=?"; + + public Resource getByContentId(Long contentId) { + return (Resource) getHibernateTemplate().find(GET_RESOURCE_BY_CONTENTID,contentId); + } + public Resource getByUid(Long resourceUid) { + return (Resource) getObject(Resource.class,resourceUid); + } + } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/Resource.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/Resource.java (.../Resource.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/Resource.java (.../Resource.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -8,6 +8,11 @@ import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; +import org.lamsfoundation.lams.contentrepository.NodeKey; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.rsrc.util.ResourceToolContentHandler; /** * Resource @@ -48,6 +53,9 @@ //resource Items private Set resourceItems; + + //*************** NON Persist Fields ******************** + private IToolContentHandler toolContentHandler; /** * Default contruction method. * @@ -59,6 +67,13 @@ // ********************************************************** // Function method for Resource // ********************************************************** + public static Resource newInstance(Resource defaultContent, Long contentId, ResourceToolContentHandler resourceToolContentHandler) { + Resource toContent = new Resource(); + defaultContent.toolContentHandler = resourceToolContentHandler; + toContent = (Resource) defaultContent.clone(); + toContent.setContentId(contentId); + return toContent; + } public Object clone(){ Resource resource = null; @@ -72,23 +87,23 @@ while(iter.hasNext()){ ResourceAttachment file = (ResourceAttachment)iter.next(); ResourceAttachment newFile = (ResourceAttachment) file.clone(); - //if toolContentHandle is null, just clone old file without duplicate it in repository -// if(toolContentHandler != null){ -// //duplicate file node in repository -// NodeKey keys = toolContentHandler.copyFile(file.getFileUuid()); -// newFile.setFileUuid(keys.getUuid()); -// newFile.setFileVersionId(keys.getVersion()); -// } +// if toolContentHandle is null, just clone old file without duplicate it in repository + if(toolContentHandler != null){ + //duplicate file node in repository + NodeKey keys = toolContentHandler.copyFile(file.getFileUuid()); + newFile.setFileUuid(keys.getUuid()); + newFile.setFileVersionId(keys.getVersion()); + } set.add(newFile); } resource.attachments = set; } } catch (CloneNotSupportedException e) { log.error("When clone " + Resource.class + " failed"); -// } catch (ItemNotFoundException e) { -// log.error("When clone " + Resource.class + " failed"); -// } catch (RepositoryCheckedException e) { -// log.error("When clone " + Resource.class + " failed"); + } catch (ItemNotFoundException e) { + log.error("When clone " + Resource.class + " failed"); + } catch (RepositoryCheckedException e) { + log.error("When clone " + Resource.class + " failed"); } return resource; @@ -424,4 +439,5 @@ this.runAuto = runAuto; } + } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItem.hbm.xml =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItem.hbm.xml (.../ResourceItem.hbm.xml) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItem.hbm.xml (.../ResourceItem.hbm.xml) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -25,6 +25,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItemInstruction.java =================================================================== diff -u --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItemInstruction.java (revision 0) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItemInstruction.java (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -0,0 +1,74 @@ +/* + *Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * + *This program is free software; you can redistribute it and/or modify + *it under the terms of the GNU General Public License as published by + *the Free Software Foundation; either version 2 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 General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + *USA + * + *http://www.gnu.org/licenses/gpl.txt + */ +package org.lamsfoundation.lams.tool.rsrc.model; + +import java.util.Set; +/** + * @hibernate.class table="tl_larsrc11_item_instruction" + * @author Steve.Ni + * + * @version $Revision$ + */ +public class ResourceItemInstruction { + + private Long uid; + private int sequenceId; + private String description; + + +// ********************************************************** + // Get/Set methods +// ********************************************************** + /** + * @hibernate.id generator-class="identity" type="java.lang.Long" column="uid" + * @return Returns the uid. + */ + public Long getUid() { + return uid; + } + /** + * @param uid The uid to set. + */ + public void setUid(Long userID) { + this.uid = userID; + } + /** + * @hibernate.property column="description" + * @return + */ + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + /** + * @hibernate.property column="sequence_id" + * @return + */ + public int getSequenceId() { + return sequenceId; + } + public void setSequenceId(int sequenceId) { + this.sequenceId = sequenceId; + } + +} Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceSession.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceSession.java (.../ResourceSession.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceSession.java (.../ResourceSession.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -21,6 +21,7 @@ package org.lamsfoundation.lams.tool.rsrc.model; import java.util.Date; +import java.util.Set; import org.apache.log4j.Logger; @@ -43,7 +44,8 @@ private Date sessionEndDate; //finish or not private int status; - + //resource Items + private Set resourceItems; // ********************************************************** // Function method for ForumToolSession // ********************************************************** @@ -52,7 +54,7 @@ ResourceSession session = null; try{ session = (ResourceSession) super.clone(); - + //TODO: need clone ResourceItems } catch (CloneNotSupportedException e) { log.error("When clone " + ResourceSession.class + " failed"); } @@ -144,6 +146,24 @@ this.sessionName = sessionName; } + /** + * + * + * @hibernate.set lazy="true" + * inverse="true" + * cascade="none" + * order-by="create_date desc" + * @hibernate.collection-key column="session_uid" + * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.rsrc.model.ResourceItem" + * + * @return + */ + public Set getResourceItems() { + return resourceItems; + } + public void setResourceItems(Set resourceItems) { + this.resourceItems= resourceItems; + } } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/IResourceService.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/IResourceService.java (.../IResourceService.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/IResourceService.java (.../IResourceService.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -22,12 +22,25 @@ package org.lamsfoundation.lams.tool.rsrc.service; +import java.util.Set; + +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.tool.rsrc.model.Resource; + /** * @author Dapeng.Ni * * Interface that defines the contract that all ShareResource service provider must follow. */ public interface IResourceService { + + IVersionedNode getFileNode(Long packageId, String relPathString) throws ResourceApplicationException ; + + Resource getResourceByContentId(Long contentId); + + Resource getDefaultContent(Long contentId) throws ResourceApplicationException; + + Set getAuthoredItems(Long resourceUid); } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceApplicationException.java =================================================================== diff -u --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceApplicationException.java (revision 0) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceApplicationException.java (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -0,0 +1,45 @@ +/* + *Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * + *This program is free software; you can redistribute it and/or modify + *it under the terms of the GNU General Public License as published by + *the Free Software Foundation; either version 2 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 General Public License for more details. + * + *You should have received a copy of the GNU General Public License + *along with this program; if not, write to the Free Software + *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + *USA + * + *http://www.gnu.org/licenses/gpl.txt + */ +package org.lamsfoundation.lams.tool.rsrc.service; + +public class ResourceApplicationException extends Exception{ + + public ResourceApplicationException() { + super(); + + } + + public ResourceApplicationException(String message, Throwable cause) { + super(message, cause); + + } + + public ResourceApplicationException(String message) { + super(message); + + } + + public ResourceApplicationException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java (.../ResourceServiceImpl.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java (.../ResourceServiceImpl.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -21,14 +21,27 @@ * ***********************************************************************/ package org.lamsfoundation.lams.tool.rsrc.service; +import java.util.Set; + import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.contentrepository.LoginException; +import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; +import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.learning.service.ILearnerService; +import org.lamsfoundation.lams.tool.rsrc.ResourceConstants; import org.lamsfoundation.lams.tool.rsrc.dao.ResourceAttachmentDAO; import org.lamsfoundation.lams.tool.rsrc.dao.ResourceDAO; import org.lamsfoundation.lams.tool.rsrc.dao.ResourceItemDAO; import org.lamsfoundation.lams.tool.rsrc.dao.ResourceSessionDAO; import org.lamsfoundation.lams.tool.rsrc.dao.ResourceUserDAO; +import org.lamsfoundation.lams.tool.rsrc.ims.ImscpApplicationException; +import org.lamsfoundation.lams.tool.rsrc.model.Resource; +import org.lamsfoundation.lams.tool.rsrc.model.ResourceItem; import org.lamsfoundation.lams.tool.rsrc.util.ResourceToolContentHandler; import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.util.MessageService; @@ -42,7 +55,7 @@ IResourceService { - static Logger logger = Logger.getLogger(ResourceServiceImpl.class.getName()); + static Logger log = Logger.getLogger(ResourceServiceImpl.class.getName()); private ResourceDAO resourceDao; private ResourceItemDAO resourceItemDao; private ResourceAttachmentDAO resourceAttachmentDao; @@ -55,8 +68,151 @@ private IRepositoryService repositoryService; private ILamsToolService toolService; private ILearnerService learnerService; + + public IVersionedNode getFileNode(Long itemUid, String relPathString) throws ResourceApplicationException { + ResourceItem item = (ResourceItem) resourceItemDao.getObject(ResourceItem.class,itemUid); + if ( item == null ) + throw new ResourceApplicationException("Reource item "+itemUid+" not found."); + + return getFile(item.getCrUuid(), item.getCrVersionId(), relPathString); + } + //******************************************************************************* + // Private method + //******************************************************************************* + /** Try to get the file. If forceLogin = false and an access denied exception occurs, call this method + * again to get a new ticket and retry file lookup. If forceLogin = true and it then fails + * then throw exception. + * @param uuid + * @param versionId + * @param relativePath + * @param attemptCount + * @return file node + * @throws ImscpApplicationException + */ + private IVersionedNode getFile(Long uuid, Long versionId, String relativePath) throws ResourceApplicationException { + + ITicket tic = getRepositoryLoginTicket(); + + try { + + return repositoryService.getFileItem(tic, uuid, versionId, relativePath); + + } catch (AccessDeniedException e) { + + String error = "Unable to access repository to get file uuid "+uuid + +" version id "+versionId + +" path " + relativePath+"."; + + error = error+"AccessDeniedException: "+e.getMessage()+" Unable to retry further."; + log.error(error); + throw new ResourceApplicationException(error,e); + + } catch (Exception e) { + + String error = "Unable to access repository to get file uuid "+uuid + +" version id "+versionId + +" path " + relativePath+"." + +" Exception: "+e.getMessage(); + log.error(error); + throw new ResourceApplicationException(error,e); + + } + } + /** + * This method verifies the credentials of the SubmitFiles Tool and gives it + * the Ticket to login and access the Content Repository. + * + * A valid ticket is needed in order to access the content from the + * repository. This method would be called evertime the tool needs to + * upload/download files from the content repository. + * + * @return ITicket The ticket for repostory access + * @throws SubmitFilesException + */ + private ITicket getRepositoryLoginTicket() throws ResourceApplicationException { + ICredentials credentials = new SimpleCredentials( + resourceToolContentHandler.getRepositoryUser(), + resourceToolContentHandler.getRepositoryId()); + try { + ITicket ticket = repositoryService.login(credentials, + resourceToolContentHandler.getRepositoryWorkspaceName()); + return ticket; + } catch (AccessDeniedException ae) { + throw new ResourceApplicationException("Access Denied to repository." + + ae.getMessage()); + } catch (WorkspaceNotFoundException we) { + throw new ResourceApplicationException("Workspace not found." + + we.getMessage()); + } catch (LoginException e) { + throw new ResourceApplicationException("Login failed." + e.getMessage()); + } + } + + + public Resource getResourceByContentId(Long contentId) { + Resource rs = resourceDao.getByContentId(contentId); + if(rs == null){ + log.error("Could not find the content by given ID:"+contentId); + } + return rs; + } + + + public Resource getDefaultContent(Long contentId) throws ResourceApplicationException { + if (contentId == null) + { + String error="Could not retrieve default content id for Shared Resource tool"; + log.error(error); + throw new ResourceApplicationException(error); + } + + Resource defaultContent = getDefaultResource(); + //save default content by given ID. + Resource content = new Resource(); + content = Resource.newInstance(defaultContent,contentId,resourceToolContentHandler); + //TODO: does it need replicate the content's resource items? + return content; + } + + public Set getAuthoredItems(Long resourceUid) { + Resource resource = resourceDao.getByUid(resourceUid); + + return resource.getResourceItems(); + } + + //***************************************************************************** + // private methods + //***************************************************************************** + private Resource getDefaultResource() throws ResourceApplicationException { + Long defaultResourceId = getToolDefaultContentIdBySignature(ResourceConstants.TOOL_SIGNNATURE); + Resource defaultResource = getResourceByContentId(defaultResourceId); + if(defaultResource == null) + { + String error="Could not retrieve default content record for this tool"; + log.error(error); + throw new ResourceApplicationException(error); + } + + return defaultResource; + } + private Long getToolDefaultContentIdBySignature(String toolSignature) throws ResourceApplicationException + { + Long contentId = null; + contentId=new Long(toolService.getToolDefaultContentIdBySignature(toolSignature)); + if (contentId == null) + { + String error="Could not retrieve default content id for this tool"; + log.error(error); + throw new ResourceApplicationException(error); + } + return contentId; + } + + //***************************************************************************** + // set methods for Spring Bean + //***************************************************************************** public void setLearnerService(ILearnerService learnerService) { this.learnerService = learnerService; } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceProxy.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceProxy.java (.../ResourceServiceProxy.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceProxy.java (.../ResourceServiceProxy.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -24,6 +24,8 @@ import javax.servlet.ServletContext; +import org.lamsfoundation.lams.tool.ToolContentManager; +import org.lamsfoundation.lams.tool.ToolSessionManager; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -47,25 +49,25 @@ * @param servletContext the servletContext for current application * @return mcq service object. */ - public static final IResourceService getMcService(ServletContext servletContext) + public static final IResourceService getResourceService(ServletContext servletContext) { - return (IResourceService)getMcDomainService(servletContext); + return (IResourceService)getResourceDomainService(servletContext); } -// -// public static final ToolSessionManager getMcSessionManager(ServletContext servletContext) -// { -// return (ToolSessionManager)getMcDomainService(servletContext); -// } -// -// public static final ToolContentManager getMcContentManager(ServletContext servletContext) -// { -// return (ToolContentManager)getMcDomainService(servletContext); -// } + + public static final ToolSessionManager getMcSessionManager(ServletContext servletContext) + { + return (ToolSessionManager)getResourceDomainService(servletContext); + } + + public static final ToolContentManager getMcContentManager(ServletContext servletContext) + { + return (ToolContentManager)getResourceDomainService(servletContext); + } - private static Object getMcDomainService(ServletContext servletContext) + private static Object getResourceDomainService(ServletContext servletContext) { WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); - return wac.getBean("mcService"); + return wac.getBean("resourceService"); } } \ No newline at end of file Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/Download.java =================================================================== diff -u --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/Download.java (revision 0) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/Download.java (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -0,0 +1,260 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ +package org.lamsfoundation.lams.tool.rsrc.web; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.math.NumberUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.IValue; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; +import org.lamsfoundation.lams.contentrepository.NodeType; +import org.lamsfoundation.lams.contentrepository.PropertyName; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.ValueFormatException; +import org.lamsfoundation.lams.tool.rsrc.service.IResourceService; +import org.lamsfoundation.lams.tool.rsrc.service.ResourceServiceProxy; +import org.springframework.beans.BeansException; + + +/** +* Specialised servlet that supports the rendering of packages. +* It has a rather odd format - you can call it with +* the uuid, version id and path of the content as +* download/<uuid>/<version>/relPath. +* +* This / format allows the relative pathed links +* within an html file to work properly. +* +* Based on the sample Download servlet in the content repository +* package. +* +* @author Fiona Malikoff +*/ + +public class Download extends HttpServlet { + + protected static Logger log = Logger.getLogger(Download.class); + + private static final String expectedFormat = + "Expected format /download/<packageId>/<relPath>"; + /** + * Constructor of the object. + */ + public Download() { + super(); + } + + /** + * Destruction of the servlet.
+ */ + public void destroy() { + super.destroy(); // Just puts "destroy" string in log + // Put your code here + } + + /** + * The doGet method of the servlet.
+ * + * This method is called when a form has its tag value method equals to get. + * + * @param request the request send by the client to the server + * @param response the response send by the server to the client + * @throws ServletException if an error occurred + * @throws IOException if an error occurred + */ + public void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + try { + handleCall(request, response); + } catch (RepositoryCheckedException e) { + errorInContent(request, response,"Repository threw an exception ",e); + } + } + + private void handleCall(HttpServletRequest request, HttpServletResponse response) + throws ServletException, BeansException, AccessDeniedException, ItemNotFoundException, FileException, ValueFormatException, IOException{ + + String pathString = request.getPathInfo(); + String[] strings = deriveIdFile(pathString); + Long packageId = NumberUtils.createLong(strings[0]); + String relPathString = strings[1]; + + if ( packageId == null ) { + errorInContent(request, response, "Package ID value is missing. "+expectedFormat,null); + return; + } + + if ( relPathString == null ) { + errorInContent(request, response, "Filename is missing. "+expectedFormat,null); + return; + } + + IVersionedNode node = null; + + try { + + IResourceService service = getService(this.getServletContext()); + node = service.getFileNode(packageId, relPathString); + if ( ! node.isNodeType(NodeType.FILENODE) ) { + errorInContent(request, response,"Unexpected type of node " + +node.getNodeType()+" Expected File node. Data is "+node,null); + return; + } + handleFileNode(request, response, node); + + } catch ( Exception e ) { + + log.error("Download servlet: Exception occured "+e.getMessage()); + errorInContent(request, response, "Exception occurred getting file from content repository. ", e ); + + } + + } + + /** + * @param response + * @param aNode + * @throws IOException + */ + protected void handleFileNode(HttpServletRequest request, HttpServletResponse response, IVersionedNode fileNode) + throws IOException, FileException, ValueFormatException { + + IValue prop = fileNode.getProperty(PropertyName.MIMETYPE); + String mimeType = prop != null ? prop.getString() : null; + + if ( mimeType == null ) { + prop = fileNode.getProperty(PropertyName.FILENAME); + if ( prop != null ) { + mimeType = getServletContext().getMimeType(prop.getString()); + } + } + + if ( mimeType != null ) { + response.setContentType(mimeType); + } + + OutputStream os = response.getOutputStream(); + InputStream is = fileNode.getFile(); + for ( int c = is.read(); c != -1; c=is.read() ) { + os.write(c); + } + os.close(); + is.close(); + } + + // Expect format ///. No parts are optional. Filename may be a path. + // returns an array of three strings. + private String[] deriveIdFile(String pathInfo) { + String[] result = new String[2]; + + if ( pathInfo != null ) { + + String[] strings = pathInfo.split("/",3); + + for ( int i=0, j=0; i 0 ) { + result[j++] = strings[i]; + } + } + + } + log.debug("Split path into following strings: '" + +result[0] + +"' '"+result[1]); + + return result; + } + + + /** + * The doPost method of the servlet.
+ * + * This method is called when a form has its tag value method equals to post. + * + * @param request the request send by the client to the server + * @param response the response send by the server to the client + * @throws ServletException if an error occurred + * @throws IOException if an error occurred + */ + public void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + try { + handleCall(request, response); + } catch (RepositoryCheckedException e) { + errorInContent(request, response,"Repository threw an exception ",e); + } + } + + protected void errorInContent(HttpServletRequest request, HttpServletResponse response, String errMsg, Exception e ) throws IOException { + + log.error(errMsg,e); + + response.setContentType("text/html"); + PrintWriter out = response.getWriter(); + out.println(""); + out.println(""); + out.println(" Error Getting Document"); + out.println(" "); + out.println("

An error occurred: "+errMsg+"

"); + if ( e != null ) { + out.println("

"+e.getMessage()+"

"); + } + out.println("

Path details:

"); + out.println(dumpPath(request)); + out.println(" "); + out.println(""); + out.flush(); + out.close(); + } + + protected String dumpPath(HttpServletRequest request) + { + return "
" + +"" + + "" + + "" + + "" + + "" + + "" + + "" + + "
getContextPath"+request.getContextPath()+"
getPathInfo"+request.getPathInfo()+"
getPathTranslated"+request.getPathTranslated()+"
getQueryString"+request.getQueryString()+"
getRequestURI"+request.getRequestURI()+"
getRequestURL"+request.getRequestURL()+"
getServletPath"+request.getServletPath()+"
"; + } + + protected static IResourceService getService(ServletContext servletContext) { + return ResourceServiceProxy.getResourceService(servletContext); + } +} Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java =================================================================== diff -u -ra3299505c1f0a51ade0247a7117581df5c7b6066 -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision a3299505c1f0a51ade0247a7117581df5c7b6066) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -21,6 +21,10 @@ package org.lamsfoundation.lams.tool.rsrc.web.action; import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -31,7 +35,13 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.tool.rsrc.ResourceConstants; +import org.lamsfoundation.lams.tool.rsrc.model.Resource; import org.lamsfoundation.lams.tool.rsrc.service.IResourceService; +import org.lamsfoundation.lams.tool.rsrc.web.form.ResourceForm; +import org.lamsfoundation.lams.util.WebUtil; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; /** * @author Steve.Ni @@ -97,14 +107,77 @@ // if (param.equals("finishTopic")) { // return finishTopic(mapping, form, request, response); // } - return mapping.findForward("error"); + return mapping.findForward(ResourceConstants.ERROR); } //****************************************************************************************************************** // Forum Author functions //****************************************************************************************************************** private ActionForward initPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - return null; + + Long contentId = new Long(WebUtil.readLongParam(request,ResourceConstants.PARAM_TOOL_CONTENT_ID)); + ResourceForm forumForm = (ResourceForm)form; + //get back the topic list and display them on page + IResourceService service = getResourceService(); + + Set topics = null; + Resource resource = null; + try { + resource = service.getResourceByContentId(contentId); + //if forum does not exist, try to use default content instead. + if(resource == null){ + resource = service.getDefaultContent(contentId); + if(resource.getResourceItems() != null){ + topics = resource.getResourceItems(); + }else + topics = null; + }else + topics = service.getAuthoredItems(resource.getUid()); + //initialize instruction attachment list + List attachmentList = getAttachmentList(request); + attachmentList.addAll(resource.getAttachments()); + + forumForm.setResource(resource); + } catch (Exception e) { + log.error(e); + return mapping.findForward("error"); + } + + //set back STRUTS component value + //init it to avoid null exception in following handling + if(topics == null) + topics = new HashSet(); + request.getSession().setAttribute(ResourceConstants.AUTHORING_RESOURCE_LIST, topics); + return mapping.findForward(ResourceConstants.SUCCESS); } + //************************************************************************************* + // Private method + //************************************************************************************* + private IResourceService getResourceService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); + return (IResourceService) wac.getBean(ResourceConstants.RESOURCE_SERVICE); + } + /** + * @param request + * @return + */ + private List getAttachmentList(HttpServletRequest request) { + return getListFromSession(request,ResourceConstants.INSTRUCTION_ATTACHMENT_LIST); + } + /** + * Get java.util.List from HttpSession by given name. + * + * @param request + * @param name + * @return + */ + private List getListFromSession(HttpServletRequest request,String name) { + List list = (List) request.getSession().getAttribute(name); + if(list == null){ + list = new ArrayList(); + request.getSession().setAttribute(name,list); + } + return list; + } } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/form/ResourceForm.java =================================================================== diff -u -r5d0efcab8441b253fc761272cbaeb62aa4f4a4ef -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/form/ResourceForm.java (.../ResourceForm.java) (revision 5d0efcab8441b253fc761272cbaeb62aa4f4a4ef) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/form/ResourceForm.java (.../ResourceForm.java) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -2,6 +2,7 @@ import org.apache.log4j.Logger; import org.apache.struts.validator.ValidatorForm; +import org.lamsfoundation.lams.tool.rsrc.model.Resource; /** * @@ -13,6 +14,11 @@ public class ResourceForm extends ValidatorForm { private static final long serialVersionUID = -6054354910960460120L; private static Logger logger = Logger.getLogger(ResourceForm.class.getName()); + + + public void setResource(Resource resource) { + //TODO + } } Index: lams_tool_larsrc/web/WEB-INF/lams.tld =================================================================== diff -u -r0a704617c31a5847217132f6b7cd73a4b9b43c9f -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/web/WEB-INF/lams.tld (.../lams.tld) (revision 0a704617c31a5847217132f6b7cd73a4b9b43c9f) +++ lams_tool_larsrc/web/WEB-INF/lams.tld (.../lams.tld) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -33,7 +33,6 @@ empty - Output details from the shared session UserDTO object property true @@ -63,6 +62,14 @@ org.lamsfoundation.lams.web.tag.CssTag empty + + localLink + false + + true + + + Index: lams_tool_larsrc/web/WEB-INF/tiles-defs.xml =================================================================== diff -u -ra3299505c1f0a51ade0247a7117581df5c7b6066 -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision a3299505c1f0a51ade0247a7117581df5c7b6066) +++ lams_tool_larsrc/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -29,6 +29,15 @@ + + + + + + + + + Index: lams_tool_larsrc/web/WEB-INF/web.xml =================================================================== diff -u -ra3299505c1f0a51ade0247a7117581df5c7b6066 -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/web/WEB-INF/web.xml (.../web.xml) (revision a3299505c1f0a51ade0247a7117581df5c7b6066) +++ lams_tool_larsrc/web/WEB-INF/web.xml (.../web.xml) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -1,159 +1,35 @@ - Shared Resources - - Shared Resources tool - - - javax.servlet.jsp.jstl.fmt.localizationContext - org.lamsfoundation.lams.tool.rsrc.ApplicationResources - - - contextConfigLocation - - classpath:/org/lamsfoundation/lams/applicationContext.xml - classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml - classpath:/org/lamsfoundation/lams/tool/toolApplicationContext.xml - classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml - classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml - classpath:/org/lamsfoundation/lams/tool/rsrc/rsrcApplicationContext.xml - - - - - org.springframework.web.context.ContextLoaderListener - - + - - hibernateFilter - - org.lamsfoundation.lams.util.CustomizedOpenSessionInViewFilter - - - sessionFactoryBeanName - resourceSessionFactory - - - - - SystemSessionFilter - - org.lamsfoundation.lams.web.session.SystemSessionFilter - - - - LocaleFilter - - org.lamsfoundation.lams.web.filter.LocaleFilter - - - encoding - UTF-8 - - + - - hibernateFilter - /* - - - SystemSessionFilter - /* - - - LocaleFilter - /* - - - - context - org.springframework.web.context.ContextLoaderServlet - 1 - + - - exportPortfolio - org.lamsfoundation.lams.tool.rsrc.web.action.ExportServlet - - - - action - org.apache.struts.action.ActionServlet - - config - /WEB-INF/struts-config.xml - - - debug - 999 - - - detail - 2 - - - validate - true - - 2 - - - - Connector - com.fredck.FCKeditor.connector.ConnectorServlet - - baseDir - /UserFiles/ - - - debug - false - - 1 - - - - - Instructions Download - Instructions Download - download - org.lamsfoundation.lams.contentrepository.client.ToolDownload - - toolContentHandlerBeanName - resourceToolContentHandler - - 3 - - - - action - *.do - - - - Connector - /editor/filemanager/browser/default/connectors/jsp/connector - - - - download - /download/* - - - - exportPortfolio - /exportPortfolio - - 120 @@ -165,8 +41,36 @@ --> - - 403 - /403.html - + + + + + + Index: lams_tool_larsrc/web/pages/authoring/authoring.jsp =================================================================== diff -u -ra3299505c1f0a51ade0247a7117581df5c7b6066 -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision a3299505c1f0a51ade0247a7117581df5c7b6066) +++ lams_tool_larsrc/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -1,6 +1,4 @@ -<%@ include file="../sharing/share.jsp" %> -<%@ taglib uri="fck-editor" prefix="FCK"%> -<%@ taglib uri="tags-lams" prefix="lams" %> +<%@ include file="/common/taglib.jsp" %> <%@ page import="java.util.HashSet" %> <%@ page import="java.util.Set" %> @@ -18,7 +16,7 @@ - Submit Files + <fmt:message key="label.author.title"/> author_page/css/aqua.css" rel="stylesheet" type="text/css"> Index: lams_tool_larsrc/web/pages/authoring/basic.jsp =================================================================== diff -u -ra3299505c1f0a51ade0247a7117581df5c7b6066 -r2116db454fd0ec719a6deeaacd9d10306d341b93 --- lams_tool_larsrc/web/pages/authoring/basic.jsp (.../basic.jsp) (revision a3299505c1f0a51ade0247a7117581df5c7b6066) +++ lams_tool_larsrc/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) @@ -1,9 +1,5 @@ +<%@ include file="/common/taglib.jsp" %> -<%@ taglib uri="tags-html" prefix="html" %> -<%@ taglib uri="tags-core" prefix="c"%> -<%@ taglib uri="tags-fmt" prefix="fmt"%> -<%@ taglib uri="tags-lams" prefix="lams" %> -