Index: lams_contentrepository/lib/jakarta-commons/commons-fileupload.jar =================================================================== diff -u Binary files differ Index: lams_contentrepository/web/WEB-INF/struts/.struts-config.mex =================================================================== diff -u -r9521d8efcb3e577a474aed2d2bb69b2231d19801 -r2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4 --- lams_contentrepository/web/WEB-INF/struts/.struts-config.mex (.../.struts-config.mex) (revision 9521d8efcb3e577a474aed2d2bb69b2231d19801) +++ lams_contentrepository/web/WEB-INF/struts/.struts-config.mex (.../.struts-config.mex) (revision 2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4) @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file Index: lams_contentrepository/web/WEB-INF/struts/struts-config.xml =================================================================== diff -u -r9521d8efcb3e577a474aed2d2bb69b2231d19801 -r2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4 --- lams_contentrepository/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 9521d8efcb3e577a474aed2d2bb69b2231d19801) +++ lams_contentrepository/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4) @@ -5,42 +5,49 @@ + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -53,18 +60,27 @@ attribute="loginRepositoryForm" input="/loginRepository.jsp" parameter="method"> - + + + parameter="method"> + + + + path="/addFileContent" + type="com.lamsinternational.lams.contentrepository.struts.action.AddFileContentAction" + name="addFileContentForm" + input="/addNode.jsp" + parameter="method"> + + + Index: lams_contentrepository/web/addNode.jsp =================================================================== diff -u --- lams_contentrepository/web/addNode.jsp (revision 0) +++ lams_contentrepository/web/addNode.jsp (revision 2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4) @@ -0,0 +1,41 @@ +<%@ page language="java"%> + +<%@ taglib uri="/WEB-INF/struts/struts-bean.tld" prefix="bean" %> +<%@ taglib uri="/WEB-INF/struts/struts-html.tld" prefix="html" %> +<%@ taglib uri="/WEB-INF/struts/struts-logic.tld" prefix="logic" %> + + + + Add file or package to workspace + + +

Upload New Content

+ +

Upload some new content. You can either upload a single file or enter a directory name + to upload a package. + You cannot do both. The content will be stored in the repository and it will also be + stored in a map in the session. This map is the equivalent to an application storing the + node uuid and version ids in its own database tables. For the rest of this session, + this data will be used to indicate the filename/directory names of the nodes + in the node list below.

+ + +

Version Description (Required for both):

+

Single File:

+

File to upload?  + +

Package:

+

Directory name:  + Name of initial file in directory.  + + +

 

+

+ + +

+ +
+ + + Index: lams_contentrepository/web/index.html =================================================================== diff -u -r9521d8efcb3e577a474aed2d2bb69b2231d19801 -r2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4 --- lams_contentrepository/web/index.html (.../index.html) (revision 9521d8efcb3e577a474aed2d2bb69b2231d19801) +++ lams_contentrepository/web/index.html (.../index.html) (revision 2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4) @@ -12,8 +12,9 @@

Repository Demo.

This will allow you to view the file in a repository and add new - files. Note: This should not be run on a large workspace otherwise the - "list" page will take a long time to generate. + files.

+

Note: Do not connect / log in to a large workspace otherwise the + "node list" page will take a long time to generate. Start Here Index: lams_contentrepository/web/loggedout.html =================================================================== diff -u --- lams_contentrepository/web/loggedout.html (revision 0) +++ lams_contentrepository/web/loggedout.html (revision 2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4) @@ -0,0 +1,19 @@ + + + + + index.html + + + + + + + +

Logged Out

+

You have logged out of the repository. Although the ticket + still exists in the session, you can't actually do anything with + the repository.

+

Want to see? Try getting the node list.

+ + Index: lams_contentrepository/web/loginRepository.jsp =================================================================== diff -u -r9521d8efcb3e577a474aed2d2bb69b2231d19801 -r2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4 --- lams_contentrepository/web/loginRepository.jsp (.../loginRepository.jsp) (revision 9521d8efcb3e577a474aed2d2bb69b2231d19801) +++ lams_contentrepository/web/loginRepository.jsp (.../loginRepository.jsp) (revision 2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4) @@ -9,19 +9,27 @@

Repository Demonstration

-

Please enter the tools details to examine the repository for this tool/workspace. If you - are using the basic JUNIT test data, use tool name "atool", indentification string "atool" - and workspace name "atoolWorkspace".

- +

The first step in using the repository is to "log in" to a workspace with a tool name and indentification string. + Generally each tool will have its own workspace. If the "log in" is successful, then a Ticket + is returned. This ticket is used to access the workspace (get files, add new files, etc). In + this demonstration, the ticket is placed in the session and the action classes get + the ticket from the session and call the repository.

+

To start, either create your own workspace or log in to an existing workspace. If + the JUNIT test data has been loaded into the database, then there will be a workspace + "atoolWorkspace", with the tool name "atool" and indentification string "atool".

+

To create a new workspace, type in the new values in the fields below and click "createNewWorkspace". + This will create the workspace and log you into the workspace.

+ - +
Tool Name:
Indentification String (aka Password):
Workspace Name
Workspace Name:
- + +
Index: lams_contentrepository/web/nodeSelection.jsp =================================================================== diff -u -r9521d8efcb3e577a474aed2d2bb69b2231d19801 -r2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4 --- lams_contentrepository/web/nodeSelection.jsp (.../nodeSelection.jsp) (revision 9521d8efcb3e577a474aed2d2bb69b2231d19801) +++ lams_contentrepository/web/nodeSelection.jsp (.../nodeSelection.jsp) (revision 2e997e1e672fbb98b6a24a29768fc1d0ac5f4ef4) @@ -2,6 +2,8 @@ <%@ page import="java.util.*"%> <%@ page import="com.lamsinternational.lams.contentrepository.IVersionDetail"%> +<%@ page import="com.lamsinternational.lams.contentrepository.NodeKey"%> +<%@ page import="com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction"%> <%@ taglib uri="/WEB-INF/struts/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts/struts-html.tld" prefix="html" %> @@ -12,37 +14,61 @@ JSP for loginRepositoryForm form -

Select Node

+ +

View Node

+

Click on the numbered button to view the current version of this node. The number is the UUID of the node.

+ +

The nodes with a name in the application cache column have been added in this session and hence the + name is known to the application cache (in the session). The rest of the nodes have been added to the + workspace at some other time.

+

Note: Node 1 for the atool workspace does not have a file in the repository so it will generate an error. This is due to the data being designed for unit testing, not demonstration.

+ +
+ +
+ + +

+ + + + + + <% Iterator iter = nodeMap.keySet().iterator(); - while ( iter.hasNext()) { - Object key = iter.next(); + Map nodeCache = (Map) session.getAttribute(RepositoryDispatchAction.NODE_CACHE); + while ( iter.hasNext()) { + Long key = (Long) iter.next(); %> - + <% Set versionDetails = (Set) nodeMap.get(key); Iterator setIter = versionDetails.iterator(); while ( setIter.hasNext() ) { IVersionDetail detail = (IVersionDetail) setIter.next(); + NodeKey nodeKey = new NodeKey(key, detail.getVersionId()); + String nodeName = nodeCache != null ? (String)nodeCache.get(nodeKey) : ""; %> + <% } // end version details iterator %> - + <% }// end node iterator %>
VersionCreated Date TimeVersion DescriptionFile Name ( Application Cache )
Node
Node
<%=detail.getVersionId()%> <%=detail.getCreatedDateTime()%> <%=detail.getDescription()%><%=nodeName!=null?nodeName:""%>