Index: lams_tool_larsrc/conf/xdoclet/struts-actions.xml =================================================================== diff -u -rca5f4ba9be98d3653d3820b885376003c6bf2b55 -r0c4f17efc49e7012360fb98ac98b7e4a005fea9f --- lams_tool_larsrc/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision ca5f4ba9be98d3653d3820b885376003c6bf2b55) +++ lams_tool_larsrc/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -68,4 +68,12 @@ type="org.lamsfoundation.lams.tool.rsrc.web.action.AuthoringAction" parameter="removeInstruction"> - \ No newline at end of file + + + + + + + \ No newline at end of file Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java =================================================================== diff -u -r57a8fd80863308a6aae133850dbe2de4acd15abf -r0c4f17efc49e7012360fb98ac98b7e4a005fea9f --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java (.../ResourceConstants.java) (revision 57a8fd80863308a6aae133850dbe2de4acd15abf) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java (.../ResourceConstants.java) (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -47,6 +47,7 @@ public static final String ATT_ATTACHMENT_LIST = "instructionAttachmentList"; public static final String ATTR_DELETED_RESOURCE_LIST = "deleteResourceList"; public static final String ATTR_DELETED_ATTACHMENT_LIST = "deletedAttachmmentList"; + public static final String ATT_LEARNING_OBJECT = "cpPackage"; //error message keys public static final String ERROR_MSG_TITLE_BLANK = "error.resource.item.title.blank"; Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItem.hbm.xml =================================================================== diff -u -ra0999444e5cac377c2e02a67a3583c84e8e82ca2 -r0c4f17efc49e7012360fb98ac98b7e4a005fea9f --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItem.hbm.xml (.../ResourceItem.hbm.xml) (revision a0999444e5cac377c2e02a67a3583c84e8e82ca2) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/ResourceItem.hbm.xml (.../ResourceItem.hbm.xml) (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -69,7 +69,7 @@ name="itemInstructions" lazy="true" inverse="false" - cascade="all" + cascade="all-delete-orphan" sort="unsorted" order-by="sequence_id desc" > Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java =================================================================== diff -u -r2699ca5080d7ebf1fbcd84c3f5060428b6fbb192 -r0c4f17efc49e7012360fb98ac98b7e4a005fea9f --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 2699ca5080d7ebf1fbcd84c3f5060428b6fbb192) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -133,9 +133,24 @@ if (param.equals("removeInstruction")) { return removeInstruction(mapping, form, request, response); } + + //-----------------------Preview Learning Object function --------------------------- + if (param.equals("previewLearningObj")) { + return previewLearningObj(mapping, form, request, response); + } return mapping.findForward(ResourceConstants.ERROR); } + private ActionForward previewLearningObj(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + int itemIdx = NumberUtils.stringToInt(request.getParameter(ResourceConstants.PARAM_ITEM_INDEX),-1); + if(itemIdx != -1){ + List resourceList = getResourceList(request); + ResourceItem item = resourceList.get(itemIdx); + request.getSession().setAttribute(ResourceConstants.ATT_LEARNING_OBJECT,item); + } + return mapping.findForward(ResourceConstants.SUCCESS); + } + private ActionForward removeItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { int itemIdx = NumberUtils.stringToInt(request.getParameter(ResourceConstants.PARAM_ITEM_INDEX),-1); if(itemIdx != -1){ @@ -750,11 +765,13 @@ List resourceList = getResourceList(request); int itemIdx = NumberUtils.stringToInt(itemForm.getItemIndex(),-1); ResourceItem item; - if(itemIdx == -1){ + + if(itemIdx == -1){ //add item = new ResourceItem(); resourceList.add(item); - }else + }else //edit item = (ResourceItem) resourceList.get(itemIdx); + item.setType(itemForm.getItemType()); item.setTitle(itemForm.getTitle()); item.setCreateByAuthor(true); Index: lams_tool_larsrc/web/WEB-INF/tiles-defs.xml =================================================================== diff -u -r2116db454fd0ec719a6deeaacd9d10306d341b93 -r0c4f17efc49e7012360fb98ac98b7e4a005fea9f --- lams_tool_larsrc/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 2116db454fd0ec719a6deeaacd9d10306d341b93) +++ lams_tool_larsrc/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -29,7 +29,16 @@ - + + + + + + + + + + @@ -41,5 +50,9 @@ - + + + + + Index: lams_tool_larsrc/web/common/defaultFrame.jsp =================================================================== diff -u --- lams_tool_larsrc/web/common/defaultFrame.jsp (revision 0) +++ lams_tool_larsrc/web/common/defaultFrame.jsp (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,31 @@ + +<%@ include file="/common/taglibs.jsp" %> + + + +
+ + +
+ Please click on a link on the left to start. +
+
\ No newline at end of file Index: lams_tool_larsrc/web/common/footerFrame.jsp =================================================================== diff -u --- lams_tool_larsrc/web/common/footerFrame.jsp (revision 0) +++ lams_tool_larsrc/web/common/footerFrame.jsp (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,16 @@ + + +
+ + +
+ + + + + + +
+
+
+
\ No newline at end of file Index: lams_tool_larsrc/web/common/headerFrame.jsp =================================================================== diff -u --- lams_tool_larsrc/web/common/headerFrame.jsp (revision 0) +++ lams_tool_larsrc/web/common/headerFrame.jsp (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,25 @@ +<%@ include file="/common/taglibs.jsp" %> + + + + +
+ + +
+ + + + + + + + +
+ + + Preview: + +
+
+
\ No newline at end of file Index: lams_tool_larsrc/web/includes/images/spacer.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/includes/javascript/tree.js =================================================================== diff -u --- lams_tool_larsrc/web/includes/javascript/tree.js (revision 0) +++ lams_tool_larsrc/web/includes/javascript/tree.js (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,139 @@ +// Title: Tigra Tree +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu_tree/ +// Version: 1.1 +// Date: 11-12-2002 (mm-dd-yyyy) +// Notes: This script is free. Visit official site for further details. + +function tree (a_items, a_template) { + + this.a_tpl = a_template; + this.a_config = a_items; + this.o_root = this; + this.a_index = []; + this.o_selected = null; + this.n_depth = -1; + + var o_icone = new Image(), + o_iconl = new Image(); + o_icone.src = a_template['icon_e']; + o_iconl.src = a_template['icon_l']; + a_template['im_e'] = o_icone; + a_template['im_l'] = o_iconl; + for (var i = 0; i < 64; i++) + if (a_template['icon_' + i]) { + var o_icon = new Image(); + a_template['im_' + i] = o_icon; + o_icon.src = a_template['icon_' + i]; + } + + this.toggle = function (n_id) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened) }; + this.select = function (n_id) { return this.a_index[n_id].select(); }; + this.mout = function (n_id) { this.a_index[n_id].upstatus(true) }; + this.mover = function (n_id) { this.a_index[n_id].upstatus() }; + + this.a_children = []; + for (var i = 0; i < a_items.length; i++) + new tree_item(this, i); + + this.n_id = trees.length; + trees[this.n_id] = this; + + for (var i = 0; i < this.a_children.length; i++) { + document.write(this.a_children[i].init()); + this.a_children[i].open(); + } +} +function tree_item (o_parent, n_order) { + + this.n_depth = o_parent.n_depth + 1; + this.a_config = o_parent.a_config[n_order + (this.n_depth ? 2 : 0)]; + if (!this.a_config) return; + + this.o_root = o_parent.o_root; + this.o_parent = o_parent; + this.n_order = n_order; + this.b_opened = !this.n_depth; + + this.n_id = this.o_root.a_index.length; + this.o_root.a_index[this.n_id] = this; + o_parent.a_children[n_order] = this; + + this.a_children = []; + for (var i = 0; i < this.a_config.length - 2; i++) + new tree_item(this, i); + + this.get_icon = item_get_icon; + this.open = item_open; + this.select = item_select; + this.init = item_init; + this.upstatus = item_upstatus; + this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 }; +} + +function item_open (b_close) { + var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id); + if (!o_idiv) return; + + if (!o_idiv.innerHTML) { + var a_children = []; + for (var i = 0; i < this.a_children.length; i++) + a_children[i]= this.a_children[i].init(); + o_idiv.innerHTML = a_children.join(''); + } + o_idiv.style.display = (b_close ? 'none' : 'block'); + + this.b_opened = !b_close; + var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id], + o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_jicon) o_jicon.src = this.get_icon(true); + if (o_iicon) o_iicon.src = this.get_icon(); + this.upstatus(); +} + +function item_select (b_deselect) { + if (!b_deselect) { + var o_olditem = this.o_root.o_selected; + this.o_root.o_selected = this; + if (o_olditem) o_olditem.select(true); + } + var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_iicon) o_iicon.src = this.get_icon(); + get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold'; + + this.upstatus(); + return Boolean(this.a_config[1]); +} + +function item_upstatus (b_clear) { + window.setTimeout('window.status="' + (b_clear ? '' : this.a_config[0] + (this.a_config[1] ? ' ('+ this.a_config[1] + ')' : '')) + '"', 10); +} + +function item_init () { + var a_offset = [], + o_current_item = this.o_parent; + for (var i = this.n_depth; i > 1; i--) { + a_offset[i] = ''; + o_current_item = o_current_item.o_parent; + } + //NDPNDP: if the link href='0', then display non-link fields + return '
' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + (this.a_config[1] == 0?'': (''))+'' + this.a_config[0] + (this.a_config[1]== 0?'':'')+'
' + (this.a_children.length ? '' : ''); + /** + return '
' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + '' + this.a_config[0] + '
' + (this.a_children.length ? '' : ''); + **/ +} + +function item_get_icon (b_junction) { + return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))]; +} + +var trees = []; +get_element = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; Index: lams_tool_larsrc/web/includes/javascript/tree_tpl.js =================================================================== diff -u --- lams_tool_larsrc/web/includes/javascript/tree_tpl.js (revision 0) +++ lams_tool_larsrc/web/includes/javascript/tree_tpl.js (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,36 @@ +/* + Feel free to use your custom icons for the tree. Make sure they are all of the same size. + User icons collections are welcome, we'll publish them giving all regards. +*/ + +var TREE_TPL = { + 'target' : 'contentFrame', // name of the frame links will be opened in + // other possible values are: _blank, _parent, _search, _self and _top + + 'icon_e' : 'icons/empty.gif', // empty image + 'icon_l' : 'icons/line.gif', // vertical line + + 'icon_32' : 'icons/base.gif', // root leaf icon normal + 'icon_36' : 'icons/base.gif', // root leaf icon selected + + 'icon_48' : 'icons/base.gif', // root icon normal + 'icon_52' : 'icons/base.gif', // root icon selected + 'icon_56' : 'icons/base.gif', // root icon opened + 'icon_60' : 'icons/base.gif', // root icon selected + + 'icon_16' : 'icons/folder.gif', // node icon normal + 'icon_20' : 'icons/folderopen.gif', // node icon selected + 'icon_24' : 'icons/folderopen.gif', // node icon opened + 'icon_28' : 'icons/folderopen.gif', // node icon selected opened + + 'icon_0' : 'icons/page.gif', // leaf icon normal + 'icon_4' : 'icons/page.gif', // leaf icon selected + + 'icon_2' : 'icons/joinbottom.gif', // junction for leaf + 'icon_3' : 'icons/join.gif', // junction for last leaf + 'icon_18' : 'icons/plusbottom.gif', // junction for closed node + 'icon_19' : 'icons/plus.gif', // junctioin for last closed node + 'icon_26' : 'icons/minusbottom.gif',// junction for opened node + 'icon_27' : 'icons/minus.gif' // junctioin for last opended node +}; + Index: lams_tool_larsrc/web/layout/frame.jsp =================================================================== diff -u --- lams_tool_larsrc/web/layout/frame.jsp (revision 0) +++ lams_tool_larsrc/web/layout/frame.jsp (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,60 @@ + +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <body> + This tool requires the support of frames. Your browser does not support frames. + </body> + + + Index: lams_tool_larsrc/web/pages/authoring/basic.jsp =================================================================== diff -u -r2699ca5080d7ebf1fbcd84c3f5060428b6fbb192 -r0c4f17efc49e7012360fb98ac98b7e4a005fea9f --- lams_tool_larsrc/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 2699ca5080d7ebf1fbcd84c3f5060428b6fbb192) +++ lams_tool_larsrc/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -30,14 +30,14 @@ launchPopup(myUrl,title); } - function previewItem(idx,uuid,versionId){ + function previewItem(type,idx,uuid,versionId){ //2:file, 3:website,4:learning object - if(idx == 2){ - }else if(idx ==3){ + if(type == 2){ + }else if(type ==3){ var myUrl = ""+uuid+"&preferDownload=false"; launchPopup(myUrl,"Website"); - }else if(idx ==4){ - var myUrl = ""+uuid+"&preferDownload=false"; + }else if(type ==4){ + var myUrl = ""+idx; launchPopup(myUrl,"LearningObject"); } Index: lams_tool_larsrc/web/pages/authoring/parts/itemlist.jsp =================================================================== diff -u -r2699ca5080d7ebf1fbcd84c3f5060428b6fbb192 -r0c4f17efc49e7012360fb98ac98b7e4a005fea9f --- lams_tool_larsrc/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision 2699ca5080d7ebf1fbcd84c3f5060428b6fbb192) +++ lams_tool_larsrc/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -32,7 +32,7 @@ ${resource.title} " - onclick="previewItem(2,${resource.fileUuid},${resource.fileVersionId})" class="button"> + onclick="previewItem(2,${status.index},${resource.fileUuid},${resource.fileVersionId})" class="button"> " @@ -50,7 +50,7 @@ ${resource.title} " - onclick="previewItem(3,${resource.fileUuid},${resource.fileVersionId})" class="button"> + onclick="previewItem(3,${status.index},${resource.fileUuid},${resource.fileVersionId})" class="button"> " @@ -68,7 +68,7 @@ ${resource.title} " - onclick="previewItem(4,${resource.fileUuid},${resource.fileVersionId})" class="button"> + onclick="previewItem(4,${status.index},${resource.fileUuid},${resource.fileVersionId})" class="button"> " Index: lams_tool_larsrc/web/pages/learningobj/icons/.cvsignore =================================================================== diff -u --- lams_tool_larsrc/web/pages/learningobj/icons/.cvsignore (revision 0) +++ lams_tool_larsrc/web/pages/learningobj/icons/.cvsignore (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1 @@ +Thumbs.db Index: lams_tool_larsrc/web/pages/learningobj/icons/base.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/empty.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/folder.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/folderopen.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/join.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/joinbottom.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/line.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/minus.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/minusbottom.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/page.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/plus.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/icons/plusbottom.gif =================================================================== diff -u Binary files differ Index: lams_tool_larsrc/web/pages/learningobj/navigatortree.jsp =================================================================== diff -u --- lams_tool_larsrc/web/pages/learningobj/navigatortree.jsp (revision 0) +++ lams_tool_larsrc/web/pages/learningobj/navigatortree.jsp (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,96 @@ + + +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

The content package details are missing.

+
+ +

+


+ + + + + + +

+ +
\ No newline at end of file Index: lams_tool_larsrc/web/pages/learningobj/xmltree.xsl =================================================================== diff -u --- lams_tool_larsrc/web/pages/learningobj/xmltree.xsl (revision 0) +++ lams_tool_larsrc/web/pages/learningobj/xmltree.xsl (revision 0c4f17efc49e7012360fb98ac98b7e4a005fea9f) @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + +var TREE_ITEMS = [ + +]; + + + + + + + ['','', + + ], + + + ['',0, + + ], + + + + + \ No newline at end of file