Index: lams_contentrepository/.classpath =================================================================== diff -u -r3b9090181caef1d6ae8150f3d218c71450b82e13 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/.classpath (.../.classpath) (revision 3b9090181caef1d6ae8150f3d218c71450b82e13) +++ lams_contentrepository/.classpath (.../.classpath) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -1,8 +1,8 @@ - - - + + + Index: lams_contentrepository/.mystrutsdata =================================================================== diff -u -r9521d8efcb3e577a474aed2d2bb69b2231d19801 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/.mystrutsdata (.../.mystrutsdata) (revision 9521d8efcb3e577a474aed2d2bb69b2231d19801) +++ lams_contentrepository/.mystrutsdata (.../.mystrutsdata) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -1,7 +1,7 @@ 1 - com.lamsinternational.lams.struts + org.lamsfoundation.lams.struts 0 action Index: lams_contentrepository/.project =================================================================== diff -u -r9521d8efcb3e577a474aed2d2bb69b2231d19801 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/.project (.../.project) (revision 9521d8efcb3e577a474aed2d2bb69b2231d19801) +++ lams_contentrepository/.project (.../.project) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -3,7 +3,6 @@ lams_contentrepository - lams_common Index: lams_contentrepository/build.xml =================================================================== diff -u -r8042c2dabe3800728a22a8ab916260e3941784df -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/build.xml (.../build.xml) (revision 8042c2dabe3800728a22a8ab916260e3941784df) +++ lams_contentrepository/build.xml (.../build.xml) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -176,8 +176,8 @@ - - + + Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/conf/hibernate/mappings/com/lamsinternational/lams/contentrepository/CrCredential.hbm.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/conf/hibernate/mappings/com/lamsinternational/lams/contentrepository/CrNode.hbm.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/conf/hibernate/mappings/com/lamsinternational/lams/contentrepository/CrNodeVersion.hbm.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/conf/hibernate/mappings/com/lamsinternational/lams/contentrepository/CrNodeVersionProperty.hbm.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/conf/hibernate/mappings/com/lamsinternational/lams/contentrepository/CrWorkspace.hbm.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/conf/hibernate/mappings/com/lamsinternational/lams/contentrepository/CrWorkspaceCredential.hbm.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrCredential.hbm.xml =================================================================== diff -u --- lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrCredential.hbm.xml (revision 0) +++ lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrCredential.hbm.xml (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,107 @@ + + + + + + + + + @hibernate.class + table="lams_cr_credential" + + true + + + + @hibernate.id + generator-class="identity" + type="java.lang.Long" + column="credential_id" + unsaved-value="0" + + + + true + + + + + true + true + + @hibernate.property + column="name" + unique="true" + length="255" + not-null="true" + + + + true + + @hibernate.property + column="password" + length="255" + not-null="true" + + + + + + + + + @hibernate.set + lazy="true" + inverse="true" + cascade="none" + + @hibernate.collection-key + column="credential_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential" + + + + + + + + + Index: lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNode.hbm.xml =================================================================== diff -u --- lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNode.hbm.xml (revision 0) +++ lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNode.hbm.xml (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,145 @@ + + + + + + + + + @hibernate.class + table="lams_cr_node" + + true + + + + @hibernate.id + generator-class="identity" + type="java.lang.Long" + column="node_id" + unsaved-value="0" + + + + true + + + + + true + true + + @hibernate.property + column="path" + length="255" + + + + true + true + + @hibernate.property + column="type" + length="255" + not-null="true" + + + + true + true + + @hibernate.property + column="created_date_time" + length="14" + + + + true + true + + @hibernate.property + type="java.lang.Long" + column="next_version_id" + + + + + + + + + @hibernate.set + lazy="false" + inverse="true" + cascade="all-delete-orphan" + + @hibernate.collection-key + column="node_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.contentrepository.CrNodeVersion" + + + + + + + + + true + + @hibernate.many-to-one + not-null="true" + @hibernate.column name="workspace_id" + + + + + + Index: lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNodeVersion.hbm.xml =================================================================== diff -u --- lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNodeVersion.hbm.xml (revision 0) +++ lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNodeVersion.hbm.xml (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,159 @@ + + + + + + + + + @hibernate.class + table="lams_cr_node_version" + + true + + + + @hibernate.id + generator-class="identity" + type="java.lang.Long" + column="nv_id" + unsaved-value="0" + + + + true + + + + + true + true + + @hibernate.property + column="version_id" + length="20" + not-null="true" + + + + true + true + + @hibernate.property + column="created_date_time" + length="14" + + + + + + + + true + + @hibernate.many-to-one + not-null="true" + @hibernate.column name="node_id" + + + + + + + true + + @hibernate.many-to-one + not-null="true" + @hibernate.column name="parent_nv_id" + + + + + + + @hibernate.set + lazy="true" + inverse="false" + cascade="all-delete-orphan" + + @hibernate.collection-key + column="parent_nv_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.contentrepository.CrNodeVersion" + + + + + + + + + + @hibernate.set + lazy="false" + inverse="true" + cascade="all-delete-orphan" + + @hibernate.collection-key + column="nv_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty" + + + + + + + + + Index: lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.hbm.xml =================================================================== diff -u --- lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.hbm.xml (revision 0) +++ lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.hbm.xml (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,111 @@ + + + + + + + + + @hibernate.class + table="lams_cr_node_version_property" + + true + IValue + + + + @hibernate.id + generator-class="identity" + type="java.lang.Long" + column="id" + unsaved-value="0" + + + + true + + + + + true + true + + @hibernate.property + column="name" + length="255" + not-null="true" + + + + true + true + + @hibernate.property + column="value" + length="255" + not-null="true" + + + + true + true + + @hibernate.property + column="type" + length="3" + not-null="true" + + + + + + + + true + + @hibernate.many-to-one + not-null="true" + @hibernate.column name="nv_id" + + + + + + Index: lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrWorkspace.hbm.xml =================================================================== diff -u --- lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrWorkspace.hbm.xml (revision 0) +++ lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrWorkspace.hbm.xml (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,117 @@ + + + + + + + + + @hibernate.class + table="lams_cr_workspace" + + true + IWorkspace + + + + @hibernate.id + generator-class="identity" + type="java.lang.Long" + column="workspace_id" + unsaved-value="0" + + + + true + + + + + true + true + + @hibernate.property + column="name" + length="255" + not-null="true" + + + + + + + + + @hibernate.set + lazy="true" + inverse="true" + cascade="none" + + @hibernate.collection-key + column="workspace_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential" + + + + + + + + + + @hibernate.set + lazy="true" + inverse="true" + cascade="none" + + @hibernate.collection-key + column="workspace_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.contentrepository.CrNode" + + + + + + + + + Index: lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.hbm.xml =================================================================== diff -u --- lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.hbm.xml (revision 0) +++ lams_contentrepository/conf/hibernate/mappings/org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.hbm.xml (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,76 @@ + + + + + + + + + @hibernate.class + table="lams_cr_workspace_credential" + + true + + + + @hibernate.id + generator-class="identity" + type="java.lang.Long" + column="wc_id" + unsaved-value="0" + + + + true + + + + + + + + + true + + @hibernate.many-to-one + not-null="true" + @hibernate.column name="workspace_id" + + + + + + true + + @hibernate.many-to-one + not-null="true" + @hibernate.column name="credential_id" + + + + + + Index: lams_contentrepository/doc/allclasses-frame.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/allclasses-frame.html (.../allclasses-frame.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/allclasses-frame.html (.../allclasses-frame.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + All Classes @@ -20,112 +20,130 @@ -
AccessDeniedException +AccessDeniedException
-AddFileContentAction +AddFileContentAction
-AddFileContentForm +AddFileContentForm
-CheckCredentialTicketBeforeAdvice +AllTests
-CrCredential +BaseTestCase
-CrNode +CheckCredentialTicketBeforeAdvice
-CrNodeVersion +CrCredential
-CrNodeVersionProperty +CrNode
-CrWorkspace +CrNodeVersion
-CrWorkspaceCredential +CrNodeVersionProperty
-CredentialDAO +CrWorkspace
-Download +CrWorkspaceCredential
-FileDAO +CredentialDAO
-FileException +Download
-ICredentialDAO +FileDAO
-ICredentials +FileException
-IFileDAO +ICredentialDAO
-INodeDAO +ICredentials
-IRepository +IFileDAO
-IRepositoryAdmin +INodeDAO
-ITicket +IRepository
-IValue +IRepositoryAdmin
-IVersionDetail +ITicket
-IVersionedNode +IValue
-IVersionedNodeAdmin +IVersionDetail
-IWorkspace +IVersionedNode
-IWorkspaceDAO +IVersionedNodeAdmin
-InvalidParameterException +IWorkspace
-ItemExistsException +IWorkspaceDAO
-ItemNotFoundException +InvalidParameterException
-LoginException +ItemExistsException
-LoginRepositoryAction +ItemNotFoundException
-LoginRepositoryForm +LoginException
-NoSuchNodeTypeException +LoginRepositoryAction
-NodeDAO +LoginRepositoryForm
-NodeKey +NoSuchNodeTypeException
-NodeSelectionAction +NodeDAO
-NodeSelectionForm +NodeKey
-NodeType +NodeSelectionAction
-PropertyName +NodeSelectionForm
-PropertyType +NodeTransactionTest
-RepositoryCheckedException +NodeType
-RepositoryDispatchAction +PropertyName
-RepositoryRuntimeException +PropertyType
-SimpleCredentials +RepositoryCheckedException
-SimpleRepository +RepositoryDispatchAction
-SimpleTicket +RepositoryRuntimeException
-SimpleVersionDetail +SimpleCredentials
-SimpleVersionedNode +SimpleRepository
-ValidationException +SimpleTicket
-ValueFormatException +SimpleVersionDetail
-WorkspaceDAO +SimpleVersionedNode
-WorkspaceNotFoundException +TestFileDAO
+TestLogin +
+TestSimpleRepository +
+TestSimpleTicket +
+TestSimpleVersionDetail +
+TestSimpleVersionedNode +
+ValidationException +
+ValueFormatException +
+WorkspaceDAO +
+WorkspaceNotFoundException +
Index: lams_contentrepository/doc/allclasses-noframe.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/allclasses-noframe.html (.../allclasses-noframe.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/allclasses-noframe.html (.../allclasses-noframe.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + All Classes @@ -20,112 +20,130 @@ -
AccessDeniedException +AccessDeniedException
-AddFileContentAction +AddFileContentAction
-AddFileContentForm +AddFileContentForm
-CheckCredentialTicketBeforeAdvice +AllTests
-CrCredential +BaseTestCase
-CrNode +CheckCredentialTicketBeforeAdvice
-CrNodeVersion +CrCredential
-CrNodeVersionProperty +CrNode
-CrWorkspace +CrNodeVersion
-CrWorkspaceCredential +CrNodeVersionProperty
-CredentialDAO +CrWorkspace
-Download +CrWorkspaceCredential
-FileDAO +CredentialDAO
-FileException +Download
-ICredentialDAO +FileDAO
-ICredentials +FileException
-IFileDAO +ICredentialDAO
-INodeDAO +ICredentials
-IRepository +IFileDAO
-IRepositoryAdmin +INodeDAO
-ITicket +IRepository
-IValue +IRepositoryAdmin
-IVersionDetail +ITicket
-IVersionedNode +IValue
-IVersionedNodeAdmin +IVersionDetail
-IWorkspace +IVersionedNode
-IWorkspaceDAO +IVersionedNodeAdmin
-InvalidParameterException +IWorkspace
-ItemExistsException +IWorkspaceDAO
-ItemNotFoundException +InvalidParameterException
-LoginException +ItemExistsException
-LoginRepositoryAction +ItemNotFoundException
-LoginRepositoryForm +LoginException
-NoSuchNodeTypeException +LoginRepositoryAction
-NodeDAO +LoginRepositoryForm
-NodeKey +NoSuchNodeTypeException
-NodeSelectionAction +NodeDAO
-NodeSelectionForm +NodeKey
-NodeType +NodeSelectionAction
-PropertyName +NodeSelectionForm
-PropertyType +NodeTransactionTest
-RepositoryCheckedException +NodeType
-RepositoryDispatchAction +PropertyName
-RepositoryRuntimeException +PropertyType
-SimpleCredentials +RepositoryCheckedException
-SimpleRepository +RepositoryDispatchAction
-SimpleTicket +RepositoryRuntimeException
-SimpleVersionDetail +SimpleCredentials
-SimpleVersionedNode +SimpleRepository
-ValidationException +SimpleTicket
-ValueFormatException +SimpleVersionDetail
-WorkspaceDAO +SimpleVersionedNode
-WorkspaceNotFoundException +TestFileDAO
+TestLogin +
+TestSimpleRepository +
+TestSimpleTicket +
+TestSimpleVersionDetail +
+TestSimpleVersionedNode +
+ValidationException +
+ValueFormatException +
+WorkspaceDAO +
+WorkspaceNotFoundException +
Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/AccessDeniedException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/AllTests.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/BaseTestCase.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/CheckCredentialTicketBeforeAdvice.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/CrCredential.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/CrNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/CrNodeVersion.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/CrNodeVersionProperty.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/CrWorkspace.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/CrWorkspaceCredential.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/FileException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/ICredentials.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/IRepository.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/IRepositoryAdmin.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/ITicket.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/IValue.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/IVersionDetail.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/IVersionedNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/IVersionedNodeAdmin.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/IWorkspace.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/InvalidParameterException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/ItemExistsException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/ItemNotFoundException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/LoginException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/NoSuchNodeTypeException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/NodeKey.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/NodeTransactionTest.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/NodeType.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/PropertyName.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/PropertyType.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/RepositoryCheckedException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/RepositoryRuntimeException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/SimpleCredentials.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/SimpleRepository.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/SimpleTicket.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/SimpleVersionDetail.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/SimpleVersionedNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/TestSimpleRepository.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/TestSimpleTicket.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/TestSimpleVersionDetail.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/TestSimpleVersionedNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/ValidationException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/ValueFormatException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/WorkspaceNotFoundException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/AccessDeniedException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/AllTests.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/BaseTestCase.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/CheckCredentialTicketBeforeAdvice.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/CrCredential.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/CrNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/CrNodeVersion.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/CrNodeVersionProperty.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/CrWorkspace.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/CrWorkspaceCredential.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/FileException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/ICredentials.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/IRepository.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/IRepositoryAdmin.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/ITicket.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/IValue.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/IVersionDetail.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/IVersionedNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/IVersionedNodeAdmin.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/IWorkspace.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/InvalidParameterException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/ItemExistsException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/ItemNotFoundException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/LoginException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/NoSuchNodeTypeException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/NodeKey.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/NodeTransactionTest.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/NodeType.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/PropertyName.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/PropertyType.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/RepositoryCheckedException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/RepositoryRuntimeException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/SimpleCredentials.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/SimpleRepository.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/SimpleTicket.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/SimpleVersionDetail.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/SimpleVersionedNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/TestSimpleRepository.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/TestSimpleTicket.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/TestSimpleVersionDetail.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/TestSimpleVersionedNode.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/ValidationException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/ValueFormatException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/class-use/WorkspaceNotFoundException.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/ICredentialDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/IFileDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/INodeDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/IWorkspaceDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/class-use/ICredentialDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/class-use/IFileDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/class-use/INodeDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/class-use/IWorkspaceDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/FileDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/TestFileDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/class-use/FileDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/class-use/TestFileDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/package-frame.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/package-summary.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/package-tree.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/file/package-use.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/CredentialDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/NodeDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/WorkspaceDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/class-use/CredentialDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/class-use/NodeDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/class-use/WorkspaceDAO.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/package-frame.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/package-summary.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/package-tree.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/hibernate/package-use.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/package-frame.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/package-summary.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/package-tree.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/dao/package-use.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/package-frame.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/package-summary.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/package-tree.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/package-use.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/AddFileContentAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/Download.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/LoginRepositoryAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/NodeSelectionAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/RepositoryDispatchAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/class-use/AddFileContentAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/class-use/Download.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/class-use/LoginRepositoryAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/class-use/NodeSelectionAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/class-use/RepositoryDispatchAction.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/package-frame.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/package-summary.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/package-tree.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/action/package-use.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/AddFileContentForm.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/LoginRepositoryForm.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/NodeSelectionForm.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/class-use/AddFileContentForm.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/class-use/LoginRepositoryForm.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/class-use/NodeSelectionForm.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/package-frame.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/package-summary.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/package-tree.html'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 09decccca1a4d871be5772d51638fa13aa928349 refers to a dead (removed) revision in file `lams_contentrepository/doc/com/lamsinternational/lams/contentrepository/struts/form/package-use.html'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_contentrepository/doc/constant-values.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/constant-values.html (.../constant-values.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/constant-values.html (.../constant-values.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + Constant Field Values @@ -78,33 +78,33 @@
Contents - + +org.lamsfoundation.*
-com.lamsinternational.*

- + - - - + + - - + @@ -117,24 +117,24 @@
com.lamsinternational.lams.contentrepository.IRepositoryorg.lamsfoundation.lams.contentrepository.IRepository
+ public static final java.lang.StringREPOSITORY_CONTEXT_PATH"/com/lamsinternational/lams/contentrepository/contentRepositoryApplicationContext.xml"REPOSITORY_CONTEXT_PATH"/org/lamsfoundation/lams/contentrepository/contentRepositoryApplicationContext.xml"
+ public static final java.lang.StringREPOSITORY_SERVICE_IDREPOSITORY_SERVICE_ID "repositoryService"
- + - - + - - + - - + @@ -147,30 +147,30 @@
com.lamsinternational.lams.contentrepository.NodeTypeorg.lamsfoundation.lams.contentrepository.NodeType
+ public static final java.lang.StringDATANODEDATANODE "DATANODE"
+ public static final java.lang.StringFILENODEFILENODE "FILENODE"
+ public static final java.lang.StringPACKAGENODEPACKAGENODE "PACKAGENODE"
- + - - + - - + - - + - - + @@ -183,72 +183,72 @@
com.lamsinternational.lams.contentrepository.PropertyNameorg.lamsfoundation.lams.contentrepository.PropertyName
+ public static final java.lang.StringFILENAMEFILENAME "FILENAME"
+ public static final java.lang.StringINITIALPATHINITIALPATH "INITIALPATH"
+ public static final java.lang.StringMIMETYPEMIMETYPE "MIMETYPE"
+ public static final java.lang.StringVERSIONDESCVERSIONDESC "VERSIONDESC"
- + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + @@ -261,54 +261,54 @@
com.lamsinternational.lams.contentrepository.PropertyTypeorg.lamsfoundation.lams.contentrepository.PropertyType
+ public static final intBOOLEANBOOLEAN 5
+ public static final intDATEDATE 4
+ public static final intDOUBLEDOUBLE 3
+ public static final intLONGLONG 2
+ public static final intSTRINGSTRING 1
+ public static final java.lang.StringTYPENAME_BOOLEANTYPENAME_BOOLEAN "Boolean"
+ public static final java.lang.StringTYPENAME_DATETYPENAME_DATE "Date"
+ public static final java.lang.StringTYPENAME_DOUBLETYPENAME_DOUBLE "Double"
+ public static final java.lang.StringTYPENAME_LONGTYPENAME_LONG "Long"
+ public static final java.lang.StringTYPENAME_STRINGTYPENAME_STRING "String"
+ public static final intUNDEFINEDUNDEFINED 0
- + - - + - - + - - + - - + - - + - - + - - + - - + Index: lams_contentrepository/doc/deprecated-list.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/deprecated-list.html (.../deprecated-list.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/deprecated-list.html (.../deprecated-list.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + Deprecated List Index: lams_contentrepository/doc/help-doc.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/help-doc.html (.../help-doc.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/help-doc.html (.../help-doc.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + API Help Index: lams_contentrepository/doc/index-files/index-1.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-1.html (.../index-1.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-1.html (.../index-1.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + A-Index @@ -71,63 +71,66 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW

A

-
AccessDeniedException - exception com.lamsinternational.lams.contentrepository.AccessDeniedException.
The current ticket doesn't have sufficient rights for the requested action.
AccessDeniedException() - -Constructor for class com.lamsinternational.lams.contentrepository.AccessDeniedException +
AccessDeniedException - exception org.lamsfoundation.lams.contentrepository.AccessDeniedException.
The current ticket doesn't have sufficient rights for the requested action.
AccessDeniedException() - +Constructor for class org.lamsfoundation.lams.contentrepository.AccessDeniedException
Constructs a new instance of this class. -
AccessDeniedException(String) - -Constructor for class com.lamsinternational.lams.contentrepository.AccessDeniedException +
AccessDeniedException(String) - +Constructor for class org.lamsfoundation.lams.contentrepository.AccessDeniedException
Constructs a new instance of this class given a message describing the failure cause. -
AccessDeniedException(String, Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.AccessDeniedException +
AccessDeniedException(String, Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.AccessDeniedException
Constructs a new instance of this class given a message describing the failure and a root throwable. -
AccessDeniedException(Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.AccessDeniedException +
AccessDeniedException(Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.AccessDeniedException
Constructs a new instance of this class given a root throwable. -
AddFileContentAction - class com.lamsinternational.lams.contentrepository.struts.action.AddFileContentAction.
MyEclipse Struts +
AddFileContentAction - class org.lamsfoundation.lams.contentrepository.struts.action.AddFileContentAction.
MyEclipse Struts Creation date: 11-30-2004 - XDoclet definition:
AddFileContentAction() - -Constructor for class com.lamsinternational.lams.contentrepository.struts.action.AddFileContentAction + XDoclet definition:
AddFileContentAction() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.action.AddFileContentAction
  -
AddFileContentForm - class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm.
MyEclipse Struts +
AddFileContentForm - class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm.
MyEclipse Struts Creation date: 11-30-2004 - XDoclet definition:
AddFileContentForm() - -Constructor for class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm + XDoclet definition:
AddFileContentForm() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm
  -
addChildNodeVersion(CrNodeVersion) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion +
AllTests - class org.lamsfoundation.lams.contentrepository.AllTests.
Runs all the currently implemented tests for the Content Repository.
AllTests() - +Constructor for class org.lamsfoundation.lams.contentrepository.AllTests +
  +
addChildNodeVersion(CrNodeVersion) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion
Add a child node to the childNodeVersions collection. -
addFileItem(ITicket, InputStream, String, String, String) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository +
addFileItem(ITicket, InputStream, String, String, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository
Add a new file to the repository. -
addFileItem(ITicket, InputStream, String, String, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
addFileItem(ITicket, InputStream, String, String, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository
  -
addPackageItem(ITicket, String, String, String) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository +
addPackageItem(ITicket, String, String, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository
Add a new package of files to the repository. -
addPackageItem(ITicket, String, String, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
addPackageItem(ITicket, String, String, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository
  -
addWorkspace(ICredentials, String) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository +
addWorkspace(ICredentials, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository
Create a new workspace, with the tool identified in the creditials as the owner. -
addWorkspace(ICredentials, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
addWorkspace(ICredentials, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository
Add a workspace, giving the credentials as the user of this workspace. -
assignCredentials(ICredentials, String) - -Method in interface com.lamsinternational.lams.contentrepository.IRepositoryAdmin +
assignCredentials(ICredentials, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepositoryAdmin
  -
assignCredentials(ICredentials, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
assignCredentials(ICredentials, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository
Assign credentials to a workspace.

@@ -182,7 +185,7 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW
Index: lams_contentrepository/doc/index-files/index-10.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-10.html (.../index-10.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-10.html (.../index-10.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + L-Index @@ -71,61 +71,61 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW

L

-
LOGOUT_PATH - -Static variable in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
LOGOUT_PATH - +Static variable in class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
  -
LONG - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType +
LONG - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType
Long property type -
LoginException - exception com.lamsinternational.lams.contentrepository.LoginException.
Login failed.
LoginException() - -Constructor for class com.lamsinternational.lams.contentrepository.LoginException +
LoginException - exception org.lamsfoundation.lams.contentrepository.LoginException.
Login failed.
LoginException() - +Constructor for class org.lamsfoundation.lams.contentrepository.LoginException
Constructs a new instance of this class. -
LoginException(String) - -Constructor for class com.lamsinternational.lams.contentrepository.LoginException +
LoginException(String) - +Constructor for class org.lamsfoundation.lams.contentrepository.LoginException
Constructs a new instance of this class given a message describing the failure cause. -
LoginException(String, Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.LoginException +
LoginException(String, Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.LoginException
Constructs a new instance of this class given a message describing the failure and a root throwable. -
LoginException(Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.LoginException +
LoginException(Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.LoginException
Constructs a new instance of this class given a root throwable. -
LoginRepositoryAction - class com.lamsinternational.lams.contentrepository.struts.action.LoginRepositoryAction.
MyEclipse Struts +
LoginRepositoryAction - class org.lamsfoundation.lams.contentrepository.struts.action.LoginRepositoryAction.
MyEclipse Struts Creation date: 01-13-2005 The exceptions will be handled by struts but are listed explicitly - here so (1) I can log them and (2) you can see what exceptions are thrown.
LoginRepositoryAction() - -Constructor for class com.lamsinternational.lams.contentrepository.struts.action.LoginRepositoryAction + here so (1) I can log them and (2) you can see what exceptions are thrown.
LoginRepositoryAction() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.action.LoginRepositoryAction
  -
LoginRepositoryForm - class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm.
MyEclipse Struts +
LoginRepositoryForm - class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm.
MyEclipse Struts Creation date: 01-13-2005 - XDoclet definition:
LoginRepositoryForm() - -Constructor for class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm + XDoclet definition:
LoginRepositoryForm() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm
  -
login(ICredentials, String) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository +
login(ICredentials, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository
Login, creating a new ticket for the given credentials and specified workspace. -
login(ICredentials, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
login(ICredentials, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository
  -
loginToWorkspace(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - -Method in class com.lamsinternational.lams.contentrepository.struts.action.LoginRepositoryAction +
loginToWorkspace(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - +Method in class org.lamsfoundation.lams.contentrepository.struts.action.LoginRepositoryAction
Login to the repository -
logout(ITicket) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository +
logout(ITicket) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository
Finish using this ticket. -
logout(ITicket) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
logout(ITicket) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository
  -
logout(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - -Method in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
logout(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - +Method in class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
Logout of the workspace.

@@ -180,7 +180,7 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW
Index: lams_contentrepository/doc/index-files/index-11.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-11.html (.../index-11.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-11.html (.../index-11.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + M-Index @@ -71,12 +71,12 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW

M

-
MIMETYPE - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyName +
MIMETYPE - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyName
MIMETYPE is required for a file node - it is set by the call to add the file stream.

@@ -131,7 +131,7 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW
Index: lams_contentrepository/doc/index-files/index-12.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-12.html (.../index-12.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-12.html (.../index-12.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + N-Index @@ -71,49 +71,52 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW

N

-
NODE_LIST_NAME - -Static variable in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
NODE_LIST_NAME - +Static variable in class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
  -
NoSuchNodeTypeException - exception com.lamsinternational.lams.contentrepository.NoSuchNodeTypeException.
Tried to create a node with an unknown type.
NoSuchNodeTypeException() - -Constructor for class com.lamsinternational.lams.contentrepository.NoSuchNodeTypeException +
NoSuchNodeTypeException - exception org.lamsfoundation.lams.contentrepository.NoSuchNodeTypeException.
Tried to create a node with an unknown type.
NoSuchNodeTypeException() - +Constructor for class org.lamsfoundation.lams.contentrepository.NoSuchNodeTypeException
Constructs a new instance of this class. -
NoSuchNodeTypeException(String) - -Constructor for class com.lamsinternational.lams.contentrepository.NoSuchNodeTypeException +
NoSuchNodeTypeException(String) - +Constructor for class org.lamsfoundation.lams.contentrepository.NoSuchNodeTypeException
Constructs a new instance of this class given a message describing the failure cause. -
NoSuchNodeTypeException(String, Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.NoSuchNodeTypeException +
NoSuchNodeTypeException(String, Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.NoSuchNodeTypeException
Constructs a new instance of this class given a message describing the failure and a root throwable. -
NoSuchNodeTypeException(Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.NoSuchNodeTypeException +
NoSuchNodeTypeException(Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.NoSuchNodeTypeException
Constructs a new instance of this class given a root throwable. -
NodeDAO - class com.lamsinternational.lams.contentrepository.dao.hibernate.NodeDAO.
Data access routines for Nodes
NodeDAO() - -Constructor for class com.lamsinternational.lams.contentrepository.dao.hibernate.NodeDAO +
NodeDAO - class org.lamsfoundation.lams.contentrepository.dao.hibernate.NodeDAO.
Data access routines for Nodes
NodeDAO() - +Constructor for class org.lamsfoundation.lams.contentrepository.dao.hibernate.NodeDAO
  -
NodeKey - class com.lamsinternational.lams.contentrepository.NodeKey.
Represents the two part key - UUID and version.
NodeKey(Long, Long) - -Constructor for class com.lamsinternational.lams.contentrepository.NodeKey +
NodeKey - class org.lamsfoundation.lams.contentrepository.NodeKey.
Represents the two part key - UUID and version.
NodeKey(Long, Long) - +Constructor for class org.lamsfoundation.lams.contentrepository.NodeKey
  -
NodeSelectionAction - class com.lamsinternational.lams.contentrepository.struts.action.NodeSelectionAction.
MyEclipse Struts +
NodeSelectionAction - class org.lamsfoundation.lams.contentrepository.struts.action.NodeSelectionAction.
MyEclipse Struts Creation date: 01-13-2005 The exceptions will be handled by struts but are listed explicitly - here so (1) I can log them and (2) you can see what exceptions are thrown.
NodeSelectionAction() - -Constructor for class com.lamsinternational.lams.contentrepository.struts.action.NodeSelectionAction + here so (1) I can log them and (2) you can see what exceptions are thrown.
NodeSelectionAction() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.action.NodeSelectionAction
  -
NodeSelectionForm - class com.lamsinternational.lams.contentrepository.struts.form.NodeSelectionForm.
Didn't want to create this class, but I keep getting "Cannot retrieve definition for form bean null" - exception so it was just easier to write it and ignore it...
NodeSelectionForm() - -Constructor for class com.lamsinternational.lams.contentrepository.struts.form.NodeSelectionForm +
NodeSelectionForm - class org.lamsfoundation.lams.contentrepository.struts.form.NodeSelectionForm.
Didn't want to create this class, but I keep getting "Cannot retrieve definition for form bean null" + exception so it was just easier to write it and ignore it...
NodeSelectionForm() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.form.NodeSelectionForm
  -
NodeType - class com.lamsinternational.lams.contentrepository.NodeType.
Defines the types of nodes.
NodeType() - -Constructor for class com.lamsinternational.lams.contentrepository.NodeType +
NodeTransactionTest - class org.lamsfoundation.lams.contentrepository.NodeTransactionTest.
Test the node's transaction handling.
NodeTransactionTest(String) - +Constructor for class org.lamsfoundation.lams.contentrepository.NodeTransactionTest +
Constructor for NodeTransactionTest. +
NodeType - class org.lamsfoundation.lams.contentrepository.NodeType.
Defines the types of nodes.
NodeType() - +Constructor for class org.lamsfoundation.lams.contentrepository.NodeType
  -
nameFromValue(int) - -Static method in class com.lamsinternational.lams.contentrepository.PropertyType +
nameFromValue(int) - +Static method in class org.lamsfoundation.lams.contentrepository.PropertyType
Returns the name of the specified type.

@@ -168,7 +171,7 @@ -ABCDEFGHILMNPRSTUVW
+ABCDEFGHILMNOPRSTUVW
Index: lams_contentrepository/doc/index-files/index-13.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-13.html (.../index-13.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-13.html (.../index-13.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,9 +2,9 @@ - + -P-Index +O-Index @@ -13,7 +13,7 @@ @@ -71,20 +71,11 @@ -ABCDEFGHILMNPRSTUVW
-

-P

+ABCDEFGHILMNOPRSTUVW
+

+O

-
PACKAGENODE - -Static variable in class com.lamsinternational.lams.contentrepository.NodeType -
Node represents a package of other nodes -
PACKAGE_LIST - -Static variable in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction -
  -
PropertyName - class com.lamsinternational.lams.contentrepository.PropertyName.
 
PropertyName() - -Constructor for class com.lamsinternational.lams.contentrepository.PropertyName -
  -
PropertyType - class com.lamsinternational.lams.contentrepository.PropertyType.
LAMS property types.
+
org.lamsfoundation.lams.contentrepository.dao.file - package org.lamsfoundation.lams.contentrepository.dao.file
 
org.lamsfoundation.lams.contentrepository.dao.hibernate - package org.lamsfoundation.lams.contentrepository.dao.hibernate
 
org.lamsfoundation.lams.contentrepository.struts.action - package org.lamsfoundation.lams.contentrepository.struts.action
 
org.lamsfoundation.lams.contentrepository.struts.form - package org.lamsfoundation.lams.contentrepository.struts.form
 
@@ -137,7 +128,7 @@ -A B C D E F G H I L M N P R S T U V W
+A B C D E F G H I L M N O P R S T U V W
Index: lams_contentrepository/doc/index-files/index-14.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-14.html (.../index-14.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-14.html (.../index-14.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,9 +2,9 @@ - + -R-Index +P-Index @@ -13,7 +13,7 @@ @@ -71,60 +71,20 @@ -A B C D E F G H I L M N P R S T U V W
-

-R

+A B C D E F G H I L M N O P R S T U V W
+

+P

-
REPOSITORY_CONTEXT_PATH - -Static variable in interface com.lamsinternational.lams.contentrepository.IRepository -
String used to define the path to the context file -
REPOSITORY_SERVICE_ID - -Static variable in interface com.lamsinternational.lams.contentrepository.IRepository -
String used to define service in Spring context -
RepositoryCheckedException - exception com.lamsinternational.lams.contentrepository.RepositoryCheckedException.
Main exception thrown by content repository classes.
RepositoryCheckedException() - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryCheckedException -
Constructs a new instance of this class. -
RepositoryCheckedException(String) - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryCheckedException -
Constructs a new instance of this class given a message describing the - failure cause. -
RepositoryCheckedException(String, Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryCheckedException -
Constructs a new instance of this class given a message describing the - failure and a root throwable. -
RepositoryCheckedException(Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryCheckedException -
Constructs a new instance of this class given a root throwable. -
RepositoryDispatchAction - class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction.
Base class for the dispatch actions used in the repository tests.
RepositoryDispatchAction() - -Constructor for class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
PACKAGENODE - +Static variable in class org.lamsfoundation.lams.contentrepository.NodeType +
Node represents a package of other nodes +
PACKAGE_LIST - +Static variable in class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
  -
RepositoryRuntimeException - exception com.lamsinternational.lams.contentrepository.RepositoryRuntimeException.
Main runtime exception thrown by content repository classes.
RepositoryRuntimeException() - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryRuntimeException -
Constructs a new instance of this class. -
RepositoryRuntimeException(String) - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryRuntimeException -
Constructs a new instance of this class given a message describing the - failure cause. -
RepositoryRuntimeException(String, Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryRuntimeException -
Constructs a new instance of this class given a message describing the - failure and a root throwable. -
RepositoryRuntimeException(Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.RepositoryRuntimeException -
Constructs a new instance of this class given a root throwable. -
removeChildNodeVersion(CrNodeVersion) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
Remove a child node to the childNodeVersions collection. -
reset(ActionMapping, HttpServletRequest) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
Method reset -
reset(ActionMapping, HttpServletRequest) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm -
Method reset -
reset(ActionMapping, HttpServletRequest) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.NodeSelectionForm -
Method reset -
+
PropertyName - class org.lamsfoundation.lams.contentrepository.PropertyName.
 
PropertyName() - +Constructor for class org.lamsfoundation.lams.contentrepository.PropertyName +
  +
PropertyType - class org.lamsfoundation.lams.contentrepository.PropertyType.
LAMS property types.
@@ -177,7 +137,7 @@ -A B C D E F G H I L M N P R S T U V W
+A B C D E F G H I L M N O P R S T U V W
Index: lams_contentrepository/doc/index-files/index-15.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-15.html (.../index-15.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-15.html (.../index-15.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,9 +2,9 @@ - + -S-Index +R-Index @@ -13,7 +13,7 @@ @@ -71,217 +71,59 @@ -A B C D E F G H I L M N P R S T U V W
-

-S

+A B C D E F G H I L M N O P R S T U V W
+

+R

-
STRING - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType -
String property type -
SUCCESS_PATH - -Static variable in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
REPOSITORY_CONTEXT_PATH - +Static variable in interface org.lamsfoundation.lams.contentrepository.IRepository +
String used to define the path to the context file +
REPOSITORY_SERVICE_ID - +Static variable in interface org.lamsfoundation.lams.contentrepository.IRepository +
String used to define service in Spring context +
RepositoryCheckedException - exception org.lamsfoundation.lams.contentrepository.RepositoryCheckedException.
Main exception thrown by content repository classes.
RepositoryCheckedException() - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryCheckedException +
Constructs a new instance of this class. +
RepositoryCheckedException(String) - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryCheckedException +
Constructs a new instance of this class given a message describing the + failure cause. +
RepositoryCheckedException(String, Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryCheckedException +
Constructs a new instance of this class given a message describing the + failure and a root throwable. +
RepositoryCheckedException(Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryCheckedException +
Constructs a new instance of this class given a root throwable. +
RepositoryDispatchAction - class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction.
Base class for the dispatch actions used in the repository tests.
RepositoryDispatchAction() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
  -
SimpleCredentials - class com.lamsinternational.lams.contentrepository.SimpleCredentials.
Basic implementation of credentials.
SimpleCredentials(String, char[]) - -Constructor for class com.lamsinternational.lams.contentrepository.SimpleCredentials -
Should only be used by hibernate or package calls. -
SimpleRepository - class com.lamsinternational.lams.contentrepository.SimpleRepository.
Many methods in this class will throw a RepositoryRuntimeException - if the internal data is missing.
SimpleRepository() - -Constructor for class com.lamsinternational.lams.contentrepository.SimpleRepository -
  -
SimpleTicket - class com.lamsinternational.lams.contentrepository.SimpleTicket.
SimpleTicket is a basic implementation of Ticket.
SimpleVersionDetail - class com.lamsinternational.lams.contentrepository.SimpleVersionDetail.
Describes the version details - for displaying a version - history.
SimpleVersionedNode - class com.lamsinternational.lams.contentrepository.SimpleVersionedNode.
This is the default implementation for IVersionedNode.
SimpleVersionedNode() - -Constructor for class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setBeanFactory(BeanFactory) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository -
  -
setBeanFactory(BeanFactory) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setChildNodeVersions(Set) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
Assigns a new set of child nodes. -
setCrCredential(CrCredential) - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspaceCredential -
  -
setCrNodeVersion(CrNodeVersion) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty -
  -
setCrNodeVersionProperties(Set) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
  -
setCrNodeVersions(Set) - -Method in class com.lamsinternational.lams.contentrepository.CrNode -
  -
setCrNodes(Set) - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspace -
  -
setCrWorkspace(CrWorkspace) - -Method in class com.lamsinternational.lams.contentrepository.CrNode -
  -
setCrWorkspace(CrWorkspace) - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspaceCredential -
  -
setCrWorkspaceCredentials(Set) - -Method in class com.lamsinternational.lams.contentrepository.CrCredential -
  -
setCrWorkspaceCredentials(Set) - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspace -
  -
setCreatedDateTime(Date) - -Method in class com.lamsinternational.lams.contentrepository.CrNode -
  -
setCreatedDateTime(Date) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
  -
setCredentialDAO(ICredentialDAO) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository -
  -
setCredentialId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrCredential -
  -
setDescription(String) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
  -
setDirName(String) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
  -
setEntryString(String) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
  -
setFile(InputStream, String, String) - -Method in interface com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin -
Set the file, passed in as an inputstream. -
setFile(InputStream, String, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
Set the file, passed in as an inputstream. -
setFileDAO(IFileDAO) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty -
  -
setIndentificationString(String) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm -
Set the indentificationString. -
setMethod(String) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
  -
setName(String) - -Method in class com.lamsinternational.lams.contentrepository.CrCredential -
  -
setName(String) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty -
  -
setName(String) - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspace -
  -
setNextVersionId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrNode -
  -
setNode(CrNode) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
  -
setNodeDAO(INodeDAO) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setNodeId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrNode -
  -
setNodeMap(Map) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.NodeSelectionForm -
  -
setNvId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
  -
setParentNodeVersion(CrNodeVersion) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
  -
setPassword(String) - -Method in class com.lamsinternational.lams.contentrepository.CrCredential -
  -
setPath(String) - -Method in class com.lamsinternational.lams.contentrepository.CrNode -
  -
setProperty(String, Object, int) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
Set a property value. -
setProperty(String, String, int) - -Method in interface com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin -
Sets the property to a value, based on the specified type, after converting - from the string. -
setProperty(String, String) - -Method in interface com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin -
Sets the property to a STRING value. -
setProperty(String, boolean) - -Method in interface com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin -
Sets the property to a BOOLEAN value. -
setProperty(String, double) - -Method in interface com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin -
Sets the property to a DOUBLE value. -
setProperty(String, long) - -Method in interface com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin -
Sets the property to a LONG value. -
setProperty(String, Calendar) - -Method in interface com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin -
Sets the property a CALENDAR value. -
setProperty(String, String, int) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setProperty(String, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setProperty(String, boolean) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setProperty(String, double) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setProperty(String, long) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setProperty(String, Calendar) - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode -
  -
setRepositoryLocation(String) - -Method in class com.lamsinternational.lams.contentrepository.dao.file.FileDAO -
  -
setTheFile(FormFile) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
Set the theFile. -
setToolName(String) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm -
Set the toolName. -
setType(String) - -Method in class com.lamsinternational.lams.contentrepository.CrNode -
  -
setType(int) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty -
  -
setUuid(Long) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
  -
setValue(String) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty -
  -
setVersionDescription(String) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
Set the version description. -
setVersionId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion -
  -
setWcId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspaceCredential -
  -
setWorkspaceDAO(IWorkspaceDAO) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository -
  -
setWorkspaceId(Long) - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspace -
  -
setWorkspaceName(String) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm -
Set the workspaceName. +
RepositoryRuntimeException - exception org.lamsfoundation.lams.contentrepository.RepositoryRuntimeException.
Main runtime exception thrown by content repository classes.
RepositoryRuntimeException() - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryRuntimeException +
Constructs a new instance of this class. +
RepositoryRuntimeException(String) - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryRuntimeException +
Constructs a new instance of this class given a message describing the + failure cause. +
RepositoryRuntimeException(String, Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryRuntimeException +
Constructs a new instance of this class given a message describing the + failure and a root throwable. +
RepositoryRuntimeException(Throwable) - +Constructor for class org.lamsfoundation.lams.contentrepository.RepositoryRuntimeException +
Constructs a new instance of this class given a root throwable. +
removeChildNodeVersion(CrNodeVersion) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
Remove a child node to the childNodeVersions collection. +
reset(ActionMapping, HttpServletRequest) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm +
Method reset +
reset(ActionMapping, HttpServletRequest) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm +
Method reset +
reset(ActionMapping, HttpServletRequest) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.NodeSelectionForm +
Method reset

@@ -335,7 +177,7 @@ -A B C D E F G H I L M N P R S T U V W
+A B C D E F G H I L M N O P R S T U V W
Index: lams_contentrepository/doc/index-files/index-16.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-16.html (.../index-16.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-16.html (.../index-16.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,9 +2,9 @@ - + -T-Index +S-Index @@ -13,7 +13,7 @@ @@ -71,59 +71,223 @@ -A B C D E F G H I L M N P R S T U V W
-

-T

+A B C D E F G H I L M N O P R S T U V W
+

+S

-
TICKET_NAME - -Static variable in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
STRING - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType +
String property type +
SUCCESS_PATH - +Static variable in class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
  -
TYPENAME_BOOLEAN - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType +
SimpleCredentials - class org.lamsfoundation.lams.contentrepository.SimpleCredentials.
Basic implementation of credentials.
SimpleCredentials(String, char[]) - +Constructor for class org.lamsfoundation.lams.contentrepository.SimpleCredentials +
Should only be used by hibernate or package calls. +
SimpleRepository - class org.lamsfoundation.lams.contentrepository.SimpleRepository.
Many methods in this class will throw a RepositoryRuntimeException + if the internal data is missing.
SimpleRepository() - +Constructor for class org.lamsfoundation.lams.contentrepository.SimpleRepository
  -
TYPENAME_DATE - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType +
SimpleTicket - class org.lamsfoundation.lams.contentrepository.SimpleTicket.
SimpleTicket is a basic implementation of Ticket.
SimpleVersionDetail - class org.lamsfoundation.lams.contentrepository.SimpleVersionDetail.
Describes the version details - for displaying a version + history.
SimpleVersionedNode - class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode.
This is the default implementation for IVersionedNode.
SimpleVersionedNode() - +Constructor for class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode
  -
TYPENAME_DOUBLE - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType +
setBeanFactory(BeanFactory) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository
  -
TYPENAME_LONG - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType +
setBeanFactory(BeanFactory) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode
  -
TYPENAME_STRING - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType -
The names of the supported property types, - as used in serialization. -
toString() - -Method in class com.lamsinternational.lams.contentrepository.CrCredential +
setChildNodeVersions(Set) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
Assigns a new set of child nodes. +
setCrCredential(CrCredential) - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.CrNode +
setCrNodeVersion(CrNodeVersion) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersion +
setCrNodeVersionProperties(Set) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty +
setCrNodeVersions(Set) - +Method in class org.lamsfoundation.lams.contentrepository.CrNode
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspace +
setCrNodes(Set) - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspace
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.CrWorkspaceCredential +
setCrWorkspace(CrWorkspace) - +Method in class org.lamsfoundation.lams.contentrepository.CrNode
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.NodeKey +
setCrWorkspace(CrWorkspace) - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.SimpleTicket +
setCrWorkspaceCredentials(Set) - +Method in class org.lamsfoundation.lams.contentrepository.CrCredential
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionDetail +
setCrWorkspaceCredentials(Set) - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspace
  -
toString() - -Method in class com.lamsinternational.lams.contentrepository.SimpleVersionedNode +
setCreatedDateTime(Date) - +Method in class org.lamsfoundation.lams.contentrepository.CrNode
  +
setCreatedDateTime(Date) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
  +
setCredentialDAO(ICredentialDAO) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository +
  +
setCredentialId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrCredential +
  +
setDescription(String) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm +
  +
setDirName(String) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm +
  +
setEntryString(String) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm +
  +
setFile(InputStream, String, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin +
Set the file, passed in as an inputstream. +
setFile(InputStream, String, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
Set the file, passed in as an inputstream. +
setFileDAO(IFileDAO) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty +
  +
setIndentificationString(String) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm +
Set the indentificationString. +
setMethod(String) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm +
  +
setName(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrCredential +
  +
setName(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty +
  +
setName(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspace +
  +
setNextVersionId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrNode +
  +
setNode(CrNode) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
  +
setNodeDAO(INodeDAO) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setNodeId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrNode +
  +
setNodeMap(Map) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.NodeSelectionForm +
  +
setNvId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
  +
setParentNodeVersion(CrNodeVersion) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
  +
setPassword(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrCredential +
  +
setPath(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrNode +
  +
setProperty(String, Object, int) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
Set a property value. +
setProperty(String, String, int) - +Method in interface org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin +
Sets the property to a value, based on the specified type, after converting + from the string. +
setProperty(String, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin +
Sets the property to a STRING value. +
setProperty(String, boolean) - +Method in interface org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin +
Sets the property to a BOOLEAN value. +
setProperty(String, double) - +Method in interface org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin +
Sets the property to a DOUBLE value. +
setProperty(String, long) - +Method in interface org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin +
Sets the property to a LONG value. +
setProperty(String, Calendar) - +Method in interface org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin +
Sets the property a CALENDAR value. +
setProperty(String, String, int) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setProperty(String, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setProperty(String, boolean) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setProperty(String, double) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setProperty(String, long) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setProperty(String, Calendar) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
  +
setRepositoryLocation(String) - +Method in class org.lamsfoundation.lams.contentrepository.dao.file.FileDAO +
  +
setTheFile(FormFile) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm +
Set the theFile. +
setToolName(String) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm +
Set the toolName. +
setType(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrNode +
  +
setType(int) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty +
  +
setUp() - +Method in class org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO +
  +
setUuid(Long) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm +
  +
setValue(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty +
  +
setVersionDescription(String) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
Set the version description. +
setVersionId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
  +
setWcId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential +
  +
setWorkspaceDAO(IWorkspaceDAO) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository +
  +
setWorkspaceId(Long) - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspace +
  +
setWorkspaceName(String) - +Method in class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm +
Set the workspaceName. +
suite() - +Static method in class org.lamsfoundation.lams.contentrepository.AllTests +
 

@@ -177,7 +341,7 @@ -A B C D E F G H I L M N P R S T U V W
+A B C D E F G H I L M N O P R S T U V W
Index: lams_contentrepository/doc/index-files/index-17.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-17.html (.../index-17.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-17.html (.../index-17.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,9 +2,9 @@ - + -U-Index +T-Index @@ -13,7 +13,7 @@ @@ -71,58 +71,216 @@ -A B C D E F G H I L M N P R S T U V W
-

-U

+A B C D E F G H I L M N O P R S T U V W
+

+T

-
UNDEFINED - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyType -
Undefined type. -
UUID_NAME - -Static variable in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
TICKET_NAME - +Static variable in class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
  -
update(Object) - -Method in interface com.lamsinternational.lams.contentrepository.dao.ICredentialDAO +
TYPENAME_BOOLEAN - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType
  -
update(Object) - -Method in interface com.lamsinternational.lams.contentrepository.dao.INodeDAO +
TYPENAME_DATE - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType
  -
update(Object) - -Method in interface com.lamsinternational.lams.contentrepository.dao.IWorkspaceDAO +
TYPENAME_DOUBLE - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType
  -
update(Object) - -Method in class com.lamsinternational.lams.contentrepository.dao.hibernate.CredentialDAO +
TYPENAME_LONG - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType
  -
update(Object) - -Method in class com.lamsinternational.lams.contentrepository.dao.hibernate.NodeDAO +
TYPENAME_STRING - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType +
The names of the supported property types, + as used in serialization. +
TestFileDAO - class org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO.
 
TestFileDAO() - +Constructor for class org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO
  -
update(Object) - -Method in class com.lamsinternational.lams.contentrepository.dao.hibernate.WorkspaceDAO +
TestLogin - class org.lamsfoundation.lams.contentrepository.struts.action.TestLogin.
This standalone servlet is for performance testing.
TestLogin() - +Constructor for class org.lamsfoundation.lams.contentrepository.struts.action.TestLogin
  -
updateCredentials(ICredentials, ICredentials) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository -
Update a credential. -
updateCredentials(ICredentials, ICredentials) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository -
Update a credential. -
updateFileItem(ITicket, Long, String, InputStream, String, String) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository -
Update an existing file in the repository. -
updateFileItem(ITicket, Long, String, InputStream, String, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
TestSimpleRepository - class org.lamsfoundation.lams.contentrepository.TestSimpleRepository.
Test SimpleRepository and the Credentials code.
TestSimpleRepository() - +Constructor for class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
Constructor for SimpleRepositoryTest. +
TestSimpleTicket - class org.lamsfoundation.lams.contentrepository.TestSimpleTicket.
Test the SimpleTicket class.
TestSimpleTicket() - +Constructor for class org.lamsfoundation.lams.contentrepository.TestSimpleTicket +
Constructor for TestSimpleTicket. +
TestSimpleVersionDetail - class org.lamsfoundation.lams.contentrepository.TestSimpleVersionDetail.
Checks creation and ordering of SimpleVersionDetail objects, + using the IVersionDetail interface.
TestSimpleVersionDetail() - +Constructor for class org.lamsfoundation.lams.contentrepository.TestSimpleVersionDetail
  -
updatePackageItem(ITicket, Long, String, String, String) - -Method in interface com.lamsinternational.lams.contentrepository.IRepository -
Add a new package of files to the repository. -
updatePackageItem(ITicket, Long, String, String, String) - -Method in class com.lamsinternational.lams.contentrepository.SimpleRepository +
TestSimpleVersionedNode - class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode.
 
TestSimpleVersionedNode() - +Constructor for class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
Constructor for TestSimpleVersionedNode. +
testAddNode() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode
  -
uploadFile(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - -Method in class com.lamsinternational.lams.contentrepository.struts.action.AddFileContentAction -
Uploads a single file. -
uploadPackage(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - -Method in class com.lamsinternational.lams.contentrepository.struts.action.AddFileContentAction -
Uploads a package +
testAddNodeBadType() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testAddWorkspace() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testBinaryFileNode() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testClearPropertyStringIValue() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testCompareTo() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionDetail +
  +
testEqualsObject() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionDetail +
  +
testFileItemDeleteNode() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
create a node with two versions and test deleting them using delete node +
testFileItemDeleteNodeFileProb() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
create a node with two versions and test deleting them using delete node + but first rig the files so one of them is already gone and the other one is + read only. +
testFileItemDeleteVersion() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
create a node with two versions and test deleting them using delete version +
testGenerateFilePathEven1() - +Method in class org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO +
  +
testGenerateFilePathEven101() - +Method in class org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO +
  +
testGenerateFilePathOdd1() - +Method in class org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO +
  +
testGenerateFilePathOdd101() - +Method in class org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO +
  +
testGetCreatedDateTime() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionDetail +
  +
testGetCreatedDateTime() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testGetDescription() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionDetail +
  +
testGetNodeType() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testGetPath() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testGetProperties() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testGetTicketId() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleTicket +
  +
testGetVersion() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testGetVersionHistory() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testGetVersionId() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionDetail +
  +
testGetWorkspaceId() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleTicket +
  +
testHasProperties() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testHasProperty() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testIsNodeType() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testLoginFailWrongPassword() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testLoginFailWrongUser() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testLoginFailWrongWorkspaceDoesNotExist() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testLoginFailWrongWorkspaceExists() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testLoginPass() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testLogout() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testPackageItem() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
  +
testSetPropertySpecifiedType() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testSetPropertyStringCalendar() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testSetPropertyStringIValue() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testSetPropertyStringString() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testSetPropertyStringboolean() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testSetPropertyStringdouble() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testSetPropertyStringlong() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testTextFileNode() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleVersionedNode +
  +
testUserAdmin() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
Tests adding a new user and changing a password +
testWrongWorkspaceAccess() - +Method in class org.lamsfoundation.lams.contentrepository.TestSimpleRepository +
Checks that the system will give us an error if we get try to + get a node that belongs to a different workspace to our ticket. +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.CrCredential +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.CrNode +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersion +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspace +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.NodeKey +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.SimpleTicket +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionDetail +
  +
toString() - +Method in class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode +
 

@@ -176,7 +334,7 @@ -A B C D E F G H I L M N P R S T U V W
+A B C D E F G H I L M N O P R S T U V W
Index: lams_contentrepository/doc/index-files/index-18.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-18.html (.../index-18.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-18.html (.../index-18.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,9 +2,9 @@ - + -V-Index +U-Index @@ -13,7 +13,7 @@ @@ -71,61 +71,58 @@ -A B C D E F G H I L M N P R S T U V W
-

-V

+A B C D E F G H I L M N O P R S T U V W
+

+U

-
VERSIONDESC - -Static variable in class com.lamsinternational.lams.contentrepository.PropertyName -
VERSIONDESC is text description relating to a version - It should contain text meaningful to the user. -
VERSION_NAME - -Static variable in class com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchAction +
UNDEFINED - +Static variable in class org.lamsfoundation.lams.contentrepository.PropertyType +
Undefined type. +
UUID_NAME - +Static variable in class org.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
  -
ValidationException - exception com.lamsinternational.lams.contentrepository.ValidationException.
The node is invalid for some reason.
ValidationException() - -Constructor for class com.lamsinternational.lams.contentrepository.ValidationException -
Constructs a new instance of this class. -
ValidationException(String) - -Constructor for class com.lamsinternational.lams.contentrepository.ValidationException -
Constructs a new instance of this class given a message describing the - failure cause. -
ValidationException(String, Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.ValidationException -
Constructs a new instance of this class given a message describing the - failure and a root throwable. -
ValidationException(Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.ValidationException -
Constructs a new instance of this class given a root throwable. -
ValueFormatException - exception com.lamsinternational.lams.contentrepository.ValueFormatException.
Thrown when value is assigned to a propery of the wrong type, or some - other formatting type problem.
ValueFormatException() - -Constructor for class com.lamsinternational.lams.contentrepository.ValueFormatException -
Constructs a new instance of this class. -
ValueFormatException(String) - -Constructor for class com.lamsinternational.lams.contentrepository.ValueFormatException -
Constructs a new instance of this class given a message describing the - failure cause. -
ValueFormatException(String, Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.ValueFormatException -
Constructs a new instance of this class given a message describing the - failure and a root throwable. -
ValueFormatException(Throwable) - -Constructor for class com.lamsinternational.lams.contentrepository.ValueFormatException -
Constructs a new instance of this class given a root throwable. -
validate(ActionMapping, HttpServletRequest) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm -
Method validate -
validate(ActionMapping, HttpServletRequest) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm -
Method validate -
validate(ActionMapping, HttpServletRequest) - -Method in class com.lamsinternational.lams.contentrepository.struts.form.NodeSelectionForm -
Method validate -
valueFromName(String) - -Static method in class com.lamsinternational.lams.contentrepository.PropertyType -
Returns the numeric constant value of the type with the specified name. -
viewPackage(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - -Method in class com.lamsinternational.lams.contentrepository.struts.action.NodeSelectionAction -
Get the list of nodes in the workspace. +
update(Object) - +Method in interface org.lamsfoundation.lams.contentrepository.dao.ICredentialDAO +
  +
update(Object) - +Method in interface org.lamsfoundation.lams.contentrepository.dao.INodeDAO +
  +
update(Object) - +Method in interface org.lamsfoundation.lams.contentrepository.dao.IWorkspaceDAO +
  +
update(Object) - +Method in class org.lamsfoundation.lams.contentrepository.dao.hibernate.CredentialDAO +
  +
update(Object) - +Method in class org.lamsfoundation.lams.contentrepository.dao.hibernate.NodeDAO +
  +
update(Object) - +Method in class org.lamsfoundation.lams.contentrepository.dao.hibernate.WorkspaceDAO +
  +
updateCredentials(ICredentials, ICredentials) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository +
Update a credential. +
updateCredentials(ICredentials, ICredentials) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository +
Update a credential. +
updateFileItem(ITicket, Long, String, InputStream, String, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository +
Update an existing file in the repository. +
updateFileItem(ITicket, Long, String, InputStream, String, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository +
  +
updatePackageItem(ITicket, Long, String, String, String) - +Method in interface org.lamsfoundation.lams.contentrepository.IRepository +
Add a new package of files to the repository. +
updatePackageItem(ITicket, Long, String, String, String) - +Method in class org.lamsfoundation.lams.contentrepository.SimpleRepository +
  +
uploadFile(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - +Method in class org.lamsfoundation.lams.contentrepository.struts.action.AddFileContentAction +
Uploads a single file. +
uploadPackage(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - +Method in class org.lamsfoundation.lams.contentrepository.struts.action.AddFileContentAction +
Uploads a package

@@ -179,7 +176,7 @@ -A B C D E F G H I L M N P R S T U V W
+A B C D E F G H I L M N O P R S T U V W
Index: lams_contentrepository/doc/index-files/index-19.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/index-files/index-19.html (.../index-19.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/index-files/index-19.html (.../index-19.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,9 +2,9 @@ - + -W-Index +V-Index @@ -13,7 +13,7 @@ @@ -50,7 +50,7 @@
NEXT LETTERNEXT LETTER Index: lams_contentrepository/doc/overview-summary.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/overview-summary.html (.../overview-summary.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/overview-summary.html (.../overview-summary.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + Overview @@ -85,29 +85,29 @@ Packages - + - + - + - + - + - +
com.lamsinternational.lams.contentrepository.struts.action.RepositoryDispatchActionorg.lamsfoundation.lams.contentrepository.struts.action.RepositoryDispatchAction
+ public static final java.lang.StringERROR_PATHERROR_PATH "error"
+ public static final java.lang.StringLOGOUT_PATHLOGOUT_PATH "logout"
+ public static final java.lang.StringNODE_LIST_NAMENODE_LIST_NAME "nodeList"
+ public static final java.lang.StringPACKAGE_LISTPACKAGE_LIST "packageList"
+ public static final java.lang.StringSUCCESS_PATHSUCCESS_PATH "success"
+ public static final java.lang.StringTICKET_NAMETICKET_NAME "ticket"
+ public static final java.lang.StringUUID_NAMEUUID_NAME "uuid"
+ public static final java.lang.StringVERSION_NAMEVERSION_NAME "version"
com.lamsinternational.lams.contentrepositoryorg.lamsfoundation.lams.contentrepository This content repository is designed to store single files and packages of files on disk in a relatively.
com.lamsinternational.lams.contentrepository.daoorg.lamsfoundation.lams.contentrepository.dao  
com.lamsinternational.lams.contentrepository.dao.fileorg.lamsfoundation.lams.contentrepository.dao.file  
com.lamsinternational.lams.contentrepository.dao.hibernateorg.lamsfoundation.lams.contentrepository.dao.hibernate  
com.lamsinternational.lams.contentrepository.struts.actionorg.lamsfoundation.lams.contentrepository.struts.action  
com.lamsinternational.lams.contentrepository.struts.formorg.lamsfoundation.lams.contentrepository.struts.form  
Index: lams_contentrepository/doc/overview-tree.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/overview-tree.html (.../overview-tree.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/overview-tree.html (.../overview-tree.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + Class Hierarchy @@ -77,7 +77,7 @@ Hierarchy For All Packages

-
Package Hierarchies:
com.lamsinternational.lams.contentrepository, com.lamsinternational.lams.contentrepository.dao, com.lamsinternational.lams.contentrepository.dao.file, com.lamsinternational.lams.contentrepository.dao.hibernate, com.lamsinternational.lams.contentrepository.struts.action, com.lamsinternational.lams.contentrepository.struts.form
+
Package Hierarchies:
org.lamsfoundation.lams.contentrepository, org.lamsfoundation.lams.contentrepository.dao, org.lamsfoundation.lams.contentrepository.dao.file, org.lamsfoundation.lams.contentrepository.dao.hibernate, org.lamsfoundation.lams.contentrepository.struts.action, org.lamsfoundation.lams.contentrepository.struts.form

Class Hierarchy @@ -86,45 +86,52 @@
  • class java.lang.Object
    • class org.apache.struts.action.Action
    • class org.apache.struts.action.ActionForm (implements java.io.Serializable) -
    • class com.lamsinternational.lams.contentrepository.CheckCredentialTicketBeforeAdvice (implements org.springframework.aop.MethodBeforeAdvice) -
    • class com.lamsinternational.lams.contentrepository.CrCredential (implements java.io.Serializable) -
    • class com.lamsinternational.lams.contentrepository.CrNode (implements java.io.Serializable) -
    • class com.lamsinternational.lams.contentrepository.CrNodeVersion (implements java.io.Serializable) -
    • class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty (implements com.lamsinternational.lams.contentrepository.IValue, java.io.Serializable) -
    • class com.lamsinternational.lams.contentrepository.CrWorkspace (implements com.lamsinternational.lams.contentrepository.IWorkspace, java.io.Serializable) -
    • class com.lamsinternational.lams.contentrepository.CrWorkspaceCredential (implements java.io.Serializable) -
    • class com.lamsinternational.lams.contentrepository.dao.file.FileDAO (implements com.lamsinternational.lams.contentrepository.dao.IFileDAO) +
    • class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm
    • class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm
    • class org.lamsfoundation.lams.contentrepository.struts.form.NodeSelectionForm
    +
  • class org.lamsfoundation.lams.contentrepository.AllTests
  • class junit.framework.Assert +
  • class org.lamsfoundation.lams.contentrepository.CheckCredentialTicketBeforeAdvice (implements org.springframework.aop.MethodBeforeAdvice) +
  • class org.lamsfoundation.lams.contentrepository.CrCredential (implements java.io.Serializable) +
  • class org.lamsfoundation.lams.contentrepository.CrNode (implements java.io.Serializable) +
  • class org.lamsfoundation.lams.contentrepository.CrNodeVersion (implements java.io.Serializable) +
  • class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty (implements org.lamsfoundation.lams.contentrepository.IValue, java.io.Serializable) +
  • class org.lamsfoundation.lams.contentrepository.CrWorkspace (implements org.lamsfoundation.lams.contentrepository.IWorkspace, java.io.Serializable) +
  • class org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential (implements java.io.Serializable) +
  • class org.lamsfoundation.lams.contentrepository.dao.file.FileDAO (implements org.lamsfoundation.lams.contentrepository.dao.IFileDAO)
  • class javax.servlet.GenericServlet (implements java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig)
    • class javax.servlet.http.HttpServlet (implements java.io.Serializable)
        -
      • class com.lamsinternational.lams.contentrepository.struts.action.Download
      +
    • class org.lamsfoundation.lams.contentrepository.struts.action.Download
    • class org.lamsfoundation.lams.contentrepository.struts.action.TestLogin
  • class org.springframework.orm.hibernate.support.HibernateDaoSupport (implements org.springframework.beans.factory.InitializingBean)
      -
    • class com.lamsinternational.lams.contentrepository.dao.hibernate.CredentialDAO (implements com.lamsinternational.lams.contentrepository.dao.ICredentialDAO) -
    • class com.lamsinternational.lams.contentrepository.dao.hibernate.NodeDAO (implements com.lamsinternational.lams.contentrepository.dao.INodeDAO) -
    • class com.lamsinternational.lams.contentrepository.dao.hibernate.WorkspaceDAO (implements com.lamsinternational.lams.contentrepository.dao.IWorkspaceDAO) +
    • class org.lamsfoundation.lams.contentrepository.dao.hibernate.CredentialDAO (implements org.lamsfoundation.lams.contentrepository.dao.ICredentialDAO) +
    • class org.lamsfoundation.lams.contentrepository.dao.hibernate.NodeDAO (implements org.lamsfoundation.lams.contentrepository.dao.INodeDAO) +
    • class org.lamsfoundation.lams.contentrepository.dao.hibernate.WorkspaceDAO (implements org.lamsfoundation.lams.contentrepository.dao.IWorkspaceDAO)
    -
  • class com.lamsinternational.lams.contentrepository.NodeKey
  • class com.lamsinternational.lams.contentrepository.NodeType
  • class com.lamsinternational.lams.contentrepository.PropertyName
  • class com.lamsinternational.lams.contentrepository.PropertyType
  • class com.lamsinternational.lams.contentrepository.SimpleCredentials (implements com.lamsinternational.lams.contentrepository.ICredentials) -
  • class com.lamsinternational.lams.contentrepository.SimpleRepository (implements org.springframework.beans.factory.BeanFactoryAware, com.lamsinternational.lams.contentrepository.IRepositoryAdmin) -
  • class com.lamsinternational.lams.contentrepository.SimpleTicket (implements com.lamsinternational.lams.contentrepository.ITicket) -
  • class com.lamsinternational.lams.contentrepository.SimpleVersionDetail (implements com.lamsinternational.lams.contentrepository.IVersionDetail) -
  • class com.lamsinternational.lams.contentrepository.SimpleVersionedNode (implements org.springframework.beans.factory.BeanFactoryAware, com.lamsinternational.lams.contentrepository.IVersionedNodeAdmin) +
  • class org.lamsfoundation.lams.contentrepository.NodeKey
  • class org.lamsfoundation.lams.contentrepository.NodeType
  • class org.lamsfoundation.lams.contentrepository.PropertyName
  • class org.lamsfoundation.lams.contentrepository.PropertyType
  • class org.lamsfoundation.lams.contentrepository.SimpleCredentials (implements org.lamsfoundation.lams.contentrepository.ICredentials) +
  • class org.lamsfoundation.lams.contentrepository.SimpleRepository (implements org.springframework.beans.factory.BeanFactoryAware, org.lamsfoundation.lams.contentrepository.IRepositoryAdmin) +
  • class org.lamsfoundation.lams.contentrepository.SimpleTicket (implements org.lamsfoundation.lams.contentrepository.ITicket) +
  • class org.lamsfoundation.lams.contentrepository.SimpleVersionDetail (implements org.lamsfoundation.lams.contentrepository.IVersionDetail) +
  • class org.lamsfoundation.lams.contentrepository.SimpleVersionedNode (implements org.springframework.beans.factory.BeanFactoryAware, org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin)
  • class java.lang.Throwable (implements java.io.Serializable) @@ -134,13 +141,13 @@
    • interface java.lang.Comparable
        -
      • interface com.lamsinternational.lams.contentrepository.IVersionDetail
      -
    • interface com.lamsinternational.lams.contentrepository.dao.ICredentialDAO
    • interface com.lamsinternational.lams.contentrepository.dao.IFileDAO
    • interface com.lamsinternational.lams.contentrepository.dao.INodeDAO
    • interface com.lamsinternational.lams.contentrepository.IRepository -
    • interface com.lamsinternational.lams.contentrepository.ITicket
    • interface com.lamsinternational.lams.contentrepository.IValue
    • interface com.lamsinternational.lams.contentrepository.IVersionedNode -
    • interface com.lamsinternational.lams.contentrepository.IWorkspace
    • interface com.lamsinternational.lams.contentrepository.dao.IWorkspaceDAO
    • interface java.io.Serializable
        -
      • interface com.lamsinternational.lams.contentrepository.ICredentials
      +
    • interface org.lamsfoundation.lams.contentrepository.IVersionDetail
    +
  • interface org.lamsfoundation.lams.contentrepository.dao.ICredentialDAO
  • interface org.lamsfoundation.lams.contentrepository.dao.IFileDAO
  • interface org.lamsfoundation.lams.contentrepository.dao.INodeDAO
  • interface org.lamsfoundation.lams.contentrepository.IRepository +
  • interface org.lamsfoundation.lams.contentrepository.ITicket
  • interface org.lamsfoundation.lams.contentrepository.IValue
  • interface org.lamsfoundation.lams.contentrepository.IVersionedNode +
  • interface org.lamsfoundation.lams.contentrepository.IWorkspace
  • interface org.lamsfoundation.lams.contentrepository.dao.IWorkspaceDAO
  • interface java.io.Serializable
      +
    • interface org.lamsfoundation.lams.contentrepository.ICredentials

    Index: lams_contentrepository/doc/package-list =================================================================== diff -u -ra4870f101fb30e5cd722f9d16e0ca50baa50fbb2 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/package-list (.../package-list) (revision a4870f101fb30e5cd722f9d16e0ca50baa50fbb2) +++ lams_contentrepository/doc/package-list (.../package-list) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -1,6 +1,6 @@ -com.lamsinternational.lams.contentrepository -com.lamsinternational.lams.contentrepository.dao -com.lamsinternational.lams.contentrepository.dao.file -com.lamsinternational.lams.contentrepository.dao.hibernate -com.lamsinternational.lams.contentrepository.struts.action -com.lamsinternational.lams.contentrepository.struts.form +org.lamsfoundation.lams.contentrepository +org.lamsfoundation.lams.contentrepository.dao +org.lamsfoundation.lams.contentrepository.dao.file +org.lamsfoundation.lams.contentrepository.dao.hibernate +org.lamsfoundation.lams.contentrepository.struts.action +org.lamsfoundation.lams.contentrepository.struts.form Index: lams_contentrepository/doc/packages.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/packages.html (.../packages.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/packages.html (.../packages.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + Index: lams_contentrepository/doc/serialized-form.html =================================================================== diff -u -r37e4855224b95084493e56d039ec02d6a37a1ba8 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/doc/serialized-form.html (.../serialized-form.html) (revision 37e4855224b95084493e56d039ec02d6a37a1ba8) +++ lams_contentrepository/doc/serialized-form.html (.../serialized-form.html) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -2,7 +2,7 @@ - + Serialized Form @@ -81,41 +81,20 @@ +Packageorg.lamsfoundation.lams.contentrepository.struts.form
    -Package com.lamsinternational.lams.contentrepository.struts.action

    - + +Class org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm extends org.apache.struts.action.ActionForm implements Serializable
    -Class com.lamsinternational.lams.contentrepository.struts.action.Download extends javax.servlet.http.HttpServlet implements Serializable

    - -

    -


    - - - - - -
    -Package com.lamsinternational.lams.contentrepository.struts.form
    - -

    - - - - - -
    -Class com.lamsinternational.lams.contentrepository.struts.form.AddFileContentForm extends org.apache.struts.action.ActionForm implements Serializable
    - -

    @@ -186,11 +165,11 @@

    - +

    +Class org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm extends org.apache.struts.action.ActionForm implements Serializable
    -Class com.lamsinternational.lams.contentrepository.struts.form.LoginRepositoryForm extends org.apache.struts.action.ActionForm implements Serializable
    @@ -239,11 +218,11 @@

    - + +Class org.lamsfoundation.lams.contentrepository.struts.form.NodeSelectionForm extends org.apache.struts.action.ActionForm implements Serializable
    -Class com.lamsinternational.lams.contentrepository.struts.form.NodeSelectionForm extends org.apache.struts.action.ActionForm implements Serializable
    @@ -267,27 +246,59 @@


    - + + + +
    +Package org.lamsfoundation.lams.contentrepository.struts.action
    + +

    + + + +Class org.lamsfoundation.lams.contentrepository.struts.action.Download extends javax.servlet.http.HttpServlet implements Serializable
    -Class com.lamsinternational.lams.contentrepository.AccessDeniedException extends RepositoryCheckedException implements Serializable

    + + + + + +
    +Class org.lamsfoundation.lams.contentrepository.struts.action.TestLogin extends javax.servlet.http.HttpServlet implements Serializable
    + +

    + +


    - + +Class org.lamsfoundation.lams.contentrepository.AccessDeniedException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.CrCredential extends java.lang.Object implements Serializable

    + +

    +


    + + + + + +
    +Class org.lamsfoundation.lams.contentrepository.CrCredential extends java.lang.Object implements Serializable
    + +

    @@ -345,11 +356,11 @@


    - +
    +Class org.lamsfoundation.lams.contentrepository.CrNode extends java.lang.Object implements Serializable
    -Class com.lamsinternational.lams.contentrepository.CrNode extends java.lang.Object implements Serializable
    @@ -425,7 +436,7 @@

    crWorkspace

    -CrWorkspace crWorkspace
    +CrWorkspace crWorkspace
    persistent field

    @@ -461,11 +472,11 @@


    - + +Class org.lamsfoundation.lams.contentrepository.CrNodeVersion extends java.lang.Object implements Serializable
    -Class com.lamsinternational.lams.contentrepository.CrNodeVersion extends java.lang.Object implements Serializable
    @@ -519,7 +530,7 @@

    node

    -CrNode node
    +CrNode node
    persistent field

    @@ -531,7 +542,7 @@

    parentNodeVersion

    -CrNodeVersion parentNodeVersion
    +CrNodeVersion parentNodeVersion
    persistent field

    @@ -565,11 +576,11 @@


    - + +Class org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty extends java.lang.Object implements Serializable
    -Class com.lamsinternational.lams.contentrepository.CrNodeVersionProperty extends java.lang.Object implements Serializable
    @@ -633,7 +644,7 @@

    crNodeVersion

    -CrNodeVersion crNodeVersion
    +CrNodeVersion crNodeVersion
    persistent field

    @@ -653,11 +664,11 @@


    - + +Class org.lamsfoundation.lams.contentrepository.CrWorkspace extends java.lang.Object implements Serializable
    -Class com.lamsinternational.lams.contentrepository.CrWorkspace extends java.lang.Object implements Serializable
    @@ -719,11 +730,11 @@


    - + +Class org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential extends java.lang.Object implements Serializable
    -Class com.lamsinternational.lams.contentrepository.CrWorkspaceCredential extends java.lang.Object implements Serializable
    @@ -751,7 +762,7 @@

    crWorkspace

    -CrWorkspace crWorkspace
    +CrWorkspace crWorkspace
    persistent field

    @@ -763,7 +774,7 @@

    crCredential

    -CrCredential crCredential
    +CrCredential crCredential
    persistent field

    @@ -773,107 +784,107 @@


    - + +Class org.lamsfoundation.lams.contentrepository.FileException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.FileException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.InvalidParameterException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.InvalidParameterException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.ItemExistsException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.ItemExistsException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.ItemNotFoundException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.ItemNotFoundException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.LoginException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.LoginException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.NoSuchNodeTypeException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.NoSuchNodeTypeException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.RepositoryCheckedException extends java.lang.Exception implements Serializable
    -Class com.lamsinternational.lams.contentrepository.RepositoryCheckedException extends java.lang.Exception implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.RepositoryRuntimeException extends java.lang.RuntimeException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.RepositoryRuntimeException extends java.lang.RuntimeException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.SimpleCredentials extends java.lang.Object implements Serializable
    -Class com.lamsinternational.lams.contentrepository.SimpleCredentials extends java.lang.Object implements Serializable
    @@ -907,35 +918,35 @@


    - + +Class org.lamsfoundation.lams.contentrepository.ValidationException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.ValidationException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.ValueFormatException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.ValueFormatException extends RepositoryCheckedException implements Serializable


    - + +Class org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException extends RepositoryCheckedException implements Serializable
    -Class com.lamsinternational.lams.contentrepository.WorkspaceNotFoundException extends RepositoryCheckedException implements Serializable
    Index: lams_contentrepository/javadoc.xml =================================================================== diff -u -ra4870f101fb30e5cd722f9d16e0ca50baa50fbb2 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/javadoc.xml (.../javadoc.xml) (revision a4870f101fb30e5cd722f9d16e0ca50baa50fbb2) +++ lams_contentrepository/javadoc.xml (.../javadoc.xml) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -1,6 +1,6 @@ - + Index: lams_contentrepository/properties.xml =================================================================== diff -u -r3b9090181caef1d6ae8150f3d218c71450b82e13 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/properties.xml (.../properties.xml) (revision 3b9090181caef1d6ae8150f3d218c71450b82e13) +++ lams_contentrepository/properties.xml (.../properties.xml) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -31,10 +31,10 @@ - + - + Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/AccessDeniedException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/AccessDeniedException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/AccessDeniedException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,45 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * The current ticket doesn't have sufficient rights for the requested action. + */ +public class AccessDeniedException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public AccessDeniedException() { + this("The current ticket doesn't have sufficient rights for the requested action."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public AccessDeniedException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public AccessDeniedException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public AccessDeniedException(Throwable cause) { + this("The current ticket doesn't have sufficient rights for the requested action.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CheckCredentialTicketBeforeAdvice.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CheckCredentialTicketBeforeAdvice.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CheckCredentialTicketBeforeAdvice.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,63 @@ +/* + * Created on Jan 21, 2005 + */ +package org.lamsfoundation.lams.contentrepository; + +import java.lang.reflect.Method; + +import org.apache.log4j.Logger; +import org.springframework.aop.MethodBeforeAdvice; + +/** + * Ticket checking functionality for implementers of IRepositoryAdmin. + * + * All calls to IRepositoryAdmin must have either ICredential or ITicket as + * their first parameter. In any case, the parameter must not be null. + * + * If the first argument is missing then it throws an AccessDeniedException + * + * @author Fiona Malikoff + */ +public class CheckCredentialTicketBeforeAdvice implements MethodBeforeAdvice { + + protected Logger log = Logger.getLogger(CheckCredentialTicketBeforeAdvice.class); + + /** @throws AccessDeniedException if the first parameter is null or it is an unrecognised ticket. + * @throws RuntimeRepositoryException if the method has as its first parameter an object that is not + * an ICredential or an ITicket + */ + public void before(Method m, Object[] args, Object target) + throws AccessDeniedException, RepositoryRuntimeException { + // assume that the first argument is the ticket or credential + + if ( log.isDebugEnabled() ) { + log.debug("Method "+m.getName()+" Checking credential/ticket "+args[0]); + } + + if ( args[0] == null ) { + + throw new AccessDeniedException("No ticket/credential supplied. Access to repository denied."); + + } else { + + if ( ITicket.class.isInstance(args[0]) ) { + + IRepositoryAdmin repository = (IRepositoryAdmin) target; + if ( ! repository.isTicketOkay((ITicket) args[0]) ) { + log.error("Supplied ticket not recognised. It may have timed out. Please log in again."); + throw new AccessDeniedException("Supplied ticket not recognised. It may have timed out. Please log in again."); + } + + } else if ( ! ICredentials.class.isInstance(args[0]) ) { + + String error = "Method has wrong signature. Method "+m.getName()+" has CheckCredentialTicketBeforeAdvice applied to it, but the first argument is a " + +args[0].getClass().getName()+". It must be either a ICredential or a ITicket"; + log.error(error); + throw new RepositoryRuntimeException(error); + + } + } + } + +} + Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrCredential.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrCredential.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrCredential.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,132 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.Serializable; +import java.util.Set; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * @hibernate.class + * table="lams_cr_credential" + * +*/ +public class CrCredential implements Serializable { + + /** identifier field */ + private Long credentialId; + + /** persistent field */ + private String name; + + /** persistent field */ + private String password; + + /** persistent field */ + private Set crWorkspaceCredentials; + + /** full constructor */ + public CrCredential(String name, String password, Set crWorkspaceCredentials) { + this.name = name; + this.password = password; + this.crWorkspaceCredentials = crWorkspaceCredentials; + } + + /** default constructor */ + public CrCredential() { + } + + /** + * @hibernate.id + * generator-class="identity" + * type="java.lang.Long" + * column="credential_id" + * unsaved-value="0" + * + */ + public Long getCredentialId() { + return this.credentialId; + } + + public void setCredentialId(Long credentialId) { + this.credentialId = credentialId; + } + + /** + * @hibernate.property + * column="name" + * unique="true" + * length="255" + * not-null="true" + * + */ + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @hibernate.property + * column="password" + * length="255" + * not-null="true" + * + */ + public String getPassword() { + return this.password; + } + + public void setPassword(String password) { + this.password = password; + } + + /** + * @hibernate.set + * lazy="true" + * inverse="true" + * cascade="none" + * @hibernate.collection-key + * column="credential_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential" + * + */ + public Set getCrWorkspaceCredentials() { + return this.crWorkspaceCredentials; + } + + public void setCrWorkspaceCredentials(Set crWorkspaceCredentials) { + this.crWorkspaceCredentials = crWorkspaceCredentials; + } + + public String toString() { + return new ToStringBuilder(this) + .append("credentialId", getCredentialId()) + .append("name", getName()) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof CrCredential) ) return false; + CrCredential castOther = (CrCredential) other; + return new EqualsBuilder() + .append(this.getCredentialId(), castOther.getCredentialId()) + .append(this.getName(), castOther.getName()) + .append(this.getPassword(), castOther.getPassword()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(getCredentialId()) + .append(getName()) + .append(getPassword()) + .toHashCode(); + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNode.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNode.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNode.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,325 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.Serializable; +import java.util.Date; +import java.util.Iterator; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * @hibernate.class + * table="lams_cr_node" + * +*/ +public class CrNode implements Serializable { + + /** identifier field */ + private Long nodeId; + + /** nullable persistent field */ + private String path; + + /** persistent field */ + private String type; + + /** nullable persistent field */ + private Date createdDateTime; + + /** persistent field */ + private Long nextVersionId; + + /** persistent field */ + private org.lamsfoundation.lams.contentrepository.CrWorkspace crWorkspace; + + /** persistent field */ + private Set crNodeVersions; + + /** transitory field. + * don't create the versionHistory till requested, but + * keep it just in case the caller asks for it again. + */ + private SortedSet versionHistory = null; + + /** full constructor */ + public CrNode(String path, String type, Date createdDateTime, Long nextVersionId, org.lamsfoundation.lams.contentrepository.CrWorkspace crWorkspace, Set crNodeVersions) { + this.path = path; + this.type = type; + this.createdDateTime = createdDateTime; + this.nextVersionId = nextVersionId; + this.crWorkspace = crWorkspace; + this.crNodeVersions = crNodeVersions; + } + + /** default constructor */ + public CrNode() { + } + + /** minimal constructor */ + public CrNode(String type, Long nextVersionId, org.lamsfoundation.lams.contentrepository.CrWorkspace crWorkspace, Set crNodeVersions) { + this.type = type; + this.nextVersionId = nextVersionId; + this.crWorkspace = crWorkspace; + this.crNodeVersions = crNodeVersions; + } + + /** + * @hibernate.id + * generator-class="identity" + * type="java.lang.Long" + * column="node_id" + * unsaved-value="0" + * + */ + public Long getNodeId() { + return this.nodeId; + } + + public void setNodeId(Long nodeId) { + this.nodeId = nodeId; + } + + /** + * @hibernate.property + * column="path" + * length="255" + * + */ + public String getPath() { + return this.path; + } + + public void setPath(String path) { + this.path = path; + } + + /** + * @hibernate.property + * column="type" + * length="255" + * not-null="true" + * + */ + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * @hibernate.property + * column="created_date_time" + * length="14" + * + */ + public Date getCreatedDateTime() { + return this.createdDateTime; + } + + public void setCreatedDateTime(Date createdDateTime) { + this.createdDateTime = createdDateTime; + } + + /** + * @hibernate.property + * type="java.lang.Long" + * column="next_version_id" + * + */ + public Long getNextVersionId() { + return this.nextVersionId; + } + + public void setNextVersionId(Long nextVersionId) { + this.nextVersionId = nextVersionId; + } + + /** + * @hibernate.many-to-one + * not-null="true" + * @hibernate.column name="workspace_id" + * + */ + public org.lamsfoundation.lams.contentrepository.CrWorkspace getCrWorkspace() { + return this.crWorkspace; + } + + public void setCrWorkspace(org.lamsfoundation.lams.contentrepository.CrWorkspace crWorkspace) { + this.crWorkspace = crWorkspace; + } + + /** + * @hibernate.set + * lazy="false" + * inverse="true" + * cascade="all-delete-orphan" + * @hibernate.collection-key + * column="node_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.contentrepository.CrNodeVersion" + * + */ + public Set getCrNodeVersions() { + return this.crNodeVersions; + } + + public void setCrNodeVersions(Set crNodeVersions) { + this.crNodeVersions = crNodeVersions; + } + + public String toString() { + return new ToStringBuilder(this) + .append("nodeId", getNodeId()) + .append("path", getPath()) + .append("type", getType()) + .append("createdDateTime", getCreatedDateTime()) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof CrNode) ) return false; + CrNode castOther = (CrNode) other; + return new EqualsBuilder() + .append(this.getNodeId(), castOther.getNodeId()) + .append(this.getPath(), castOther.getPath()) + .append(this.getType(), castOther.getType()) + .append(this.getCreatedDateTime(), castOther.getCreatedDateTime()) + .append(this.getCrWorkspace(), castOther.getCrWorkspace()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(getNodeId()) + .append(getPath()) + .append(getType()) + .append(getCreatedDateTime()) + .append(getCrWorkspace()) + .toHashCode(); + } + + /* ********* Manually added methods ****/ + /** Get the next version id for this node and then + * increment it. All other ids come out of the database + * but for the version we need the next id within a + * uuid, and the db can't help us there. + */ + public synchronized Long incrementNextVersionId() { + Long retValue = nextVersionId; + nextVersionId = new Long(nextVersionId.longValue() + 1); + return retValue; + } + + /** + * Get the history for this node. Quite intensive operation the + * first time it is run on a node as it has to build all the + * data structures. + * @return SortedSet of IVersionDetail objects, ordered by version + */ + public SortedSet getVersionHistory() { + + if ( versionHistory == null ) { + + SortedSet history = new TreeSet(); + + Set versions = getCrNodeVersions(); + if ( versions != null ) { + Iterator iter = versions.iterator(); + while (iter.hasNext()) { + CrNodeVersion element = (CrNodeVersion) iter.next(); + String desc = element.getVersionDescription(); + history.add( new SimpleVersionDetail( + element.getVersionId(), + element.getCreatedDateTime(), + desc )); + } + } + versionHistory = history; + } + + return versionHistory; + } + + /** + * Indicates whether this node is of the specified node type. + * @param nodeTypeName the name of a node type. + * @return true if this node is of the specified node type + * or a subtype of the specified node type; returns false otherwise. + */ + public boolean isNodeType(String nodeTypeName) { + return nodeTypeName != null && nodeTypeName.equals(getType()); + } + + /** Get a particular version of this node + */ + public CrNodeVersion getNodeVersion(Long versionId) + { + + CrNodeVersion nodeVersion = null; + Set nodeVersionSet = getCrNodeVersions(); + if ( nodeVersionSet != null ) { + Iterator iter = nodeVersionSet.iterator(); + if ( versionId != null ) { + nodeVersion = findParticularVersion(iter, versionId); + } else { + nodeVersion = findLatestVersion(iter); + } + } + return nodeVersion; + } + + /* Assumes that verionId will never be null - otherwise findLatestVersion + * would have been called. + */ + private CrNodeVersion findParticularVersion(Iterator nodeVersionSetIterator, Long versionId ) { + // find version, throw exception if not found. + CrNodeVersion found = null; + while (nodeVersionSetIterator.hasNext()) { + CrNodeVersion element = (CrNodeVersion) nodeVersionSetIterator.next(); + if ( versionId.equals(element.getVersionId()) ) { + found = element; + break; + } + } + return found; + } + + /* Find the latest version of a node. Tries to find the node + * with the highest version number. If it finds a node with + * no version number, that will only be selected if there + * are no other versions. + */ + private CrNodeVersion findLatestVersion(Iterator nodeVersionSetIterator ) { + // find lastest version, throw exception if not found. + CrNodeVersion found = null; + while (nodeVersionSetIterator.hasNext()) { + CrNodeVersion element = (CrNodeVersion) nodeVersionSetIterator.next(); + if ( found == null || ( found.getVersionId() != null && + found.getVersionId().compareTo(element.getVersionId()) < 0 )) + found = element; + } + return found; + } + + /** Get a list of all the versions - just the Long value. */ + public Long[] getVersionIds() { + Set allCrNodeVersions = getCrNodeVersions(); + Long[] versions = new Long[allCrNodeVersions!=null?allCrNodeVersions.size():0]; + Iterator iter = allCrNodeVersions.iterator(); + int i=0; + while (iter.hasNext()) { + CrNodeVersion element = (CrNodeVersion) iter.next(); + versions[i] = element.getVersionId(); + } + return versions; + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNodeVersion.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNodeVersion.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNodeVersion.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,421 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * @hibernate.class + * table="lams_cr_node_version" + * +*/ +public class CrNodeVersion implements Serializable { + + /** identifier field */ + private Long nvId; + + /** persistent field. Should never be null, but make it a Long + * (rather than long), so that we don't have to keep converting + * it to Long to match UUID. */ + private Long versionId; + + /** nullable persistent field */ + private Date createdDateTime; + + /** persistent field */ + private org.lamsfoundation.lams.contentrepository.CrNode node; + + /** persistent field */ + private org.lamsfoundation.lams.contentrepository.CrNodeVersion parentNodeVersion; + + /** persistent field */ + private Set childNodeVersions; + + /** persistent field */ + private Set crNodeVersionProperties; + + /** full constructor */ + public CrNodeVersion(Long versionId, Date createdDateTime, org.lamsfoundation.lams.contentrepository.CrNode node, org.lamsfoundation.lams.contentrepository.CrNodeVersion parentNodeVersion, Set crNodeVersionProperties, Set childNodeVersions) { + this.versionId = versionId; + this.createdDateTime = createdDateTime; + this.node = node; + this.parentNodeVersion = parentNodeVersion; + this.crNodeVersionProperties = crNodeVersionProperties; + this.childNodeVersions = childNodeVersions; + } + + /** default constructor */ + public CrNodeVersion() { + } + + /** minimal constructor */ + public CrNodeVersion(Long versionId, org.lamsfoundation.lams.contentrepository.CrNode node, org.lamsfoundation.lams.contentrepository.CrNodeVersion parentNodeVersion, Set crNodeVersionProperties, Set childNodeVersions) { + this.versionId = versionId; + this.node = node; + this.parentNodeVersion = parentNodeVersion; + this.crNodeVersionProperties = crNodeVersionProperties; + this.childNodeVersions = childNodeVersions; + } + + /** + * @hibernate.id + * generator-class="identity" + * type="java.lang.Long" + * column="nv_id" + * unsaved-value="0" + * + */ + public Long getNvId() { + return this.nvId; + } + + public void setNvId(Long nvId) { + this.nvId = nvId; + } + + /** + * @hibernate.property + * column="version_id" + * length="20" + * not-null="true" + * + */ + public Long getVersionId() { + return this.versionId; + } + + public void setVersionId(Long versionId) { + this.versionId = versionId; + } + + /** + * @hibernate.property + * column="created_date_time" + * length="14" + * + */ + public Date getCreatedDateTime() { + return this.createdDateTime; + } + + public void setCreatedDateTime(Date createdDateTime) { + this.createdDateTime = createdDateTime; + } + + /** + * @hibernate.many-to-one + * not-null="true" + * @hibernate.column name="node_id" + * + */ + public org.lamsfoundation.lams.contentrepository.CrNode getNode() { + return this.node; + } + + public void setNode(org.lamsfoundation.lams.contentrepository.CrNode node) { + this.node = node; + } + + /** + * @hibernate.many-to-one + * not-null="true" + * @hibernate.column name="parent_nv_id" + * + */ + public org.lamsfoundation.lams.contentrepository.CrNodeVersion getParentNodeVersion() { + return this.parentNodeVersion; + } + + public void setParentNodeVersion(org.lamsfoundation.lams.contentrepository.CrNodeVersion parentNodeVersion) { + this.parentNodeVersion = parentNodeVersion; + } + + /** + * @hibernate.set + * lazy="false" + * inverse="true" + * cascade="all-delete-orphan" + * @hibernate.collection-key + * column="nv_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty" + * + */ + public Set getCrNodeVersionProperties() { + return this.crNodeVersionProperties; + } + + public void setCrNodeVersionProperties(Set crNodeVersionProperties) { + this.crNodeVersionProperties = crNodeVersionProperties; + } + + /** + * Gets the set of child nodes. Do not use this method if you can use + * addChildNodeVersion(), removeChildNodeVersion() or + * getChildNodeVersion() instead. + * + * @hibernate.set + * lazy="false" + * inverse="true" + * cascade="all-delete-orphan" + * @hibernate.collection-key + * column="parent_nv_id " + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.contentrepository.CrNodeVersion" + * + */ + public Set getChildNodeVersions() { + return this.childNodeVersions; + } + + /** + * Assigns a new set of child nodes. Do not use this method if + * you can use addChildNodeVersion(), removeChildNodeVersion() or + * getChildNodeVersion() instead. + */ + public void setChildNodeVersions(Set childNodeVersions) { + this.childNodeVersions = childNodeVersions; + } + + /** Add a child node to the childNodeVersions collection. + * Use this method rather than calling getChildNodeVersions() + * and adding to the set. See also removeChildNodeVersion() + * and getChildNodeVersion(); + * + * @param childNode + */ + public void addChildNodeVersion(CrNodeVersion childNode) { + Set set = getChildNodeVersions(); + + if ( set == null ) { + set = new HashSet(); + setChildNodeVersions(set); + } + + getChildNodeVersions().add(childNode); + } + + /** Remove a child node to the childNodeVersions collection. + * Use this method rather than calling getChildNodeVersions() + * and iterating through the set. See also addChildNodeVersion() + * and getChildNodeVersion(); + * + * Uses equals method defined in this class. + * + * Not tested!!!! + * + * @param childNode + */ + public void removeChildNodeVersion(CrNodeVersion childNode) { + Set set = getChildNodeVersions(); + + if ( set != null ) { + Iterator iter = set.iterator(); + boolean removed = false; + while ( iter.hasNext() && ! removed ) { + CrNodeVersion element = (CrNodeVersion) iter.next(); + if ( element.equals(childNode) ) { + iter.remove(); + } + } + } + } + + /** Remove a child node to the childNodeVersions collection. + * Use this method rather than calling getChildNodeVersions() + * and iterating through the set. See also addChildNodeVersion() + * and removeChildNodeVersion(); + * + * @param relPath of child + */ + public CrNodeVersion getChildNodeVersion(String relPath) { + + if ( getChildNodeVersions() == null ) + return null; + + CrNodeVersion childNode = null; + Iterator iter = getChildNodeVersions().iterator(); + while (iter.hasNext() && childNode == null) { + CrNodeVersion element = (CrNodeVersion) iter.next(); + String path = element.getNode().getPath(); + if ( ( relPath == null && path == null ) || + ( relPath != null && relPath.equals(path)) ) { + childNode = element; + } + } + return childNode; + } + + public String toString() { + return new ToStringBuilder(this) + .append("nvId", getNvId()) + .append("versionId", getVersionId()) + .append("createdDateTime", getCreatedDateTime()) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof CrNodeVersion) ) return false; + CrNodeVersion castOther = (CrNodeVersion) other; + return new EqualsBuilder() + .append(this.getNvId(), castOther.getNvId()) + .append(this.getVersionId(), castOther.getVersionId()) + .append(this.getCreatedDateTime(), castOther.getCreatedDateTime()) + .append(this.getNode(), castOther.getNode()) + .append(this.getParentNodeVersion(), castOther.getParentNodeVersion()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(getNvId()) + .append(getVersionId()) + .append(getCreatedDateTime()) + .append(getNode()) + .append(getParentNodeVersion()) + .toHashCode(); + } + + /* ** Added code - not generated by hbm ****/ + /** Get a property value */ + public CrNodeVersionProperty getProperty(String name) { + + if ( name == null ) { + return null; + } + + Set properties = this.getCrNodeVersionProperties(); + if ( properties != null ) { + Iterator iter = properties.iterator(); + while (iter.hasNext()) { + CrNodeVersionProperty element = (CrNodeVersionProperty) iter.next(); + if ( name.equals(element.getName()) ) { + return element; + } + } + } + return null; + } + + /** Remove a property. + * + * Removes it from the collection, and as the collection + * is cascade="all-delete-orphan", the property should be + * removed from the db automatically. + */ + private void removeProperty(String name) { + + if ( name != null ) { + Set properties = this.getCrNodeVersionProperties(); + CrNodeVersionProperty prop; + if ( properties != null ) { + Iterator iter = properties.iterator(); + while (iter.hasNext()) { + CrNodeVersionProperty element = (CrNodeVersionProperty) iter.next(); + if ( name.equals(element.getName()) ) { + iter.remove(); + break; + } + } + } + } + } + + private CrNodeVersionProperty createProperty(String name, Object value, int valueType) { + CrNodeVersionProperty property = new CrNodeVersionProperty(); + property.setCrNodeVersion(this); + property.setName(name); + property.setValue(value.toString()); + property.setType(valueType); + return property; + } + + /** Set a property value. Removes the property if the value is null + * @throws RepositoryRuntimeException if name is null + * @return CrNodeVersionProperty for inserted/updated value, null if removing value */ + public CrNodeVersionProperty setProperty(String name, Object value, int valueType) + throws RepositoryRuntimeException{ + + if ( name == null ) + throw new RepositoryRuntimeException("A name must be supplied - a property cannot have a null name."); + + // if value is null then remove the property + if ( value == null ) { + removeProperty(name); + return null; + } + + // otherwise update/insert the property. + Set properties = getCrNodeVersionProperties(); + CrNodeVersionProperty prop = null; + if ( properties != null ) { + Iterator iter = properties.iterator(); + while (iter.hasNext() && prop == null) { + CrNodeVersionProperty element = (CrNodeVersionProperty) iter.next(); + if ( name.equals(element.getName()) ) { + prop = element; + } + } + if ( prop != null ) { + prop.setValue(value.toString()); + prop.setType(valueType); + } else { + prop = createProperty(name, value, valueType); + properties.add(prop); + } + } else { + properties = new HashSet(); + prop = createProperty(name, value, valueType); + properties.add(prop); + setCrNodeVersionProperties(properties); + } + return prop; + } + + /** Get the version description. Stored as a property so + * could be accessed via getProperty() */ + public String getVersionDescription() { + CrNodeVersionProperty prop = getProperty(PropertyName.VERSIONDESC); + return prop != null ? prop.getString() : null; + } + + /** Set the version description. Stored as a property so + * could be accessed via setProperty */ + public void setVersionDescription(String description) { + setProperty(PropertyName.VERSIONDESC,description, PropertyType.STRING); + } + + /** + * Indicates whether a property exists for this name + * Returns true if a property exists and false otherwise. + * + * @param name The name of a (possible) property. + * @return true if a property exists at relPath; + * false otherwise. + */ + public boolean hasProperty(String name) { + return getProperty(name) != null; + } + + /** + * Indicates whether this node has properties. + * Returns true if this node has one or more properties; + * false otherwise. + * + * @return true if this node has one or more properties; + * false otherwise. + */ + public boolean hasProperties() { + Set properties = getCrNodeVersionProperties(); + return properties != null && properties.size() > 0 ; + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,230 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.log4j.Logger; + + +/** + * @hibernate.class + * table="lams_cr_node_version_property" + * +*/ +public class CrNodeVersionProperty implements IValue,Serializable { + + /** identifier field */ + private Long id; + + /** persistent field */ + private String name; + + /** persistent field */ + private String value; + + /** persistent field */ + private int type; + + /** persistent field */ + private org.lamsfoundation.lams.contentrepository.CrNodeVersion crNodeVersion; + + /** full constructor */ + public CrNodeVersionProperty(String name, String value, int type, org.lamsfoundation.lams.contentrepository.CrNodeVersion crNodeVersion) { + this.name = name; + this.value = value; + this.type = type; + this.crNodeVersion = crNodeVersion; + } + + /** default constructor */ + public CrNodeVersionProperty() { + } + + /** + * @hibernate.id + * generator-class="identity" + * type="java.lang.Long" + * column="id" + * unsaved-value="0" + * + */ + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * @hibernate.property + * column="name" + * length="255" + * not-null="true" + * + */ + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @hibernate.property + * column="value" + * length="255" + * not-null="true" + * + */ + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * @hibernate.property + * column="type" + * length="3" + * not-null="true" + * + */ + public int getType() { + return this.type; + } + + public void setType(int type) { + this.type = type; + } + + /** + * @hibernate.many-to-one + * not-null="true" + * @hibernate.column name="nv_id" + * + */ + public org.lamsfoundation.lams.contentrepository.CrNodeVersion getCrNodeVersion() { + return this.crNodeVersion; + } + + public void setCrNodeVersion(org.lamsfoundation.lams.contentrepository.CrNodeVersion crNodeVersion) { + this.crNodeVersion = crNodeVersion; + } + + public String toString() { + return new ToStringBuilder(this) + .append("id", getId()) + .append("name", getName()) + .append("value", getValue()) + .append("type", getType()) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof CrNodeVersionProperty) ) return false; + CrNodeVersionProperty castOther = (CrNodeVersionProperty) other; + return new EqualsBuilder() + .append(this.getId(), castOther.getId()) + .append(this.getName(), castOther.getName()) + .append(this.getValue(), castOther.getValue()) + .append(this.getType(), castOther.getType()) + .append(this.getCrNodeVersion(), castOther.getCrNodeVersion()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(getId()) + .append(getName()) + .append(getValue()) + .append(getType()) + .append(getCrNodeVersion()) + .toHashCode(); + } + + /* ** Implementation of IValue interface ** */ + + protected Logger log = Logger.getLogger(CrNodeVersionProperty.class); + + /** + * Returns a string representation of the value. + * + * @throws ValueFormatException If able to convert the value to a string. + * + * @throws IllegalStateException If calling getString() on a file and the stream cannot be read. + * + * @throws RepositoryException If another error occurs. + */ + public String getString() { + return value; + } + + /** + * Returns a double representation of the value. + * + * @throws ValueFormatException If able to convert the value to a double. + */ + public double getDouble() throws ValueFormatException { + try { + return Double.parseDouble(value); + } catch ( NumberFormatException nfe ) { + throw new ValueFormatException("Unable to convert value "+value+" to double."); + } + } + + /** + * Returns a Calendar representation of the value. + * + * @throws ValueFormatException If able to convert the value to a Calendar. + */ + public Calendar getDate() throws ValueFormatException { + SimpleDateFormat df = new SimpleDateFormat(); + Date date = null; + try { + date = df.parse(value); + } catch (ParseException e) { + log.debug("Parse exception occured converting "+value+" to date.",e); + } + if ( date == null ) { + throw new ValueFormatException("Unable to convert value "+value+" to Calendar."); + } + + Calendar calendar = new GregorianCalendar(); + calendar.setTime(date); + + return calendar; + } + + /** + * Returns a long representation of the value. + * + * @throws ValueFormatException If able to convert the value to a long. + */ + public long getLong() throws ValueFormatException { + try { + return Long.parseLong(value); + } catch ( NumberFormatException nfe ) { + throw new ValueFormatException("Unable to convert value "+value+" to long."); + } + } + + /** + * Returns a boolean representation of the value. + */ + public boolean getBoolean() throws ValueFormatException { + return Boolean.valueOf(value).booleanValue(); + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrWorkspace.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrWorkspace.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrWorkspace.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,133 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.Serializable; +import java.util.Set; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * @hibernate.class + * table="lams_cr_workspace" + * +*/ +public class CrWorkspace implements IWorkspace,Serializable { + + /** identifier field */ + private Long workspaceId; + + /** persistent field */ + private String name; + + /** persistent field */ + private Set crWorkspaceCredentials; + + /** persistent field */ + private Set crNodes; + + /** full constructor */ + public CrWorkspace(String name, Set crWorkspaceCredentials, Set crNodes) { + this.name = name; + this.crWorkspaceCredentials = crWorkspaceCredentials; + this.crNodes = crNodes; + } + + /** default constructor */ + public CrWorkspace() { + } + + /** + * @hibernate.id + * generator-class="identity" + * type="java.lang.Long" + * column="workspace_id" + * unsaved-value="0" + * + */ + public Long getWorkspaceId() { + return this.workspaceId; + } + + public void setWorkspaceId(Long workspaceId) { + this.workspaceId = workspaceId; + } + + /** + * @hibernate.property + * column="name" + * length="255" + * not-null="true" + * + */ + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @hibernate.set + * lazy="true" + * inverse="true" + * cascade="none" + * @hibernate.collection-key + * column="workspace_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.contentrepository.CrWorkspaceCredential" + * + */ + public Set getCrWorkspaceCredentials() { + return this.crWorkspaceCredentials; + } + + public void setCrWorkspaceCredentials(Set crWorkspaceCredentials) { + this.crWorkspaceCredentials = crWorkspaceCredentials; + } + + /** + * @hibernate.set + * lazy="true" + * inverse="true" + * cascade="none" + * @hibernate.collection-key + * column="workspace_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.contentrepository.CrNode" + * + */ + public Set getCrNodes() { + return this.crNodes; + } + + public void setCrNodes(Set crNodes) { + this.crNodes = crNodes; + } + + public String toString() { + return new ToStringBuilder(this) + .append("workspaceId", getWorkspaceId()) + .append("name", getName()) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof CrWorkspace) ) return false; + CrWorkspace castOther = (CrWorkspace) other; + return new EqualsBuilder() + .append(this.getWorkspaceId(), castOther.getWorkspaceId()) + .append(this.getName(), castOther.getName()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(getWorkspaceId()) + .append(getName()) + .toHashCode(); + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,104 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.Serializable; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * @hibernate.class + * table="lams_cr_workspace_credential" + * +*/ +public class CrWorkspaceCredential implements Serializable { + + /** identifier field */ + private Long wcId; + + /** persistent field */ + private org.lamsfoundation.lams.contentrepository.CrWorkspace crWorkspace; + + /** persistent field */ + private org.lamsfoundation.lams.contentrepository.CrCredential crCredential; + + /** full constructor */ + public CrWorkspaceCredential(org.lamsfoundation.lams.contentrepository.CrWorkspace crWorkspace, org.lamsfoundation.lams.contentrepository.CrCredential crCredential) { + this.crWorkspace = crWorkspace; + this.crCredential = crCredential; + } + + /** default constructor */ + public CrWorkspaceCredential() { + } + + /** + * @hibernate.id + * generator-class="identity" + * type="java.lang.Long" + * column="wc_id" + * unsaved-value="0" + * + */ + public Long getWcId() { + return this.wcId; + } + + public void setWcId(Long wcId) { + this.wcId = wcId; + } + + /** + * @hibernate.many-to-one + * not-null="true" + * @hibernate.column name="workspace_id" + * + */ + public org.lamsfoundation.lams.contentrepository.CrWorkspace getCrWorkspace() { + return this.crWorkspace; + } + + public void setCrWorkspace(org.lamsfoundation.lams.contentrepository.CrWorkspace crWorkspace) { + this.crWorkspace = crWorkspace; + } + + /** + * @hibernate.many-to-one + * not-null="true" + * @hibernate.column name="credential_id" + * + */ + public org.lamsfoundation.lams.contentrepository.CrCredential getCrCredential() { + return this.crCredential; + } + + public void setCrCredential(org.lamsfoundation.lams.contentrepository.CrCredential crCredential) { + this.crCredential = crCredential; + } + + public String toString() { + return new ToStringBuilder(this) + .append("wcId", getWcId()) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof CrWorkspaceCredential) ) return false; + CrWorkspaceCredential castOther = (CrWorkspaceCredential) other; + return new EqualsBuilder() + .append(this.getWcId(), castOther.getWcId()) + .append(this.getCrWorkspace(), castOther.getCrWorkspace()) + .append(this.getCrCredential(), castOther.getCrCredential()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(getWcId()) + .append(getCrWorkspace()) + .append(getCrCredential()) + .toHashCode(); + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/FileException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/FileException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/FileException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,46 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * Some error was generated reading or writing the files + * to disk. + */ +public class FileException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public FileException() { + this("File error occured."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public FileException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public FileException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public FileException(Throwable cause) { + this("File error occured.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ICredentials.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ICredentials.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ICredentials.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,76 @@ + +package org.lamsfoundation.lams.contentrepository; +import java.io.Serializable; + +/** + * Base interface for all credentials that may be passed to the + * Repository.login() method. + */ +public interface ICredentials extends Serializable { + + /** + * Returns the name of the tool. + * + * @return the tool name. + */ + public String getName(); + + /** + * Returns the password. + *

    + * Note that this method returns a reference to the password. + * The password is set when the creditionals are passed in to get a ticket, + * and then removed. + *

    + * @return the password. + */ + public char[] getPassword(); + + /** + * Clear the current password - important not to leave this lying around. + * + * After the credential is used, it should be cleared to ensure the + * identification string isn't held in memory. + */ + public void clearPassword(); + + /* Implement in the future + * + * Stores an attribute in this credentials instance. + * + * @param name a String specifying the name of the attribute + * @param value the String value of the attribute to be stored + public void setAttribute(String name, String value); + */ + + /* Implement in the future + * + * Removes an attribute from this credentials instance. + * + * @param name a String specifying the name of the attribute + * to remove + public void removeAttribute(String name); + */ + + /* Implement in the future + * + * Returns the value of the named attribute as a String, + * or null if no attribute of the given name exists. + * + * @param name a String specifying the name of + * the attribute + * @return an String containing the value of the attribute, + * or null if the attribute does not exist + public String getAttribute(String name); + */ + + /* Implement in the future + * + * Returns the names of the attributes available to this + * credentials instance. This method returns an empty array + * if the credentials instance has no attributes available to it. + * + * @return a string array containing the names of the stored attributes + public String[] getAttributeNames(); + */ +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IRepository.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IRepository.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IRepository.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,283 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.InputStream; +import java.util.List; +import java.util.SortedMap; +import java.util.SortedSet; + +/** + * Tool access to the repository + */ +public interface IRepository { + + /** String used to define service in Spring context */ + public static final String REPOSITORY_SERVICE_ID = "repositoryService"; + /** String used to define the path to the context file */ + public static final String REPOSITORY_CONTEXT_PATH = + "/org/lamsfoundation/lams/contentrepository/contentRepositoryApplicationContext.xml"; + + /** + * Login, creating a new ticket for the given credentials and specified + * workspace. If login fails, a LoginException is thrown and + * no valid ticket is generated. The credentials object in the ticket + * does not contain the password. + * + * It does not clear the password in the input credentials object. + * + * @param credentials The credentials of the user + * @param workspaceName the name of a workspace. + * @return a valid {@link ITicket} for the user to access the repository. + * @throws LoginException Login authentication fails. + * @throws AccessDeniedException User is not allowed to access this workspace. + * @throws WorkspaceNotFoundException Workspace name doesn't exist. + */ + public ITicket login(ICredentials credentials, String workspaceName) + throws LoginException, AccessDeniedException, WorkspaceNotFoundException; + + /** + * Create a new workspace, with the tool identified in the creditials + * as the owner. + * It does not clear the password in the credentials + * @param credentials this user/password must already exist in the repository. Password will be checked. + * @param workspaceName + * @param credentials The credentials of the user/tool + * @throws LoginException if credentials are not authorised to add/access the new workspace. + * @throws ItemExistsException if the workspace already exists. + * @throws RepositoryCheckedException if parameters are missing. + */ + public void addWorkspace(ICredentials credentials, String workspaceName) + throws LoginException, AccessDeniedException, ItemExistsException, RepositoryCheckedException; + + /** + * Create a new repository "user" - usually a tool. + * + * The password must be at least 6 chars. + * + * This method will not wipe out the password in the newCredential object. + * + * At this stage it is publically accessable - may need to move + * it to a private management tool if considered to insecure. + * + * @param newCredential this user/password will be added to the repository + * @throws RepositoryCheckedException if parameters are missing. + */ + public void createCredential(ICredentials newCredential) + throws AccessDeniedException, RepositoryCheckedException; + + /** + * Update a credential. Name cannot change, so really only the password changes + * + * The password must be at least 6 chars. + * + * @param oldCredential the current user/password + * @param newCredential the new user/password + * @throws LoginException if the oldCredential fails login test (e.g. wrong password) + * @throws RepositoryCheckedException if one of the credentials objects are missing + */ + public void updateCredentials(ICredentials oldCredential, ICredentials newCredential) + throws AccessDeniedException, RepositoryCheckedException; + + /** + * Add a new file to the repository. This will create + * a completely new entry (node) in the repository, starting + * with version 1. + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @param istream new file, as an input stream - mandatory + * @param mimeType mime type of file - optional + * @param versionDescription human readable comment about the version - optional + * @return nodeKey (uuid and version) + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws FileException if unable to save node due to file error + * @throws InvalidParameterException if a required parameter is missing + * @throws RepositoryRuntimeException if any internal errors have occured + */ + public abstract NodeKey addFileItem(ITicket ticket, InputStream istream, String filename, + String mimeType, String versionDescription) + throws FileException, AccessDeniedException, InvalidParameterException; + + /** + * Add a new package of files to the repository. If startFile + * is not supplied, then it is assumed to be index.html. + * + * The directory separator character in the paths of the files in the package + * will be converted to "/" so that a web style path can be used to + * access the file. + * + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @param dirPath directory path containing files - mandatory + * @param startFile relative path of initial file - optional + * @param versionDescription human readable comment about the version - optional + * @return nodeKey (uuid and version) + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws FileException if unable to save node due to file error + * @throws InvalidParameterException if a required parameter is missing + * @throws RepositoryRuntimeException if any internal errors have occured + */ + public abstract NodeKey addPackageItem(ITicket ticket, String dirPath, String startFile, + String versionDescription) + throws AccessDeniedException, InvalidParameterException, FileException; + + /** + * Update an existing file in the repository. This will create + * a new version of this file. + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @param uuid unique id of the file - mandatory + * @param istream new file, as an input stream - mandatory + * @param versionDescription human readable comment about the version - optional + * @param mimeType mime type of file - optional + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws ItemNotFoundException if node with uuid cannot be found + * @throws FileException if unable to save node due to file error + * @throws InvalidParameterException if a required parameter is missing + * @throws RepositoryRuntimeException if any internal errors have occured + */ + public NodeKey updateFileItem(ITicket ticket, Long uuid, String filename, + InputStream istream, String mimeType, + String versionDescription) + throws AccessDeniedException, ItemNotFoundException, + FileException, InvalidParameterException; + + /** + * Add a new package of files to the repository. If startFile + * is not supplied, then it is assumed to be index.html. + * + * The directory separator character in the paths of the files in the package + * will be converted to "/" so that a web style path can be used to + * access the file. + * + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @param uuid unique id of the package - mandatory + * @param dirPath directory path containing files - mandatory + * @param startFile relative path of initial file - optional + * @param versionDescription human readable comment about the version - optional + * @return nodeKey (uuid and version) + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws ItemNotFoundException if node with uuid cannot be found + * @throws FileException if unable to save node due to file error + * @throws InvalidParameterException if a required parameter is missing + * @throws RepositoryRuntimeException if any internal errors have occured + */ + public abstract NodeKey updatePackageItem(ITicket ticket, Long uuid, String dirPath, + String startFile, String versionDescription) + throws AccessDeniedException, ItemNotFoundException, + FileException, InvalidParameterException ; + + /** + * Get an item from the repository based on the UUID. This + * may be either a file or package node. + * + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @param uuid id of the file/package - mandatory + * @param version desired version - if null gets latest version + * @return node. + */ + public abstract IVersionedNode getFileItem(ITicket ticket, Long uuid, Long version) + throws AccessDeniedException, ItemNotFoundException, FileException; + + + /** + * Get an item from the repository based on the UUID and relative + * path. Only used to get the content from a package. The + * UUID is the id of the package, and relPath is the relative + * path within the package. + * + * If the item is a package and relPath is null, return the package node. + * + * The relPath must be specified in web format ie use a separator + * of "/" not "\". + * + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @param uuid id of the package - mandatory + * @param versionId desired version - if null gets latest version. This is the version + * of the package node, not the related file. + * @param relPath relative path within the package - if null, + * returns start file. + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws ItemNotFoundException if node with uuid cannot be found + * @throws FileException if unable to save node due to file error + * @throws RepositoryRuntimeException if any internal errors have occured + * @return node. + */ + public abstract IVersionedNode getFileItem(ITicket ticket, Long uuid, Long versionId, String relPath) + throws AccessDeniedException, ItemNotFoundException, FileException; + + /** + * Return a list of all the nodes for a package. The first in the list + * is the package node. The others are in arbitrary order. + * + * @param ticket + * @param uuid uuid of the package node + * @param version version of the package node + * @return list of all nodes for package. + * @throws AccessDeniedException + * @throws ItemNotFoundException + * @throws FileException + */ + public List getPackageNodes(ITicket ticket, Long uuid, Long version) throws AccessDeniedException, + ItemNotFoundException, FileException; + + /** Get the history for a node. Quite intensive operation the + * first time it is run on a node as it has to build all the + * data structures. + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @return SortedSet of IVersionDetail objects, ordered by version + */ + public SortedSet getVersionHistory(ITicket ticket, Long uuid) + throws ItemNotFoundException,AccessDeniedException ; + + /** Delete the current version of a node, returning a list of the files + * that could not be deleted properly. If it is a package node, the child + * nodes will be deleted. + * + * You cannot delete the child of a package node - you have to delete the + * whole package. + * + * If after deleting the version, we find that there a no other versions + * for a node, then delete the node. + * + * A file missing from the disk is ignored, allowing nodes with lost files + * to be deleted. + * + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws ItemNotFoundException if node with uuid cannot be found + * @throws InvalidParameterException if a required parameter is missing + * @throws RepositoryRuntimeException if any internal errors have occured + * @return the list of file(paths) that could not be deleted. The db entries + * will have been deleted but these files could not be deleted. */ + public String[] deleteVersion(ITicket ticket, Long uuid, Long version) + throws AccessDeniedException, InvalidParameterException, ItemNotFoundException; + + /** Delete a node and all its versions, returning a list of the files + * that could not be deleted properly. If it is a package node, the child + * nodes will be deleted. + * + * A file missing from the disk is ignored, allowing nodes with lost files + * to be deleted. + * + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws ItemNotFoundException if node with uuid cannot be found + * @throws InvalidParameterException if a required parameter is missing + * @throws RepositoryRuntimeException if any internal errors have occured + * @return the list of file(paths) that could not be deleted. The db entries + * will have been deleted but these files could not be deleted. */ + public String[] deleteNode(ITicket ticket, Long uuid) + throws AccessDeniedException, InvalidParameterException, ItemNotFoundException; + + /** + * Finish using this ticket. No more updates may be used with this ticket + * after logout(). Allows any resources to be freed. + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + */ + public void logout(ITicket ticket) throws AccessDeniedException; + + /** Get a complete list of all nodes in the workspace and their + * version histories. + *

    + * Warning: Once a workspace gets a lot of nodes, this will be + * a very very expensive call!!!!! + *

    + * @param ticket ticket issued on login. Identifies tool and workspace - mandatory + * @return SortedMap key Long uuid, value IVersionDetail version history + */ + public SortedMap getNodeList(ITicket ticket) throws AccessDeniedException ; +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IRepositoryAdmin.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IRepositoryAdmin.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IRepositoryAdmin.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,20 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * Administrative interface to the Repository. "Protects" + * the assignCredentials method and isTicketOkay method. + */ +public interface IRepositoryAdmin extends IRepository { + + public void assignCredentials(ICredentials credentials, String workspaceName) + throws RepositoryCheckedException, WorkspaceNotFoundException; + + /** Is this ticket acceptable to the repository? + * Only the interceptor for an IRepositoryAdmin should call this!!!!!! + * + * Do NOT declare this method as a transaction otherwise we will + * end up with an endless loop of forever trying to check if + * the ticket is okay as this method would end up getting + * checked itself. */ + public boolean isTicketOkay(ITicket ticket); + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ITicket.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ITicket.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ITicket.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,27 @@ +package org.lamsfoundation.lams.contentrepository; + +/** + * Ticket represents the "authorisation" key to the repository. When + * the tool logs in, a ticket is given. This ticket must be supplied + * whenever a node is accessed. When the tool is finished, it should call + * logout, which invalidates the ticket. + * + * A ticket is for one workspace only - to access more than one + * workspace requires more than one ticket. + * + * @author Fiona Malikoff + */ +public interface ITicket { + /** Get the workspace associated with this ticket + * Should only be accessed by the content repository package members. + */ + abstract Long getWorkspaceId(); + + /** + * @return Returns the ticketId. + */ + abstract String getTicketId(); + + /** Make this ticket unusable. Called by the repository on logout */ + abstract void clear(); +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IValue.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IValue.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IValue.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,51 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.util.Calendar; + +/** + * A value is an object which is explicitly marked with a type. This type can + * be used for hints to the persistence layer as to how to store/retrieve + * the value. + */ +public interface IValue { + + /** + * @return the type of this Value. See {@link PropertyType} for values. + */ + public int getType(); + + /** + * Returns a string representation of the value. + * + * @throws ValueFormatException If able to convert the value to a string. + */ + public String getString() throws ValueFormatException; + + /** + * Returns a double representation of the value. + * + * @throws ValueFormatException If able to convert the value to a double. + */ + public double getDouble() throws ValueFormatException; + + /** + * Returns a Calendar representation of the value. + * + * @throws ValueFormatException If able to convert the value to a Calendar. + */ + public Calendar getDate() throws ValueFormatException; + + /** + * Returns a long representation of the value. + * + * @throws ValueFormatException If able to convert the value to a long. + */ + public long getLong() throws ValueFormatException; + + /** + * Returns a boolean representation of the value. + * + * @throws ValueFormatException If able to convert the value to a boolean. + */ + public boolean getBoolean() throws ValueFormatException; +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionDetail.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionDetail.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionDetail.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,29 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.util.Date; + +/** + * Describes the version of a node. Objects that meet this interface + * have a natural ordering so they can be placed straight into + * a sorted set, with the need for a special comparator. The natural + * ordering should be such that null is sorted (ie after) non-null. + * + * @author Fiona Malikoff + */ +public interface IVersionDetail extends Comparable { + + /** Get the version id. This will be a number greater than 0. + * @return version id + */ + public Long getVersionId(); + + /** Get the date/time of when this version was created. + * @return date/time stamp of creation + */ + public Date getCreatedDateTime(); + + /** Get the general text string describing the version. + * @return version description + */ + public String getDescription(); +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionedNode.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionedNode.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionedNode.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,173 @@ +package org.lamsfoundation.lams.contentrepository; +import java.io.InputStream; +import java.util.Date; +import java.util.Set; +import java.util.SortedSet; + +/** + * The IVersionedNode interface represents a particular version of a node + * in the hierarchy that makes up the repository. This interface represents + * a very restricted version of a node - they are read only methods + * so the node cannot be updated - only a new version may be created. + * + * A VersionedNode may have at most one file attached (ie one per version). + */ +public interface IVersionedNode { + + /** Get the uuid and version of this node/version */ + public NodeKey getNodeKey(); + + /** + * Returns the node at relPath, which is a child of this node. + * + * @param relPath The relative path of the node to retrieve. + * @return The node + * @throws ItemNotFoundException If no node exists at the + * specified path. + * @throws RepositoryException If another error occurs. + */ + public IVersionedNode getNode(String relPath) + throws ItemNotFoundException; + + /** + * Returns an Set of all child nodes of node. Returns an empty + * set if no nodes found. + * @return Set of nodes. + */ + public Set getChildNodes(); + + /** + * Does this node have a parent node? + * + * @return boolean + */ + public boolean hasParentNode(); + + /** + * Indicates whether a node exists at relPath + * Returns true if a node exists at relPath and + * false otherwise. + * + * @param relPath The path of a (possible) node. + * @return true if a node exists at relPath; + * false otherwise. + */ + public boolean hasNode(String relPath); + + /** + * Indicates whether this node has child nodes. + * Returns true if this node has one or more child nodes; + * false otherwise. + * + * @return true if this node has one or more child nodes; + * false otherwise. + */ + public boolean hasNodes(); + + /** + * Returns the property at relPath relative to this + * node. + * + * @param name + * @return The property value at name, NULL if no such property exists. + */ + public IValue getProperty(String name); + + /** + * Returns all properties of this node. + * + * @return A Set of IValue objects + */ + public Set getProperties(); + + /** + * Returns the UUID of this node as recorded in the node's jcr:UUID + * property. + * + * @return the UUID of this node + */ + public Long getUUID(); + + /** + * Indicates whether a property exists for this name + * Returns true if a property exists and false otherwise. + * + * @param name The name of a (possible) property. + * @return true if a property exists at relPath; + * false otherwise. + */ + public boolean hasProperty(String name) ; + + /** + * Indicates whether this node has properties. + * Returns true if this node has one or more properties; + * false otherwise. + * + * @return true if this node has one or more properties; + * false otherwise. + */ + public boolean hasProperties() ; + + /** + * Gets the type of the current node. See {@link NodeType} for + * possible node types. Note: the node type is shared across all + * versions of a node + * + * @return node type name + */ + public String getNodeType() ; + + /** + * Indicates whether this node is of the specified node type. + * Returns true if this node is of the specified node type/ + * Returns false otherwise. + * + * @param nodeTypeName the name of a node type. + * @return true if this node is of the specified node type + * or a subtype of the specified node type; returns false otherwise. + */ + public boolean isNodeType(String nodeTypeName) ; + + /** + * Get the version history for this node, ordered by version id. + * + * @return Set of {@link IVersionDetail} objects + */ + public SortedSet getVersionHistory() ; + + /** + * Get the path of this node + * + * @return relative path (from parent) + */ + public String getPath() ; + + /** + * Get the ticket through which this node was accessed. + * + * @return A (@link ITicket} object. + */ + public ITicket getTicket() ; + + /** + * Get the version of this node. + * + * @return The version number, which will be greater than 0. + */ + public Long getVersion(); + + /** Get the date/time of when this node was created. + * @return date/time stamp of creation + */ + public Date getCreatedDateTime(); + + /** Get the file, as an inputstream. It is the responsibility + * of the caller to close the stream. + * + * If the node is a package node, it will get the input stream + * of the first file. + */ + public InputStream getFile() throws FileException; + + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionedNodeAdmin.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionedNodeAdmin.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IVersionedNodeAdmin.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,114 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.util.List; +import java.io.InputStream; +import java.util.Calendar; + +/** + * IVersionedNodeAdmin represents the full functionality for a versioned node. + * + * IVersionedNodeAdmin is a protected interface - should only be used within + * the repository package. It exists to allow easier replacement of the + * SimpleVersionedNode class in line with the Spring framework philosophy + * of programming to interfaces. + */ +public interface IVersionedNodeAdmin extends IVersionedNode { + /** + * Sets the property to a value, based on the specified type, after converting + * from the string. + * + * @param name The name of a property of this node + * @param value The value to be assigned + * @param type The type of the property + * @throws ValueFormatException if the type or format of a value + * is incompatible with the type of the specified property or if + * value is incompatible with (i.e. can not be converted to) type. + */ + public void setProperty(String name, String value, int type) throws RepositoryCheckedException ; + + /** + * Sets the property to a STRING value. + * To remove a property, set the value to null. + * + * @param name The name of a property of this node + * @param value The value to be assigned + */ + public void setProperty(String name, String value) throws RepositoryCheckedException ; + + /** + * Sets the property to a BOOLEAN value. Creates the property if required. + * To remove a property, set the value to null. + * + * @param name The name of a property of this node + * @param value The value to be assigned + */ + public void setProperty(String name, boolean value) throws RepositoryCheckedException; + + /** + * Sets the property to a DOUBLE value. + * To remove a property, set the value to null. + * + * @param name The name of a property of this node + * @param value The value to be assigned + */ + public void setProperty(String name, double value) throws RepositoryCheckedException;; + + /** + * Sets the property to a LONG value. + * To remove a property, set the value to null. + * + * @param name The name of a property of this node + * @param value The value to be assigned + */ + public void setProperty(String name, long value) throws RepositoryCheckedException ; + + /** + * Sets the property a CALENDAR value. + * To remove a property, set the value to null. + * + * @param name The name of a property of this node + * @param value The value to be assigned + */ + public void setProperty(String name, Calendar value) throws RepositoryCheckedException ; + + + /** Set the file, passed in as an inputstream. The stream will be closed + * when the file is saved. Only nodes of type FILENODE can have a file! + * @param iStream mandatory + * @param filename mandatory + * @param mimeType optional */ + public abstract void setFile(InputStream iStream, String filename, String mimeType) + throws InvalidParameterException; + + /** Delete this node and all its versions, returning a list of the files + * that could not be deleted properly. If it is a package node, the child + * nodes will be deleted. + * + * A file missing from the disk is ignored, allowing nodes with lost files + * to be deleted. + * + * @throws AccessDeniedException if ticket doesn't allow this action + * @throws ItemNotFoundException if node with uuid cannot be found + * @throws InvalidParameterException if a required parameter is missing + * @throws RepositoryRuntimeException if any internal errors have occured + * @return the list of file(paths) that could not be deleted. The db entries + * will have been deleted but these files could not be deleted. */ + public List deleteNode(); + + + /** Delete the current version of this node, returning a list of the files + * that could not be deleted properly. If it is a package node, the child + * nodes will be deleted. + * + * If after deleting the version, we find that there a no other versions + * for a node, then delete the node. + * + * A file missing from the disk is ignored, allowing nodes with lost files + * to be deleted. + * + * @return the list of file(paths) that could not be deleted. The db entries + * will have been deleted but these files could not be deleted. */ + public List deleteVersion(); + + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IWorkspace.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IWorkspace.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/IWorkspace.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,13 @@ + +package org.lamsfoundation.lams.contentrepository; + +/** + * A workspace is a grouping of content, which is accessed by a ticket. + * One workspace may have many current tickets. + * + * A workspace may belong to a tool, in which case only the tool can use this workspace. + */ +public interface IWorkspace { + public String getName(); + public Long getWorkspaceId(); +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/InvalidParameterException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/InvalidParameterException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/InvalidParameterException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,45 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * Generic exception thrown whenever a parameter is missing. + */ +public class InvalidParameterException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public InvalidParameterException() { + this("A required parameter is null."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public InvalidParameterException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public InvalidParameterException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public InvalidParameterException(Throwable cause) { + this("A required parameter is null.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ItemExistsException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ItemExistsException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ItemExistsException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,45 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * An item already exists with the given id or path. + */ +public class ItemExistsException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public ItemExistsException() { + this("An item already exists with the given id or path."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public ItemExistsException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public ItemExistsException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public ItemExistsException(Throwable cause) { + this("An item already exists with the given id or path.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ItemNotFoundException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ItemNotFoundException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ItemNotFoundException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,47 @@ +package org.lamsfoundation.lams.contentrepository; + +/** + * Item requested does not exist. + */ +public class ItemNotFoundException extends RepositoryCheckedException { + + /** + * Constructs a new instance of this class. + */ + public ItemNotFoundException() { + this("Item requested does not exist."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public ItemNotFoundException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public ItemNotFoundException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public ItemNotFoundException(Throwable cause) { + this("Item requested does not exist.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/LoginException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/LoginException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/LoginException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,45 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * Login failed. + */ +public class LoginException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public LoginException() { + this("Content Repository Login Failed."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public LoginException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public LoginException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public LoginException(Throwable cause) { + this("Content Repository Login Failed.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NoSuchNodeTypeException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NoSuchNodeTypeException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NoSuchNodeTypeException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,45 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * Tried to create a node with an unknown type. + */ +public class NoSuchNodeTypeException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public NoSuchNodeTypeException() { + this("Node Type unknown or not allowed for this action."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public NoSuchNodeTypeException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public NoSuchNodeTypeException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public NoSuchNodeTypeException(Throwable cause) { + this("Node Type unknown or not allowed for this action.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NodeKey.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NodeKey.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NodeKey.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,65 @@ +/* + * Created on Jan 11, 2005 + */ +package org.lamsfoundation.lams.contentrepository; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + +/** + * Represents the two part key - UUID and version. + * Version may be null; + * + * @author Fiona Malikoff + */ +public class NodeKey { + + private Long uuid = null; + private Long version = null; + + /** + * + */ + public NodeKey(Long uuid, Long version) { + this.uuid = uuid; + this.version = version; + } + + /** + * @return Returns the uuid. + */ + public Long getUuid() { + return uuid; + } + /** + * @return Returns the version. + */ + public Long getVersion() { + return version; + } + + public String toString() { + return new ToStringBuilder(this) + .append("uuid", uuid) + .append("version", version) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof NodeKey) ) return false; + NodeKey castOther = (NodeKey) other; + return new EqualsBuilder() + .append(uuid, castOther.getUuid()) + .append(version, castOther.getVersion()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(uuid) + .append(version) + .toHashCode(); + } +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NodeType.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NodeType.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/NodeType.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,30 @@ +package org.lamsfoundation.lams.contentrepository; + +/** + * Defines the types of nodes. If you add a new type to this file, + * make sure you add it to the isValidNodeType method. + * + * @author Fiona Malikoff + */ +public final class NodeType { + + /** Node that has properties but no file. Not used at present */ + public static final String DATANODE = "DATANODE"; + + /** Node has a file attached. Only nodes of type FILENODE can have + * files attached! */ + public static final String FILENODE = "FILENODE"; + + /** Node represents a package of other nodes */ + public static final String PACKAGENODE = "PACKAGENODE"; + + /** Does this string represent a known node type. */ + public static boolean isValidNodeType(String type) { + if ( type != null && + ( type.equals(DATANODE) || + type.equals(FILENODE) || type.equals(PACKAGENODE) ) ) { + return true; + } + return false; + } +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/PropertyName.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/PropertyName.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/PropertyName.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,25 @@ +/* + * Created on Jan 5, 2005 + */ +package org.lamsfoundation.lams.contentrepository; + +/** + * @author Fiona Malikoff + * + * Names of known properties, such as MIMETYPE, INITIALPATH + */ +public final class PropertyName { + + /** VERSIONDESC is text description relating to a version + * It should contain text meaningful to the user. Applicable to all node types. */ + public static final String VERSIONDESC = "VERSIONDESC"; + + /** MIMETYPE is required for a file node - it is set by the call to add the file stream.*/ + public static final String MIMETYPE = "MIMETYPE"; + /** FILENAME is required for a file node - it is set by the call to add the file stream. */ + public static final String FILENAME = "FILENAME"; + + /** INITIALPATH is required for a package node */ + public static final String INITIALPATH = "INITIALPATH"; + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/PropertyType.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/PropertyType.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/PropertyType.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,82 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * LAMS property types. + */ +public final class PropertyType { + /** String property type */ + public static final int STRING = 1; + /** Long property type */ + public static final int LONG = 2; + /** Double property type */ + public static final int DOUBLE = 3; + /** Date property type */ + public static final int DATE = 4; + /** Boolean property type */ + public static final int BOOLEAN = 5; + + /** + * Undefined type. + */ + public static final int UNDEFINED = 0; + + /** + * The names of the supported property types, + * as used in serialization. + */ + public static final String TYPENAME_STRING = "String"; + public static final String TYPENAME_LONG = "Long"; + public static final String TYPENAME_DOUBLE = "Double"; + public static final String TYPENAME_DATE = "Date"; + public static final String TYPENAME_BOOLEAN = "Boolean"; + + /** + * Returns the name of the specified type. + * @param type the property type + * @return the name of the specified type + * @throws RepostoryException if the type is not a valid property type. + */ + public static String nameFromValue(int type) throws RepositoryCheckedException { + switch (type) { + case STRING: + return TYPENAME_STRING; + case BOOLEAN: + return TYPENAME_BOOLEAN; + case LONG: + return TYPENAME_LONG; + case DOUBLE: + return TYPENAME_DOUBLE; + case DATE: + return TYPENAME_DATE; + default: + throw new RepositoryCheckedException("unknown type: " + type); + } + } + + /** + * Returns the numeric constant value of the type with the specified name. + * @param name the name of the property type + * @return the numeric constant value + * @throws RepostoryException if name + * is not a valid property type name. + */ + public static int valueFromName(String name) throws RepositoryCheckedException { + if (name.equals(TYPENAME_STRING)) { + return STRING; + } else if (name.equals(TYPENAME_BOOLEAN)) { + return BOOLEAN; + } else if (name.equals(TYPENAME_LONG)) { + return LONG; + } else if (name.equals(TYPENAME_DOUBLE)) { + return DOUBLE; + } else if (name.equals(TYPENAME_DATE)) { + return DATE; + } else { + throw new RepositoryCheckedException("unknown type: " + name); + } + } + + /** private constructor to prevent instantiation */ + private PropertyType() { + } +} + Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryCheckedException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryCheckedException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryCheckedException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,65 @@ +package org.lamsfoundation.lams.contentrepository; + +/** + * Main exception thrown by content repository classes. All exceptions thrown by the content + * repository (except RepositoryRuntimeException) are based on this class, so calling code + * can catch this exception and catch all of the repository exceptions, if it doesn't want to + * catch particular exceptions. + * + * @see RepositoryRuntimeException + */ +public class RepositoryCheckedException extends Exception { + + /** + * Constructs a new instance of this class. + */ + public RepositoryCheckedException() { + this("Content Repository Error."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public RepositoryCheckedException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public RepositoryCheckedException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public RepositoryCheckedException(Throwable cause) { + this("Content Repository Error.", cause); + } + + + public String getMessage() { + + String s1 = super.getMessage(); + if ( s1 == null) { + s1 = ""; + } + + Throwable cause = getCause(); + String s2 = cause != null ? cause.getMessage() : null ; + return s2 != null ? s1+":"+s2 : s1; + + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryRuntimeException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryRuntimeException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryRuntimeException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,64 @@ +package org.lamsfoundation.lams.contentrepository; + +/** + * Main runtime exception thrown by content repository classes. This is only + * used for unexpected internal errors, such that the calling code could + * never recover. + * + * @see RepositoryCheckedException + */ +public class RepositoryRuntimeException extends RuntimeException { + + /** + * Constructs a new instance of this class. + */ + public RepositoryRuntimeException() { + this("Content Repository Runtime Error."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public RepositoryRuntimeException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public RepositoryRuntimeException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public RepositoryRuntimeException(Throwable cause) { + this("Content Repository Runtime Error.", cause); + } + + + public String getMessage() { + + String s1 = super.getMessage(); + if ( s1 == null) { + s1 = ""; + } + + Throwable cause = getCause(); + String s2 = cause != null ? cause.getMessage() : null ; + return s2 != null ? s1+":"+s2 : s1; + + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/SimpleCredentials.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/SimpleCredentials.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/SimpleCredentials.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,70 @@ +package org.lamsfoundation.lams.contentrepository; + +/** + * + * Basic implementation of credentials. Note: the "user id" is + * actually "tool id", so its not really a password as an validation + * string. + *

    + * When a tool logs into the repository, it will pass in a simple credentials + * object which has just the userid and password set. + *

    + * The repository then attaches credential to the ticket. + * The new credential doesn't have the password and it + * is never connected from the database. + *

    + * The credential comparison is done using the DAO class - it + * does not load the data from the database but gets the + * password to the db for checking. + *

    + * The original credentials contains attributes. This will be useful + * for the future, but has not yet been implemented. + *

    + * @see org.lamsfoundation.lams.contentrepository.ICredentials + * @author Fiona Malikoff +*/ +public class SimpleCredentials implements ICredentials { + + private String name = null; + private char[] password = null; + + /** + * Should only be used by hibernate or package calls. + * @param name + * @param password + */ + public SimpleCredentials(String name, char[] password ) { + this.name = name; + this.password = (char[]) password.clone(); + } + + /** + * Returns the name of the tool. + * + * @return the tool name. + */ + public String getName() { + return name; + } + + /** + * Returns the password. + *

    + * Note that this method returns a reference to the password. + * The password is set when the creditionals are passed in to get a ticket, + * and then removed. + *

    + * @return the password. + */ + public char[] getPassword() { + return password; + } + + /** + * Clear the current password. Clear it after use to + * ensure that it is not left in memory as security hole. + */ + public void clearPassword() { + password = new char[0]; + } +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/SimpleRepository.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/SimpleRepository.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/SimpleRepository.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,747 @@ +/* + * Created on Dec 20, 2004 + */ +package org.lamsfoundation.lams.contentrepository; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.SortedMap; +import java.util.SortedSet; +import java.util.TreeMap; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.dao.ICredentialDAO; +import org.lamsfoundation.lams.contentrepository.dao.IWorkspaceDAO; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.BeanFactoryAware; + + +/** + * Many methods in this class will throw a RepositoryRuntimeException + * if the internal data is missing. This is not indicated + * on the method signatures. + * + * The methods in this class do not explicitly check that a credential + * or ticket has been supplied. This is checked by the + * checkCredentialTicketBeforeAdvice advisor, for all transactioned + * calls (see the application context file). Therefore this + * class must be used in the Spring framework - if it is ever + * run separately and without suitable AOP support then + * each transaction method must check that the credential is okay + * or that the ticket is a known ticket (isTicketOkay() method). + * + * This class also depends on the transactions defined in the + * application context for the hibernate sessions to work properly. + * If the method isn't transactioned, then there won't be a proper + * hibernate session in the DAO and all sorts of errors will occur + * on lazy loading (even lazy loading withing the DAO) and when we + * write out nodes. + * + * So while the only footprint you see here of Spring is the beanfactory, + * the use of this as a singleton (generated by Spring) affects + * more than just how the object is created. + * + * @author Fiona Malikoff + */ +public class SimpleRepository implements IRepositoryAdmin, BeanFactoryAware { + + protected Logger log = Logger.getLogger(SimpleRepository.class); + + private ICredentialDAO credentialDAO = null; + private IWorkspaceDAO workspaceDAO = null; + + private BeanFactory beanFactory = null; + + private Set ticketIdSet = new HashSet(); // set of currently known tickets. + + public SimpleRepository () { + log.info("Repository singleton being created."); + } + + /* ********** Whole of repository methods - login, logout, addWorkspace, etc ****/ + + /** + * @param workspaceName + * @return + * @throws WorkspaceNotFoundException + */ + private CrWorkspace getWorkspace(String workspaceName) throws WorkspaceNotFoundException { + // call workspace dao to get the workspace + CrWorkspace workspace = workspaceDAO.findByName(workspaceName); + if ( workspace == null ) { + throw new WorkspaceNotFoundException("Workspace "+workspaceName+" does not exist."); + } + return workspace; + } + + /** + * @param workspaceId + * @return + * @throws WorkspaceNotFoundException + */ + private CrWorkspace getWorkspace(Long workspaceId) throws WorkspaceNotFoundException { + // call workspace dao to get the workspace + CrWorkspace workspace = (CrWorkspace) workspaceDAO.find(CrWorkspace.class, workspaceId); + if ( workspace == null ) { + throw new WorkspaceNotFoundException("Workspace id="+workspaceId+" does not exist."); + } + return workspace; + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IRepository#login(org.lamsfoundation.lams.contentrepository.ICredentials, java.lang.String) + */ + public ITicket login(ICredentials credentials, String workspaceName) + throws AccessDeniedException, LoginException, WorkspaceNotFoundException { + + if ( workspaceDAO == null || credentialDAO == null ) + throw new RepositoryRuntimeException("Workspace or Credential DAO object missing. Unable to process login."); + + CrWorkspace workspace = getWorkspace(workspaceName); + + if ( ! credentialDAO.checkCredential(credentials, workspace) ) { + throw new LoginException("Login failed. Password incorrect or not authorised to access this workspace."); + } + + // okay, we should now be able to create a ticket + // make ticket, create new credentials without the password + ITicket ticket = new SimpleTicket(workspace.getWorkspaceId()); + ticketIdSet.add(ticket.getTicketId()); + return (ITicket) ticket; + } + + + /** Add a workspace, giving the credentials as the user of this workspace. + * It does not clear the password in the credentials + * @param credentials this user/password must already exist in the repository. Password will be checked. + * @param workspaceName + * @throws LoginException if credentials are not authorised to add/access the new workspace. + * @throws ItemExistsException if the workspace already exists. + * @throws RepositoryCheckedException if parameters are missing. + */ + public void addWorkspace(ICredentials credentials, String workspaceName) + throws AccessDeniedException, LoginException, ItemExistsException, RepositoryCheckedException { + + // call workspace dao to check the login and get the workspace + if ( workspaceDAO == null || credentialDAO == null || beanFactory == null ) + throw new RepositoryRuntimeException("Workspace, Credential DAO or Bean Factory object missing. Unable to process login."); + + CrWorkspace workspace = workspaceDAO.findByName(workspaceName); + if ( workspace != null ) { + throw new ItemExistsException("Workspace "+workspaceName+" already exists, cannot add workspace."); + } + + // check the credentials + if ( ! credentialDAO.checkCredential(credentials ) ) { + throw new LoginException("User not authorised to access the repository."); + } + + // try to create the workspace - this should be done via the Spring bean factory. + CrWorkspace crWorkspace = new CrWorkspace(); + crWorkspace.setName(workspaceName); + workspaceDAO.insert(crWorkspace); + assignCredentials(credentials, crWorkspace); + } + + /** + * Create a new repository "user" - usually a tool. + * The password must be at least 6 chars. + * This method will not wipe out the password in the newCredential object. + * Possibly this should only be available to an internal management tool + * *** Security Risk - I'm converting two passwords to a string... *** + */ + public void createCredential(ICredentials newCredential) + throws AccessDeniedException, RepositoryCheckedException { + if ( newCredential == null || newCredential.getName() == null || newCredential.getPassword() == null) + throw new RepositoryCheckedException("Credential is null or name/password is missing - cannot create credential."); + + verifyNewPassword(newCredential.getPassword()); + + // check that the user doesn't already exist + CrCredential cred = credentialDAO.findByName(newCredential.getName()); + if ( cred != null ) + throw new RepositoryCheckedException("Credential name "+newCredential.getName()+" already exists - cannot create credential."); + + // try to create the credential - this should be done via the Spring bean factory. + cred = new CrCredential(); + cred.setName(newCredential.getName()); + cred.setPassword(new String(newCredential.getPassword())); + credentialDAO.insert(cred); + } + + /** + * Update a credential. Name cannot change, so really only the password changes + * The password must be at least 6 chars. + * Possibly this should only be available to an internal management tool + * *** Security Risk - I'm converting the password to a string... *** + * @throws LoginException if the oldCredential fails login test (e.g. wrong password) + * @throws RepositoryCheckedException if one of the credentials objects are missing + * @throws RepositoryRuntimeException if an internal error occurs. + */ + public void updateCredentials(ICredentials oldCredential, ICredentials newCredential) + throws AccessDeniedException, LoginException, RepositoryCheckedException, RepositoryRuntimeException + { + ///throws RepositoryCheckedException { + if ( workspaceDAO == null || credentialDAO == null ) + throw new RepositoryRuntimeException("Workspace or Credential DAO object missing. Cannot update credentials."); + + if ( oldCredential == null || newCredential == null ) + throw new RepositoryCheckedException("Credentials missing. Cannot update credentials."); + + if ( ! credentialDAO.checkCredential(oldCredential) ) + throw new LoginException("Old password wrong. Cannot update credentials."); + + char[] newPassword = newCredential.getPassword(); + if ( newPassword != null ) { + // if there isn't a new password then there isn't anything to change... + verifyNewPassword(newPassword); + CrCredential cred = credentialDAO.findByName(oldCredential.getName()); + cred.setPassword(new String(newPassword)); + credentialDAO.update(cred); + } + } + + /** + * Checks that a password meets our password criteria. This could be implemented + * as a Strategy, but that's overkill! + * + * Checks that the password is six or more characters. + * @param password + * @throws RepositoryCheckedException if + */ + private void verifyNewPassword(char[] password ) throws RepositoryCheckedException { + if ( password != null && password.length < 6 ) + throw new RepositoryCheckedException("Password invalid - must be 6 or more characters. Cannot create credential."); + } + + /** + * Assign credentials to a workspace. + * Will check the credentials to ensure they are in the database. + * Possibly this should only be available to an internal management tool + */ + public void assignCredentials(ICredentials credentials, String workspaceName) + throws AccessDeniedException, RepositoryCheckedException, WorkspaceNotFoundException, LoginException { + + if ( workspaceDAO == null) + throw new RepositoryRuntimeException("Workspace DAO object missing. Cannot assign credentials."); + + if ( credentials == null || workspaceName == null ) + throw new RepositoryCheckedException("Credentials or workspace is missing. Cannot assign credentials."); + + if ( ! credentialDAO.checkCredential(credentials) ) + throw new LoginException("Credentials are not authorised to have access to the repository/workspace."); + + // call workspace dao to get the workspace + CrWorkspace workspace = getWorkspace(workspaceName); + if ( workspace == null ) { + throw new WorkspaceNotFoundException("Workspace "+workspaceName+" does not exist."); + } + + assignCredentials(credentials, workspace); + } + + /** + * Assign credentials to a workspace. Assume credentials are already checked. + * Possibly this should only be available to an internal management tool. Workspace + * is expected to be attached to a session. + * *** Security Risk - I'm converting the password to a string by reading it in from the database... *** + */ + private void assignCredentials(ICredentials credentials, CrWorkspace workspace) + throws RepositoryCheckedException { + + if ( workspaceDAO == null || credentialDAO == null ) + throw new RepositoryRuntimeException("Workspace or Credential DAO object missing. Cannot assign credentials."); + + if ( credentials == null || workspace == null ) + throw new RepositoryCheckedException("Credentials or workspace is missing. Cannot assign credentials."); + + CrCredential crCredential = credentialDAO.findByName(credentials.getName()); + if ( crCredential == null ) + throw new RepositoryCheckedException("Credential object cannot be found in database. Cannot assign credentials."); + + CrWorkspaceCredential wc = new CrWorkspaceCredential(); + wc.setCrCredential(crCredential); + wc.setCrWorkspace(workspace); + + Set wcSet = workspace.getCrWorkspaceCredentials(); + if ( wcSet == null ) { + log.debug("Creating new wc set for workspace "+workspace.getName()); + wcSet = new HashSet(); + wcSet.add(wc); + workspace.setCrWorkspaceCredentials(wcSet); + } else { + Iterator iter = wcSet.iterator(); + CrWorkspaceCredential found = null; + while ( iter.hasNext() && found == null ) { + CrWorkspaceCredential item = (CrWorkspaceCredential) iter.next(); + if ( item.getCrCredential() != null && + item.getCrCredential().getCredentialId().equals(crCredential.getCredentialId()) && + item.getCrWorkspace() != null && + item.getCrWorkspace().getWorkspaceId().equals(workspace.getWorkspaceId()) ) { + found = item; + } + } + if ( found == null ) { + // not already in the set, so we can add! + wcSet.add(wc); + } + } + + workspaceDAO.insert(wc); + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IRepository#logout(org.lamsfoundation.lams.contentrepository.ITicket) + */ + public void logout(ITicket ticket) throws AccessDeniedException { + ticketIdSet.remove(ticket.getTicketId()); + ticket.clear(); + } + + /* ********** Node related methods, requiring ticket for access ****/ + + /** Is this ticket okay? + * @see org.lamsfoundation.lams.contentrepository.IRepository#addFileItem(org.lamsfoundation.lams.contentrepository.ITicket, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) + */ + public boolean isTicketOkay(ITicket ticket) { + return ( ticket != null && ticketIdSet.contains(ticket.getTicketId()) ); + } + + /** Get an existing SimpleVersionedNode. Reads the node from the database. + * Does not cache the node. If versionId is null, then gets the latest version. + * @throws ItemNotFoundException*/ + private SimpleVersionedNode getNode(Long workspaceId, Long uuid, Long versionId) throws ItemNotFoundException { + SimpleVersionedNode dbNode = (SimpleVersionedNode) beanFactory.getBean("node", SimpleVersionedNode.class); + dbNode.loadData(workspaceId, uuid,versionId); + return dbNode; + } + + /** + * Create a file node. Does not save the node. + */ + private SimpleVersionedNode createFileNode(CrWorkspace workspace, InputStream istream, String filename, + String mimeType, String versionDescription, + String relPath, SimpleVersionedNode packageNode) + throws InvalidParameterException, FileException, ValidationException { + try { + + SimpleVersionedNode initialNodeVersion = (SimpleVersionedNode) beanFactory.getBean("node", + SimpleVersionedNode.class); + initialNodeVersion.initialiseNode(relPath, NodeType.FILENODE, (CrWorkspace) workspace, packageNode); + initialNodeVersion.setFile(istream, filename, mimeType); + return initialNodeVersion; + + } catch ( NoSuchNodeTypeException e) { + // if this is thrown, then it is bug - nothing external should cause it. + throw new RepositoryRuntimeException("Internal error: unable to add file. " + +e.getMessage(), e); + } + } + + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IRepository#addFileItem(org.lamsfoundation.lams.contentrepository.ITicket, java.io.InputStream, java.lang.String, java.lang.String, java.lang.String) + */ + public NodeKey addFileItem(ITicket ticket, InputStream istream, + String filename, String mimeType, String versionDescription) + throws FileException, AccessDeniedException, + InvalidParameterException { + + try { + CrWorkspace workspace = getWorkspace(ticket.getWorkspaceId()); + SimpleVersionedNode initialNodeVersion = createFileNode(workspace, istream, filename, mimeType, versionDescription, null, null); + initialNodeVersion.save(versionDescription, null); + return initialNodeVersion.getNodeKey(); + } catch ( ValidationException e) { + // if this is thrown, then it is bug - nothing external should cause it. + throw new RepositoryRuntimeException("Internal error: unable to add file. " + +e.getMessage(), e); + } catch ( WorkspaceNotFoundException e ) { + // if this is thrown, then it is bug - ticket shouldn't contain a workspace that doesn't exist. + throw new RepositoryRuntimeException("Internal error: unable to add file. " + +e.getMessage(), e); + } + } + + /** + * Process files in the package. + * + * @param dirPath: the directory from which to get files. Mandatory. + * @param packageNode: node representing the package. Mandatory. + * @return nodeSet: set of child nodes for the package node + * @throws InvalidParameterException + * @throws FileException + */ + private List processPackageFilesSaveNode(CrWorkspace workspace, String dirPath, SimpleVersionedNode packageNode, String versionDescription) + throws InvalidParameterException, FileException, ValidationException { + + File directory = new File(dirPath); + if ( ! directory.exists() || ! directory.isDirectory() || ! directory.canRead() ) { + throw new FileException("Directory "+dirPath+" does not exist, is not a directory or cannot be read."); + } + + // set up the path to be removed from file paths, to make a relative path. + // this is a directory but we may need to add the directory separator on the end + String removePathToMakeRelPath = directory.getAbsolutePath(); + if ( removePathToMakeRelPath.charAt(removePathToMakeRelPath.length()-1) != File.separatorChar ) + removePathToMakeRelPath += File.separatorChar; + + List nodeList = new ArrayList(); + processDirectory(workspace, removePathToMakeRelPath, directory, packageNode, versionDescription, nodeList); + return nodeList; + } + + /** + * Process Directory of files. This method is called recursively to process + * files in the initial directory and in all subdirectories of this directory. + * + * @param removePathToMakeRelPath: string to remove from a files absolute + * path to create relPath, the path relative to the package node. This is + * the absolute path to the directory that contains all the files for the package. + * This value stays the same across all recursive calls. Mandatory. + * @param dirFile: the directory from which to get files. Initially this will + * be the directory that contains the package but as recursive calls are made, + * this value will change. Mandatory. + * @param packageNode: node representing the package. Mandatory. + * @param versionDescription: version description for node. Optional. + * This value stays the same across all recursive calls. + * @param nodeSet: set of nodes to update with the new nodes. Passed in through + * the recursion for efficiency (rather than keep creating new collections). Must + * not be null. + * @throws FileException + */ + private void processDirectory(CrWorkspace workspace, String removePathToMakeRelPath, File dirFile, SimpleVersionedNode packageNode, String versionDescription, List nodeList) + throws InvalidParameterException, FileException, ValidationException { + + if ( ! dirFile.exists() || ! dirFile.isDirectory() || ! dirFile.canRead() ) { + throw new FileException("Directory "+dirFile.getAbsolutePath()+" does not exist, is not a directory or cannot be read."); + } + + File file = null; // declare outside try so available in catch + try { + + File[] files = dirFile.listFiles(); + for ( int i=0; i + * The object should be created as follows: + *

      + *
    • For an existing node: SimpleVersionedNode(), call setters for + * uuid, versionId, nodeDAO and then call loadData(). Finally, set the workspace. + *
    • For a new node: SimpleVersionedNode(), call setter for + * nodeDAO and then call loadData(). Finally, set the workspace. + *
    + * If using the Spring factory, you nodeDAO and loadData() are called + * automatically, but you will still need to set the workspace. + *

    + * Many methods in this class will throw a RepositoryRuntimeException + * if the internal data is missing. This is not indicated + * on the method signatures. + * + * TODO Should these be pooled, instead of creating a new prototype node + * each time. Some comments on the web indicate that creating a Spring bean + * and wiring it up may be expensive, so we don't want to do it. But looking + * at the Spring reference manual, it appears the pooling may hand out + * the instances on each method invocation. On other hand, other stuff I've + * read suggest that Spring won't manage the lifecycle so destroy doesn't get + * called. So, given these objects are being passed back to calling + * programs and the difficulty of initialising the db data, its tempting + * to make these POJOs not created by Spring. + * + * @author Fiona Malikoff + */ +public class SimpleVersionedNode implements BeanFactoryAware, IVersionedNodeAdmin { + + private BeanFactory beanFactory = null; + + protected Logger log = Logger.getLogger(SimpleVersionedNode.class); + + private INodeDAO nodeDAO = null; + private IFileDAO fileDAO = null; + + private CrNode node = null; + private CrNodeVersion nodeVersion = null; + private InputStream newIStream = null; + private String filePath = null; // transient data - set when the input stream is written out. + private ITicket ticket = null; // transient data - using for grouping nodes in a session + + // TODO This is a case for AOP! + /** Check that all the necessary objects exists - node, nodeVersion, nodeDAO and fileDAO + * If one of them is missing, will throw an exception, appending the specialisedMessage + * on the end. e.g specialisedMessage = "Unable to set property". */ + private void nodeObjectInitilised(String specialisedMessage) throws RepositoryRuntimeException { + if ( node == null ) + throw new RepositoryRuntimeException("Node details missing (node=null). "+specialisedMessage); + + if ( nodeVersion == null ) + throw new RepositoryRuntimeException("Node details missing (nodeVersion=null). "+specialisedMessage); + + if ( nodeDAO == null ) + throw new RepositoryRuntimeException("Node details missing (nodeDAO=null). "+specialisedMessage); + + if ( fileDAO == null ) + throw new RepositoryRuntimeException("Node details missing (fileDAO=null). "+specialisedMessage); + } + + /** + * Initialise the current node (which is assumed to be a newly created Spring + * bean) with relPath and node type. + * + * If nodeTypeName is not recognized, then NoSuchNodeTypeException is thrown. + * See {@link NodeType} for possible node types. + * + * This method belongs in a factory that creates nodes... + * + * @param relPath The path of the new Node that is to be created, + * the last item of this path will be the name of the new Node. + * @param primaryNodeTypeName The name of the primary node type of the new node. + * @return new node + * @throws NoSuchNodeTypeException if the node type is unknown. + * @throws RepositoryRuntimeException if an internal error occurs. + */ + protected void initialiseNode(String relPath, String nodeTypeName, CrWorkspace workspace, SimpleVersionedNode parentNode) + throws NoSuchNodeTypeException { + + if ( ! NodeType.isValidNodeType(nodeTypeName) ) { + throw new NoSuchNodeTypeException("Node type "+nodeTypeName+" is not a valid node type. "); + } + + CrNodeVersion parentNodeVersion = parentNode != null ? parentNode.nodeVersion : null; + createCrNode(relPath, nodeTypeName, workspace, parentNodeVersion); + if ( parentNode != null ) { + parentNode.nodeVersion.addChildNodeVersion(this.nodeVersion); + } + + } + + /** Load the data from the database (or other datastore). + * Creates the CrNode and CrNodeVersion objects. + * Equivalent of initialiseNode for existing nodes + * Checks that the workspace found in the database is the + * expected workspace. + * + * If this node object is returned to a web app, then the + * crNode and crNodeVersion objects will be disconnected + * from the session, as the session will have been ended + * with the Spring transaction. + */ + protected void loadData(Long workspaceId, Long uuid, Long versionId) throws ItemNotFoundException { + + if ( uuid == null ) { + throw new ItemNotFoundException("UUID is null, unable to find node."); + } + + if ( workspaceId == null ) { + throw new ItemNotFoundException("Workspace Id is null, unable to find node."); + } + + // If version id is null, then get latest version! + node = null; + nodeVersion = null; + + try { + node = (CrNode) nodeDAO.find(CrNode.class, uuid); + } catch (HibernateObjectRetrievalFailureException e ) { + } + + if ( node == null ) { + + throw new ItemNotFoundException("Node "+uuid+" not found."); + + } else if ( ! workspaceId.equals(node.getCrWorkspace().getWorkspaceId()) ) { + + log.error("Security warning. User of workspace "+workspaceId + +" is trying to access node "+uuid+" which is in workspace " + +node.getCrWorkspace().getWorkspaceId() + +" Request for node will be rejected."); + throw new ItemNotFoundException("Node "+uuid+" does not exist in workspace "+workspaceId); + } + + /* TODO The node codes will trigger all the versions to be loaded + * (ie counteract lazy loading but we probably don't need this! + * Would it be better to restructure database to allow a map + * to be created? + */ + nodeVersion = node.getNodeVersion(versionId); + if ( nodeVersion == null ) { + throw new ItemNotFoundException("No version " + + ( versionId != null ? "#"+versionId.toString() : "") + + "found for node"); + } + + } + + + /** + * Make the current node a new version of the given node. + *

    + * This method does not work well here as it should be on a node + * only object, not a node version object. But having a node object + * requires another interface - some methods in this class are + * really node methods, some are version methods. So live with + * this for the moment. + *

    + * If we ever pass the node back to the calling program, rather + * than working with the restricted ticket calls, then this + * method should be revisited and a new node object will be + * required - otherwise next version id could be wrong. + *

    + * Maybe put this method belongs in a factory that creates nodes... + *

    + * @throws RepositoryRuntimeException if an internal error occurs. + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#createNewVersion(java.lang.String, java.lang.String) + */ + protected void initialiseNewVersionOfNode(SimpleVersionedNode existingNode) { + + this.node = existingNode.node; + + // get next version id + Long nextVersionId = this.node.incrementNextVersionId(); + + nodeVersion = createCrNodeVersion(node.getType(), + new Date(System.currentTimeMillis()), nextVersionId, + existingNode.nodeVersion.getParentNodeVersion()); + node.getCrNodeVersions().add(nodeVersion); + } + + public NodeKey getNodeKey() { + return new NodeKey(getUUID(), getVersion()); + } + + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#setProperty(java.lang.String, java.lang.String, int) + */ + public void setProperty(String name, String value, int type) { + nodeObjectInitilised("Unable to set property "+name+" to value "+value); + nodeVersion.setProperty(name, value, type); + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#setProperty(java.lang.String, java.lang.String) + */ + public void setProperty(String name, String value) + throws RepositoryRuntimeException { + nodeObjectInitilised("Unable to set property "+name+" to value "+value); + nodeVersion.setProperty(name, value, PropertyType.STRING); + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#setProperty(java.lang.String, boolean) + */ + public void setProperty(String name, boolean value) { + nodeObjectInitilised("Unable to set property "+name+" to value "+value); + nodeVersion.setProperty(name, Boolean.toString(value), PropertyType.BOOLEAN); + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#setProperty(java.lang.String, double) + */ + public void setProperty(String name, double value) { + nodeObjectInitilised("Unable to set property "+name+" to value "+value); + nodeVersion.setProperty(name, Double.toString(value), PropertyType.DOUBLE); + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#setProperty(java.lang.String, long) + */ + public void setProperty(String name, long value) { + nodeObjectInitilised("Unable to set property "+name+" to value "+value); + nodeVersion.setProperty(name, Long.toString(value), PropertyType.LONG); + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#setProperty(java.lang.String, java.util.Calendar) + */ + public void setProperty(String name, Calendar value) { + nodeObjectInitilised("Unable to set property "+name+" to value "+value); + nodeVersion.setProperty(name, value.toString(), PropertyType.DATE); + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getProperty(java.lang.String) + */ + public IValue getProperty(String name) { + nodeObjectInitilised("Unable to get property "+name); + + return nodeVersion.getProperty(name); + } + + + /** Returns a set of IValue objects - this method could cause a problem + * when lazy initialised. + */ + public Set getProperties(){ + nodeObjectInitilised("Unable to get properties."); + return nodeVersion.getCrNodeVersionProperties(); + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getUUID() + */ + public Long getUUID() { + nodeObjectInitilised("Unable to get uuid."); + return node.getNodeId(); + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#hasProperty(java.lang.String) + */ + public boolean hasProperty(String name) { + nodeObjectInitilised("Unable to check properties."); + return nodeVersion.hasProperty(name); + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#hasProperties() + */ + public boolean hasProperties() { + nodeObjectInitilised("Unable to check properties."); + return nodeVersion.hasProperties(); + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getNodeType() + */ + public String getNodeType() { + nodeObjectInitilised("Unable to get node type."); + return node.getType(); + } + + /** (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#isNodeType(java.lang.String) + */ + public boolean isNodeType(String nodeTypeName) { + nodeObjectInitilised("Unable to get check node type."); + return node.isNodeType(nodeTypeName); + } + + /** Get the history for this node. Quite intensive operation the + * first time it is run on a node as it has to build all the + * data structures. + * @return SortedSet of IVersionDetail objects, ordered by version + */ + public SortedSet getVersionHistory() { + nodeObjectInitilised("Unable to get version history."); + return node.getVersionHistory(); + } + + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getPath() + */ + public String getPath() { + nodeObjectInitilised("Unable to get path."); + return node.getPath(); + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getTicket() + */ + public ITicket getTicket() { + return ticket; + } + + /** + * Set the ticket. Should be called when the versioned node is added to + * the ticket. Not part of the IVersionedNode interface as is is only + * set by the repository. + */ + protected void setTicket(ITicket ticket) { + this.ticket=ticket; + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getVersion() + */ + public Long getVersion() { + nodeObjectInitilised("Unable to get version."); + return nodeVersion.getVersionId(); + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getCreatedDateTime() + */ + public Date getCreatedDateTime() { + nodeObjectInitilised("Unable to get version."); + return nodeVersion.getCreatedDateTime(); + + } + + /** Get the file, as an inputstream. It is the responsibility + * of the caller to close the stream. Note: this should only be + * called once the node is saved - do not call it directly after + * setting the file stream + * + * If the node is a package node, it will get the input stream + * of the first file. + */ + public InputStream getFile() throws FileException { + nodeObjectInitilised("Unable to get file"); + + if ( isNodeType(NodeType.FILENODE) ) { + + return fileDAO.getFile(node.getNodeId(), nodeVersion.getVersionId()); + + } else if ( isNodeType(NodeType.PACKAGENODE) ) { + + try { + IValue value = getProperty(PropertyName.INITIALPATH); + String lookupPath = value != null ? value.getString() : null; + IVersionedNode startNode = getNode(lookupPath); + return startNode.getFile(); + + } catch ( ValueFormatException vfe ) { + // if this is thrown, then it is bug - nothing external should cause it. + throw new RepositoryRuntimeException("Internal error: unable to get file." + +vfe.getMessage(), vfe); + } catch ( ItemNotFoundException e ) { + throw new FileException("Unable to find initial page for package. Initial path indicated "+PropertyName.INITIALPATH); + } + + } else { + throw new FileException("Node is not a file or a package. No stream to return."); + } + } + + /** Set the file, passed in as an inputstream. The stream will be closed + * when the file is saved. Only nodes of type FILENODE can have a file! + * @param iStream mandatory + * @param filename mandatory + * @param mimeType optional */ + public void setFile(InputStream iStream, String filename, String mimeType) + throws InvalidParameterException { + + nodeObjectInitilised("Unable to set the file stream."); + + /* Perform basic validation */ + if ( ! NodeType.FILENODE.equals(node.getType()) ) + throw new InvalidParameterException("Node must be of type FILE_NODE for a file to be added to the node. Unable to set the file stream."); + + if ( iStream == null ) + throw new InvalidParameterException("InputStream is required."); + + String trimmedFilename = filename != null ? filename.trim() : null; + if ( trimmedFilename == null || trimmedFilename.length() == 0) + throw new InvalidParameterException("Filename is required."); + + /* Validation passed, set up the file details */ + this.filePath = null; // will be set when the stream is written out + this.newIStream = iStream; + setProperty(PropertyName.FILENAME, trimmedFilename); + + if ( mimeType != null && mimeType.length() > 0 ) { + setProperty(PropertyName.MIMETYPE, mimeType); + } else { + setProperty(PropertyName.MIMETYPE, (String) null); + } + } + + public String toString() { + return new ToStringBuilder(this) + .append("node", node) + .append("nodeVersion", nodeVersion) + .append("newIStream", newIStream) + .append("ticket", ticket) + .toString(); + } + + /* ********************************************************** + * Handles the actual persistence of nodes to the database + * ********************************************************** + */ + + + /** Create the CrNode, CrNodeVersion. + */ + private void createCrNode(String relPath, String nodeTypeName, CrWorkspace workspace, CrNodeVersion parentNode) { + + Date createdDate = new Date(System.currentTimeMillis()); + + // start the next version id at 1, which is used straight away by incrementNextVersionId() + node = new CrNode(relPath, nodeTypeName, createdDate, new Long(1), workspace, null); + nodeVersion = createCrNodeVersion(nodeTypeName, createdDate, node.incrementNextVersionId(), parentNode); + + HashSet versions = new HashSet(); + versions.add(nodeVersion); + node.setCrNodeVersions(versions); + + } + + /** Create a version part of a node. + */ + protected CrNodeVersion createCrNodeVersion(String nodeTypeName, + Date createdDate, Long versionId, CrNodeVersion parentNode) { + + nodeVersion = new CrNodeVersion(); + nodeVersion.setCreatedDateTime(createdDate); + nodeVersion.setNode(node); + nodeVersion.setVersionId(versionId); + nodeVersion.setParentNodeVersion(parentNode); + // nvId is set automatically on save. + // ??nodeId is set automatically on save + return nodeVersion; + + } + + + /** Validate that this node is in a state that may be saved. + * Rules: + *

      + *
    • All nodes must have a node type and created date. + *
    • Root nodes must not have a file + *
    • File nodes must have a file, must have a MIMETYPE property + *
    • Package nodes must not have a file, must have a INITIALPATH property + * @throws ValidationException if problems exist. + */ + protected void validateNode() throws ValidationException { + String errors = ""; + + if ( node == null ) + errors = errors + "\nInternal node object (node) is missing - node just doesn't exist properly! "; + + if ( nodeVersion == null ) + errors = errors + "\nInternal node object (nodeVersion) is missing - node just doesn't exist properly! "; + + if ( errors.length() == 0 ) { + + if ( ! NodeType.isValidNodeType(node.getType()) ) + errors = errors + "\nNode type "+node.getType()+" is not a valid node type. "; + + if ( node.getCreatedDateTime() == null ) + errors = errors + "\nCreated datetimestamp is missing. "; + + if ( isNodeType(NodeType.FILENODE) ) { + if ( newIStream == null ) + errors = errors + "\nNode is a file node but the file is missing. "; + if ( ! hasProperty(PropertyName.FILENAME) ) + errors = errors + "\nNode is a file node but the filename is unknown"; + } else { + if ( newIStream != null ) + errors = errors + "\nNode is a "+node.getType()+" type but a file is attached. "; + } + + if ( isNodeType(NodeType.PACKAGENODE) && ! hasProperty(PropertyName.INITIALPATH) ) + errors = errors + "\nNode is a package node but the initial path is unknown"; + + } + + if (errors.length() > 0 ){ + throw new ValidationException(errors); + } + } + + /** Save the changes to this node. + * + * If it is a file node, then it writes out the db changes and then saves + * the file. + * + * If is is a package node, then it writes out the db changes for all the nodes, + * then saves all the file. Why do it this way - we want to do all the file + * changes at the end as they cannot be rolled back if there is a db error. + * + * This method only works as we know that we have two levels of nodes - the + * childNodes can't have their own childNodes. + * + * @param childNodes Set of SimpleVersionedNode objects - the children of a packaged + * node. Will be empty for a file node, populated for a package node. + * @param versionDescription Optional. User description of this version of the node. + * If null, it is not updated. + * TODO This needs a lot of testing + */ + protected Long save(String versionDescription, List childNodes) throws ValidationException, FileException{ + + nodeObjectInitilised("Unable to save node."); + + this.saveDB(versionDescription); + if ( childNodes != null ) { + Iterator iter = childNodes.iterator(); + while (iter.hasNext()) { + SimpleVersionedNode childNode = (SimpleVersionedNode) iter.next(); + childNode.saveDB(versionDescription); + } + } + + // okay, db updated successfully, so now we can start writing out the files. + // keep track of all the written files in case we fail and need to delete them + Set fileNodesWritten = new HashSet(); + String nodePaths = null; + try { + this.writeFile(); + if ( childNodes != null ) { + Iterator iter = childNodes.iterator(); + while (iter.hasNext()) { + SimpleVersionedNode childNode = (SimpleVersionedNode) iter.next(); + childNode.writeFile(); + fileNodesWritten.add(childNode); + nodePaths = nodePaths != null + ? nodePaths + File.pathSeparator + childNode.getFilePath() + : childNode.getFilePath(); + } + } + } catch ( Exception e ) { + // Some error has occured, so we need to delete the files we already wrote + // and then rethrow the error. + + if ( fileNodesWritten.size() == 0 ) { + + log.error("Error occured while writing out files. No files already written so no files to delete. "); + + } else { + + log.error("Error occured while writing out files. Trying to delete already written files for the following nodes: "+nodePaths); + + String deleted = null; + String failedDeleted = null; + Iterator writtenIter = fileNodesWritten.iterator(); + while (writtenIter.hasNext()) { + SimpleVersionedNode element = (SimpleVersionedNode) writtenIter.next(); + int delStatus = -1; + try { + delStatus = fileDAO.delete(element.getUUID(), element.getVersion()); + } + catch ( Exception e2 ) { + // things are getting bad - throwing exceptions on the delete! + } + if ( delStatus == 1 ) { + deleted = deleted != null + ? deleted + File.pathSeparator + element.getFilePath() + : element.getFilePath(); + } else { + failedDeleted = failedDeleted != null + ? failedDeleted + File.pathSeparator + element.getFilePath() + : element.getFilePath(); + } + } + String msg = "Result of rolling back file changes:"; + if ( deleted.length() > 0 ) + msg = msg + " deleted file(s) "+deleted; + if ( failedDeleted.length() > 0) + msg = msg + " unable to delete file(s) "+failedDeleted; + log.error(msg); + } + + // now rethrow the exception. If it was a FileException then throw + // the original - don't rewrap it. + if ( FileException.class.isInstance(e) ) { + throw (FileException) e; + } else { + throw new FileException("Unable to write file "+e.getMessage(),e); + } + } + + return node.getNodeId(); + } + + /** validate node and save the database changes */ + private void saveDB(String versionDescription) throws ValidationException { + validateNode(); + + // nodeDAO to take care of insert or update (uses saveOrUpdate) + // the nodeVersion and nodeVersionProperty collections cascade + // updates and deletes, so we can just save the node! + if ( versionDescription != null ) + nodeVersion.setVersionDescription(versionDescription); + + nodeDAO.insert(node); + } + + /** Write the file out (if one exists). Sets the private attribute filePath. + * @return the path to which the file was written + */ + private void writeFile() throws FileException { + String filePath = null; + if ( newIStream != null ) { + filePath = fileDAO.writeFile(node.getNodeId(), nodeVersion.getVersionId(), newIStream); + } + setFilePath(filePath); + } + + /** + * @return Returns the filePath. + */ + private String getFilePath() { + return filePath; + } + /** + * @param filePath The filePath to set. + */ + private void setFilePath(String filePath) { + this.filePath = filePath; + } + + + /** + * Another case for the factory? + * + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getNode(String relPath) + */ + public IVersionedNode getNode(String relPath) + throws ItemNotFoundException { + + nodeObjectInitilised("Unable to get child node."); + + if ( log.isDebugEnabled() ) { + log.debug("getNode for path "+relPath+" start."); + } + + CrNodeVersion childNodeVersion = nodeVersion.getChildNodeVersion(relPath); + + if ( childNodeVersion != null ) { + SimpleVersionedNode newNode = (SimpleVersionedNode) beanFactory.getBean("node", SimpleVersionedNode.class); + newNode.node = childNodeVersion.getNode(); + newNode.nodeVersion = childNodeVersion; + return (IVersionedNode) newNode; + } else { + throw new ItemNotFoundException("Unable to find node with path "+relPath + +" as a child of node "+getUUID()); + } + } + + /** + * If no nodes are found, returns an empty set. + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#getChildNodes() + */ + public Set getChildNodes() { + Set childCrNodeVersions = nodeVersion.getChildNodeVersions(); + Set childNodes = new HashSet(); + + if ( childCrNodeVersions != null ) { + Iterator iter = childCrNodeVersions.iterator(); + while (iter.hasNext()) { + CrNodeVersion element = (CrNodeVersion) iter.next(); + SimpleVersionedNode newNode = (SimpleVersionedNode) beanFactory.getBean("node", SimpleVersionedNode.class); + newNode.node = element.getNode(); + newNode.nodeVersion = element; + childNodes.add(newNode); + } + } + if ( log.isDebugEnabled() ) { + log.debug("getNodes returning set of " + +(childNodes!=null?Integer.toString(childNodes.size()):"0") + +" nodes."); + } + + return childNodes; + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#hasParentNode() + */ + public boolean hasParentNode() { + + nodeObjectInitilised("Unable to check if there is a parent node."); + + return (nodeVersion.getParentNodeVersion() != null); + + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#hasNode(String relPath) + */ + public boolean hasNode(String relPath) { + try { + IVersionedNode node = getNode(relPath); + // don't really expect to get node == null here - if not found then should + // throw exception. + return node != null; + } catch ( ItemNotFoundException e ) { + return false; + } + } + + /** + * @see org.lamsfoundation.lams.contentrepository.IVersionedNode#hasNodes() + */ + public boolean hasNodes() { + Set childNodes = nodeVersion.getChildNodeVersions(); + return (childNodes != null && childNodes.size() > 0); + } + + /** Delete all versions of this node, returning the number of nodes + * deleted. If it is a package node, all child nodes will be deleted. + * @see org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin#deleteNode()*/ + public List deleteNode() { + + // first make a list of all the versions to delete. + // don't iterate over the set, deleting as we go so that + // we can't run into any issues trying to access something + // that is deleted or belongs to an iterator. + Long versions[] = node.getVersionIds(); + + List problemPaths = new ArrayList(); + for ( int i=0; i 0 ) { + String filenames = null; + Iterator failedIter = failedList.iterator(); + while ( iter.hasNext() ) { + String path = (String) failedIter.next(); + filenames = filenames != null ? filenames + "," + path : path; + } + log.error("Failed to delete the following files relating to workspace " + +nodeDescription + +": "+filenames); + } + return failedList; + } + + /* Delete just the db details for the current node/version and any child nodes. + * Split from the file delete to allow all the db updates to be done before the + * file updates. Adds the NodeKeys for the delete nodes to the supplied arraylist. + * Assumes nodeKeysDeleted will not be null + *

      + * We expect that deleting the version node will delete all the properties. + */ + private void deleteVersionFromDB( ArrayList nodeKeysDeleted ) { + + Set childNodes = getChildNodes(); + if ( childNodes != null ) { + // First delete the child nodes + Iterator iter = childNodes.iterator(); + while (iter.hasNext()) { + SimpleVersionedNode element = (SimpleVersionedNode) iter.next(); + element.deleteVersionFromDB( nodeKeysDeleted ); + } + } + + NodeKey nk = getNodeKey(); + + // remove the node version by removing it from the set - the + // cascade delete on the hibernate classes will take care of it. + Set versions = node.getCrNodeVersions(); + if ( versions != null ) + versions.remove(nodeVersion); + else + nodeDAO.delete(nodeVersion); + + // if this was the last version for the node, delete the node + if ( versions == null || versions.size() == 0 ) + nodeDAO.delete(node); + + nodeKeysDeleted.add(nk); + } + + /* ********************************************************** + * Following methods are required for Spring framework to set up + * the DAO object(s) and to trigger a cleanup of the filestream + * if the object is destroyed. + * ********************************************************** + */ + + /** + * @return Returns the nodeDAO. + */ + public INodeDAO getNodeDAO() { + return nodeDAO; + } + /** + * @param nodeDAO The nodeDAO to set. + */ + public void setNodeDAO(INodeDAO nodeDAO) { + this.nodeDAO = nodeDAO; + } + + /** + * @return Returns the fileDAO. + */ + public IFileDAO getFileDAO() { + return fileDAO; + } + /** + * @param fileDAO The fileDAO to set. + */ + public void setFileDAO(IFileDAO fileDAO) { + this.fileDAO = fileDAO; + } + + /** + * Clean up any resources that will not be cleaned up by the garbage + * collector after this object is destroyed. At present, all it does is + * close the filestream if needed + */ + public void destroy() { + System.out.println("SimpleVersionedNode destroy called!"); + try { + if ( newIStream != null ) { + newIStream.close(); + } + } catch ( IOException e ) { + log.debug("Unable to close stream - was it already closed perhaps?",e); + } + } + + /* **** Method for BeanFactoryAware interface *****************/ + public void setBeanFactory(BeanFactory beanFactory) throws BeansException { + this.beanFactory = beanFactory; + } + + +} + Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ValidationException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ValidationException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ValidationException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,47 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * The node is invalid for some reason. The reason should be given in + * the exception message. + */ +public class ValidationException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public ValidationException() { + this("The node is invalid."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public ValidationException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public ValidationException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public ValidationException(Throwable cause) { + this("The node is invalid.", cause); + } + + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ValueFormatException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ValueFormatException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/ValueFormatException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,46 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * Thrown when value is assigned to a propery of the wrong type, or some + * other formatting type problem. + */ +public class ValueFormatException extends RepositoryCheckedException { + /** + * Constructs a new instance of this class. + */ + public ValueFormatException() { + this("Value assigned to wrong type or other formatting error."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public ValueFormatException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public ValueFormatException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public ValueFormatException(Throwable cause) { + this("Value assigned to wrong type or other formatting error.", cause); + } + + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/WorkspaceNotFoundException.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/WorkspaceNotFoundException.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/WorkspaceNotFoundException.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,45 @@ +package org.lamsfoundation.lams.contentrepository; +/** + * Requested workspace not found. + */ +public class WorkspaceNotFoundException extends RepositoryCheckedException { + + /** + * Constructs a new instance of this class. + */ + public WorkspaceNotFoundException() { + this("Requested workspace not found."); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure cause. + * + * @param s description + */ + public WorkspaceNotFoundException(String s) { + super(s); + } + + /** + * Constructs a new instance of this class given a message describing the + * failure and a root throwable. + * + * @param s description + * @param cause root throwable cause + */ + public WorkspaceNotFoundException(String s, Throwable cause) { + super(s,cause); + + } + + /** + * Constructs a new instance of this class given a root throwable. + * + * @param cause root failure cause + */ + public WorkspaceNotFoundException(Throwable cause) { + this("Requested workspace not found.", cause); + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/contentRepositoryApplicationContext.xml =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/contentRepositoryApplicationContext.xml (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/contentRepositoryApplicationContext.xml (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + /org/lamsfoundation/lams/contentrepository/dbConnection.properties + + + + + messages + + + + + + + + + + ${jdbc.driverClassName} + ${jdbc.url} + ${jdbc.username} + ${jdbc.password} + + + + + + + + org/lamsfoundation/lams/contentrepository/CrCredential.hbm.xml + org/lamsfoundation/lams/contentrepository/CrNode.hbm.xml + org/lamsfoundation/lams/contentrepository/CrNodeVersion.hbm.xml + org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.hbm.xml + org/lamsfoundation/lams/contentrepository/CrWorkspace.hbm.xml + org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.hbm.xml + + + + + ${hibernate.dialect} + ${hibernate.show_sql} + ${hibernate.c3p0.minPoolSize} + ${hibernate.c3p0.maxPoolSize} + ${hibernate.c3p0.timeout} + ${hibernate.c3p0.max_statement} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PROPAGATION_SUPPORTS,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_SUPPORTS,-RepositoryCheckedException,-RepositoryRuntimeException + + PROPAGATION_REQUIRED,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\repository + + + Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/ICredentialDAO.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/ICredentialDAO.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/ICredentialDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,34 @@ +package org.lamsfoundation.lams.contentrepository.dao; + +import org.lamsfoundation.lams.contentrepository.CrCredential; +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.IWorkspace; +import org.lamsfoundation.lams.contentrepository.RepositoryRuntimeException; + +public interface ICredentialDAO { + + /** Check the supplied credential to the workspace. + * By doing the check at this level, the password does + * not need to be read from the database. + * @return true if credential is found + * @throws repository exception if an internal (db) error occurs + */ + public abstract boolean checkCredential(ICredentials credential, IWorkspace workspace) throws RepositoryRuntimeException; + + /** Check the supplied credential to the repository + * By doing the check at this level, the password does + * not need to be read from the database. + * @return true if credential is found + * @throws repository exception if an internal (db) error occurs + */ + public abstract boolean checkCredential(ICredentials credential) throws RepositoryRuntimeException; + + public abstract void insert(Object object); + + public abstract void update(Object object); + + public abstract void delete(Object object); + + public abstract CrCredential findByName(String name); + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/IFileDAO.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/IFileDAO.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/IFileDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,44 @@ +/* + * Created on Jan 10, 2005 + */ +package org.lamsfoundation.lams.contentrepository.dao; + +import java.io.InputStream; + +import org.lamsfoundation.lams.contentrepository.FileException; + + +/** + * Manages the reading and writing of files to the repository directories. + * + * @author Fiona Malikoff + */ +public interface IFileDAO { + + /** + * Write out a file to the repository. Closes the stream. + * @return the path to which the file was written + */ + public String writeFile(Long uuid, Long versionId, InputStream is) + throws FileException; + + /** + * Gets a file from the repository. + */ + public InputStream getFile(Long uuid, Long versionId) + throws FileException; + + /** Delete a file from the repository. If this makes the directory + * empty, then the directory should be deleted. + * @returns 1 if deleted okay, 0 if file not found, -1 if file found but a delete error occured. + */ + public int delete(Long uuid, Long versionId) + throws FileException; + + /** + * Get the actual path of the file ie the path on disk + */ + public String getFilePath(Long uuid, Long versionId) + throws FileException; + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/INodeDAO.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/INodeDAO.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/INodeDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,29 @@ +/* + * Created on Dec 20, 2004 + */ +package org.lamsfoundation.lams.contentrepository.dao; + +import java.io.Serializable; +import java.util.List; + +/** + * Data access routines for Nodes, versions and properties + * + * @author Fiona Malikoff + */ +public interface INodeDAO { + + /** Finds an object. Return null if not found (note: this + * is not the standard behaviour for Spring and Hibernate combined.) + */ + public Object find(Class objClass, Serializable id); + + public void insert(Object object); + + public void update(Object object); + + public void delete(Object object); + + public List findAll(Class objClass); + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/IWorkspaceDAO.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/IWorkspaceDAO.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/IWorkspaceDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,54 @@ +/* + * Created on Dec 20, 2004 + */ +package org.lamsfoundation.lams.contentrepository.dao; + +import java.io.Serializable; +import java.util.List; + +import org.lamsfoundation.lams.contentrepository.CrWorkspace; + + +/** + * Data access routines for Workspaces. + * + * @author Fiona Malikoff + */ +public interface IWorkspaceDAO { + + /** Get a workspace. + * + * @param workspaceName + * @return first (and expected only) workspace with this name. + */ + public CrWorkspace findByName(String workspaceName); + + /** Get all the nodes for a workspace. + * + * Can't just get the workspace as the hibernate implementation + * will lazy load the nodes, and so getNodes() will be missing + * the necessary info when workspace is returned to the calling + * code. + * + * @param workspaceId + * @return first (and expected only) workspace with this name. + */ + public List findWorkspaceNodes(Long workspaceId); + + /** Finds an object. Return null if not found (note: this + * is not the standard behaviour for Spring and Hibernate combined.) + * @param objClass + * @param id + * @return object built from database + */ + public Object find(Class objClass, Serializable id); + + public void insert(Object object); + + public void update(Object object); + + public void delete(Object object); + + public List findAll(Class objClass); + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/file/FileDAO.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/file/FileDAO.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/file/FileDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,219 @@ +/* + * Created on Jan 10, 2005 + */ +package org.lamsfoundation.lams.contentrepository.dao.file; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.dao.IFileDAO; + + +/** + * Manages the reading and writing of files to the repository directories. + * Note: this does not involve the database - so no Hibernate! + * + * @author Fiona Malikoff + */ +public class FileDAO implements IFileDAO { + + private String repositoryLocation; + protected Logger log = Logger.getLogger(FileDAO.class); + + /** + * @return array of two strings - the first is the directory, the second is the + * file path. + */ + protected String[] generateFilePath(Long uuid, Long versionId) + throws FileException { + + if ( repositoryLocation == null ) + throw new FileException("Repository location unknown. Cannot access files. This should have been configured in the Spring context."); + + String directoryPath = repositoryLocation; + + if ( uuid == null || uuid.longValue() < 1 ) + throw new FileException("Unable to generate new filename for uuid="+uuid); + + String uuidString = uuid.toString(); + if ( uuidString.length() % 2 != 0 ) { + uuidString = "0"+uuidString; + } + for ( int i=0; i 0 ) { + credentialMatched = true; + if ( val > 1 ) { + log.warn("More than one credential found for workspace " + +workspace.getWorkspaceId() + +" credential name " + +credential.getName()); + } + } + } + + } catch (HibernateException e) { + log.error("Hibernate exception occured during login. ",e); + throw new RepositoryRuntimeException("Unable to login due to internal error.", e); + } catch (SQLException se) { + log.error("SQL exception occured during login. ",se); + throw new RepositoryRuntimeException("Unable to login due to internal error.", se); + } finally { + if ( ps != null ) { + try { + ps.close(); + } catch (SQLException se2) { + log.error("SQL exception occured during login, while closing statement. ",se2); + throw new RepositoryRuntimeException("Unable to login due to internal error.", se2); + } + } + } + + return credentialMatched; + } + + public void insert(Object object) { + this.getHibernateTemplate().save(object); + } + + public void update(Object object) { + this.getHibernateTemplate().update(object); + } + + public void delete(Object object) { + this.getHibernateTemplate().delete(object); + } + + public CrCredential findByName(String name) { + + log.debug("Getting credential for name "+name); + + String queryString = "from CrCredential as c where c.name = ?"; + List credentials = getHibernateTemplate().find(queryString,name); + + if(credentials.size() == 0){ + log.debug("No credentials found"); + return null; + }else{ + return (CrCredential)credentials.get(0); + } + } + public List findAll(Class objClass) { + String query="from obj in class " + objClass.getName(); + return this.getHibernateTemplate().find(query); + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/hibernate/NodeDAO.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/hibernate/NodeDAO.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/hibernate/NodeDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,45 @@ +/* + * Created on Dec 20, 2004 + */ +package org.lamsfoundation.lams.contentrepository.dao.hibernate; + +import java.io.Serializable; +import java.util.List; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.dao.INodeDAO; +import org.springframework.orm.hibernate.support.HibernateDaoSupport; + + + +/** + * Data access routines for Nodes + * + * @author Fiona Malikoff + */ +public class NodeDAO extends HibernateDaoSupport implements INodeDAO { + + protected Logger log = Logger.getLogger(NodeDAO.class); + + public Object find(Class objClass, Serializable id) { + return this.getHibernateTemplate().load(objClass,id); + } + + public void insert(Object object) { + this.getHibernateTemplate().saveOrUpdate(object); + } + + public void update(Object object) { + this.getHibernateTemplate().update(object); + } + + public void delete(Object object) { + this.getHibernateTemplate().delete(object); + } + + public List findAll(Class objClass) { + String query="from obj in class " + objClass.getName(); + return this.getHibernateTemplate().find(query); + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/hibernate/WorkspaceDAO.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/hibernate/WorkspaceDAO.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/hibernate/WorkspaceDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,112 @@ +/* + * Created on Dec 20, 2004 + */ +package org.lamsfoundation.lams.contentrepository.dao.hibernate; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.CrWorkspace; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.dao.IWorkspaceDAO; +import org.springframework.orm.hibernate.HibernateObjectRetrievalFailureException; +import org.springframework.orm.hibernate.support.HibernateDaoSupport; + + + +/** + * Data access routines for Workspaces. + * + * @author Fiona Malikoff + */ +public class WorkspaceDAO extends HibernateDaoSupport implements IWorkspaceDAO { + + protected Logger log = Logger.getLogger(WorkspaceDAO.class); + + /** + * Get a workspace. Credentials to be checked by calling code. + * + * @param workspaceName + * @return first (and expected only) workspace with this name. + */ + public CrWorkspace findByName(String workspaceName) { + + log.debug("Getting workspace for name "+workspaceName); + + String queryString = "from CrWorkspace as w where w.name = ?"; + List workspaces = getHibernateTemplate().find(queryString,workspaceName); + + if(workspaces.size() == 0){ + log.debug("No workspaces found"); + return null; + }else{ + CrWorkspace workspace = (CrWorkspace)workspaces.get(0); + if ( log.isDebugEnabled() ) + log.debug("Returning workspace "+workspace.toString()); + return workspace; + } + } + + /** Get all the nodes for a workspace. + * + * Can't just get the workspace as the hibernate implementation + * will lazy load the nodes, and so getNodes() will be missing + * the necessary info when workspace is returned to the calling + * code. + * + * In fact, doing getNodes() here still doesn't work - there isn't + * a session! So as a hack, I'll look up the nodes directly. + * Yuck. The only other solution I can find easily doing a google + * search is using OpenSessionInViewInterceptor/OpenSessionInViewFilter + * but they seem to be designed for using when the whole item is beind + * passed to a webapp - and we don't necessarily have a webapp here. + * Maybe I'm just missing something in HibernateDaoSupport! + * + * @param workspaceId + * @return Set of CrNodes applicable to this workspace. + */ + public List findWorkspaceNodes(Long workspaceId) { + CrWorkspace workspace = (CrWorkspace) find(CrWorkspace.class, workspaceId); + Set nodes = workspace.getCrNodes(); + int size = nodes.size(); + return new ArrayList(nodes); + } + + public Object find(Class objClass, Serializable id) { + try { + return this.getHibernateTemplate().load(objClass,id); + } catch (HibernateObjectRetrievalFailureException e ) { + return null; + } + } + + public void insert(Object object) { + this.getHibernateTemplate().save(object); + } + + public void update(Object object) { + this.getHibernateTemplate().update(object); + } + + public void delete(Object object) { + this.getHibernateTemplate().delete(object); + } + + public List findAll(Class objClass) { + String query="from obj in class " + objClass.getName(); + return this.getHibernateTemplate().find(query); + } + + public void flushSession() throws RepositoryCheckedException { + try { + getSession().flush(); + } catch (Exception e) { + log.error("Exception occured during flush. ",e); + throw new RepositoryCheckedException("Unable to write changes to db successfully (flush).", e); + } + } + +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dbConnection.properties =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dbConnection.properties (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dbConnection.properties (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,19 @@ +# Properties file with JDBC-related settings. +# Applied by PropertyPlaceholderConfigurer from "learningDesignApplicationContext.xml". +# Targetted at system administrators, to avoid touching the context XML files. + +#jdbc configuration +jdbc.driverClassName=com.mysql.jdbc.Driver +jdbc.url=jdbc:mysql://localhost/lams +jdbc.username=root +jdbc.password=rootpwd + +#Hibernate configuration +hibernate.show_sql=false +hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect + +#Connection Pooling configuration +hibernate.c3p0.minPoolSize=5 +hibernate.c3p0.maxPoolSize=20 +hibernate.c3p0.timeout=1800 +hibernate.c3p0.max_statement=50 \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/package.html =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/package.html (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/package.html (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,241 @@ + + + + + + +

      +This content repository is designed to store single files and +packages of files on disk in a relatively. It is not a full +blown repository as you would find behind a web development +package. +

      +

      +Each entry in the repository is represented as a "node", which +has a unique id or uuid. Each node belongs to a workspace, and +there may be many versions to the node. The files are stored on disk +and the information about the files is stored in the lams_cr_* tables +in the database. +

      +

      +A node may represent a single file (a FILENODE) or be a package node. A +package node has a set of child nodes which are file nodes. +

      +
        +
      • To create a file node, you supply an input stream, the +filename and mimeType (if known) to the repository. The file is stored +and these details are all returned when the node is accessed. +
      • +
      • To create +a package node, you put all the files in the package in a directory +in the file system, then supply the directory path and the name +of the initial file in the package to the repository. When you +get the package node back, you can access the stream of the initial +file and then work from there. +
      • +
      • The repository also supports a data node, which is node +that has no child nodes and no file. There isn't any interface +that supports a child node but it can be added easily if desired. +
      • +
      + +

      The repository keeps a set of properties for each node. At the moment, +these are read only to tools. An additional parameter +containing arbitrary nodes could easily be added to the repository +calls and this would allow the repository to store arbitrary properties +on behalf of tools. +

      + +

      Classes

      +

      The classes of interest to tools are as follows. Apart from SimpleCredentials, tools should use the interfaces +and not the implemented classes to allow the implementation to be changed in the future. + + + + + + + + + + + + +
      ICredentials,SimpleCredentialsSimpleCredentials is an implementation of ICredentials. To log in, the +tool will create a SimpleCredentials object.
      IRepositoryThe interface used for access to the repository. This is the equivalent of a SLSB interface +to the repository. It is implemented by singleton SimpleRepository and accessed via the Spring context.
      ITicketThe Ticket represents the "authorisation" key to the repository. When the tool logs in, it +will be passed a SimpleTicket object, which implements the ITicket interface. This ticket must be supplied +back to the repository to access the tool's nodes.
      IValueAn object that allows the value of a property to be used as a String, Long, Double, Boolean +or Calendar. At present, only Strings have been used so other types (particularly Calendar) may not +function correctly. Implemented by CrNodeVersionProperty (a Hibernate based data object).
      IVersionDetailDescribes the versions of a node. Useful for displaying a version history if the +user needs to select a particular version. Implemented by SimpleVersionDetail.
      IVersionedNodeThe IVersionedNode interface represents a particular version of a node. When +the tool asks for a file or package, it will be returned the node representing the files. This node +will allow the package to get not only the filestream but the original file name and mime type.
      NodeKeyThe key to a node is made up of the UUID (Long) and a version (Long). This class +encapsulates both keys, and is used to return the keys when a node is created/updated.
      NodeTypeDefines all the valid node types. Used for testing +whether something is a file node or a package node: e.g. isNodeType(NodeType.FILENODE).
      PropertyNameDefines all the current property names - such as MIMETYPE, FILENAME. +Used to get the appropriate property from a node. e.g. IValue value = node.getProperty(PropertyName.MIMETYPE).
      PropertyTypeDefines what type a property really is - String, Long, Double, etc.
      + +

      Note: All interfaces with Admin in their name are only to be used within the repository and must not be used by tools. +It is intended to make these protected interfaces if possible - they are used by Spring so this may be difficult.

      + +

      Typical Usage

      + +

      +Sample usage of the repository can be seen in example webapp, built as lamscr.war. The struts classes +are in org.lamsfoundation.lams.contentrepository.struts (in the src hierarchy) +and the jsps are in the web hierarchy. +

      + +

      When a tool is installed, it should identify itself to the repository and create a new workspace

      +
      +	ApplicationContext context = new ClassPathXmlApplicationContext(IRepository.REPOSITORY_CONTEXT_PATH);
      +	IRepository	repository = (IRepository)context.getBean(IRepository.REPOSITORY_SERVICE_ID);
      +	ICredentials cred =  new SimpleCredentials(toolName, toolId); 
      +	repository.createCredential(cred);
      +	repository.addWorkspace(cred, workspaceName);
      +
      + +

      Before accessing the repository, the tool will need to log in. +Once the tool has been given a ticket, it must use the same repository +object (ie a repository returned by the same context). If it gets a repository +from a different context, the ticket will not be recognised and access denied. +This is a shortcoming in the repository and needs to be fixed. +

      +

      There is currently no timeout on a ticket (despite what the exception +says) so the tool may keep it for months if it wants. But if the tool +receives an access denied exception, then something has gone wrong and the +ticket is no longer valid so the tool should log in again and get a new +ticket.

      +
      +	ITicket ticket = repository.login(cred, workspaceName);
      +
      + +

      Using the ticket, the tool can now add, retrieve and delete nodes. Deleting a package +node deletes all the files in the package. Warning: deleting +removes the node completely - from both the database and the file system.

      +
      +	NodeKey fileNodeKeyV1 = repository.login.addFileItem(ticket, inputstream, filename, 
      +						mimeType, versionDescription);
      +	IVersionedNode version1Node = repository.getFileItem(ticket,fileNodeKeyV1.getUuid(), fileNodeKeyV1.getVersion());
      +
      +	NodeKey fileNodeKeyV2 = getRepository().updateFileItem(ticket, fileNodeKeyV1.getUuid(), filename,
      +	IVersionedNode version2Node = repository.getFileItem(ticket,fileNodeKeyV2.getUuid(), fileNodeKeyV2.getVersion());
      +	IVersionedNode latestFileVersionNode = repository.getFileItem(ticket,fileNodeKeyV2.getUuid(), null);
      +	InputStream isForOutputToScreen1 = latestFileVersionNode.getFile();
      +
      +	String[] problemFiles = repository.deleteVersion(ticket,fileNodeKeyV1.getUuid(), fileNodeKeyV1.getVersion());
      +
      +	NodeKey packageNodeKeyV1 = repository.addPackageItem(ticket,directoryName, initialFile, versionDescription);
      +	IVersionedNode package1Node = repository.getFileItem(packageNodeKeyV1.getUuid(), packageNodeKeyV1.getVersion());
      +
      +	NodeKey packageNodeKeyV2 = repository.updatePackageItem(ticket, packageNodeKeyV1.getUuid(), directoryName, initialFile, versionDescription);
      +	IVersionedNode package2Node = repository.getFileItem(packageNodeKeyV2.getUuid(), packageNodeKeyV2.getVersion());
      +	IVersionedNode latestPackageVersionNode = repository.getFileItem(ticket,fileNodeKeyV2.getUuid(), null);
      +	InputStream isForOutputToScreen2 = latestPackageVersionNode();
      +
      +	String[] problemFiles2 = getRepository().deleteNode(ticket,packageNodeKeyV1.getUuid());
      +
      + +

      When the tool is complete, it should logout from the repository. This +invalidates the ticket.

      +
      +	repository.logout(ticket);
      +
      +

      Exceptions and Transactions

      + +

      There are two sorts of exceptions - RepositoryCheckedException and +RepositoryRuntimeException.

      + +

      RepositoryRuntimeException may be thrown +by any call to the repository irrespective of whether it is defined +in the signature. It is used for internal errors, not errors caused +by bad input from a tool. The repository may also thrown other runtime +errors, such as the Spring runtime errors which wrap Hibernate errors. +

      + +

      RepositoryCheckedException is the superclass to 10 detailed +checked exceptions. Most calls throw more than one detailed exception. +Calling code can catch either the detailed exceptions or just +RepositoryCheckedException.

      + +

      All the calls on IRepository should be transactional, defined +in the Spring context file. If any are not defined in the context file, then +this is a bug and should be corrected!!!!!!!!!. All +of the transactions should roll back on both the RepositoryCheckedException +(as it is defined in the context file) and RepositoryRuntimeException +as the Spring trasactions will roll back on any RuntimeException. +However, all we can roll back are database changes. We cannot roll back +file system changes. For this reason, we try to do the database changes +first. But it isn't perfect.

      + +

      Configuration

      + +
        +
      • Repository location Edit +org.lamsfoundation.lams.contentrepository.contentRepositoryApplicationContext.xml +(in the src hierarchy). Defaults to D:\repository. This can reside anywhere it +can be accessed as a directory - it does not need to be under the JBOSS hierarchy. +
      • +
      • Database connection Edit +org.lamsfoundation.lams.contentrepository.contentRepositoryApplicationContext.xml +(in the src hierarchy). Defaults to jdbc:mysql://localhost/lams. +
      • +
      • Database user and password Edit properties.xml (in the root of the project) +to set the JBOSS directory. This is required for the database related ANT tasks. +
      • +
      • JBOSS location Edit properties.xml (in the root of the project) +to set the JBOSS directory. This is required for the deploy and copyfiles ANT tasks. +
      • +
      • JUNIT Testing Edit the TEXT_FILEPATH, TEXT_FILENAME, BINARY_FILEPATH +BINARY_FILENAME, PACKAGE_DIR_PATH, PACKAGE_TEST_FILE in +org.lamsfoundation.lams.contentrepository.BaseTestCase ( in the test hierarchy). +These must point to files on your PC. The TEXT* variables should point to a text file, +the BINARY* to a binary file (e.g. jpeg, zip file). The allows you to check that manually +that neither text nor binary files are corrupted. The PACKAGE_DIR_PATH should be +a directory containing an index.html file and a series of other files (e.g. images +to go with the index.html file). The PACKAGE_TEST_FILE should be the relative +path to a file within the directory. +
      • +
      + +

      Building the Repository

      +

      After configuring (see previous section) use the ANT Build script to build and deploy +the content repository code. +

        +
      • +With the database running, run the create-db-tables then the +insert-test-data targets.
        +The create-db-tables and insert-test-data targets can be run at any time. If you +run the create-db-tables then you will need to clear out all the directories in the +repository otherwise it fail when it uses an id that has a file in the repository. +You must run insert-test-data before running the JUNIT tests or the +create workspace and create user tests will fail (as the test values to be added +will already exist). +
      • +
      • +At this point, you can run the JUNIT tests if desired. To run them, run the +org.lamsfoundation.lams.contentrepositoryAllTests junit test suite. This will +run all the current tests. Note: the NodeTransactionTest class is not +complete so it is not included in the test suite. +
      • +
      • +The first time you compile, you will need to run the copyfiles target. +This is required to copy all the jar files from the project to JBOSS. You may have +all the files in your JBOSS already - many of them overlap with common. +One jar that you are likely to be missing it the commons upload. +This is not required for the repository per se, but is required for the example web app. +
      • +
      • +Finally, run the deploy-lamscr-jar or deploy-lamscr-jarwar target +(and not both). Both targets will compile and deploy the jar file, while +the second one will also deploy the example usage war file. The jar file +is the repository code. The war file is the example web app. The war file is +not needed for the repository to function. If you just want to +deploy the jar file, run lamscr-jar target and copy the +jar file manually. When development is complete, the build file will be +changed to deploy these files separately. +
      • +
      + + + \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/ApplicationResources.properties =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/ApplicationResources.properties (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/ApplicationResources.properties (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,21 @@ +# Resources for parameter 'org.lamsfoundation.lams.struts.ApplicationResources' +# Project P/lams_contentrepository +errors.mandatory={0} must not be empty. +errors.filedirmandatory=Either a file must be uploaded or a directory selected. +error.login=Unable to login to repository. Error: {0}. +error.noTicket=The ticket is missing from the session. Unable to access the repository. +error.entryStringNeeded=The file that "starts" the content is required when there is a zip file to be unpacked. +error.uuidMissing=No node has been selected. +error.repositoryUnexpected=The repository has returned an unexpected value. {0} +# we are letting all the exceptions bubble to the top so you can see them, but these messages could be used.... +# exception.loginFailed=Login failed. +# exception.accessDenied=Access was denied to the repository. +# exception.workspaceNotFound=Workspace not found. +# exception.file=Error occured accessing file. +# exception.itemNotFound=No entry found in repository. +# exception.itemExists=Node/workspace with that id/name already exists in the repository. +# exception.invalidParameter=One of the parameters to the repository call was invalid. +# exception.valueformat=Node value is not in the expected format. +# this one is used! +exception.repository=An error occured involving the repository. {0} + Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/AddFileContentAction.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/AddFileContentAction.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/AddFileContentAction.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,203 @@ + +package org.lamsfoundation.lams.contentrepository.struts.action; + +import java.io.InputStream; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionError; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.InvalidParameterException; +import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; +import org.lamsfoundation.lams.contentrepository.NodeKey; +import org.lamsfoundation.lams.contentrepository.struts.form.AddFileContentForm; + + +/** + * MyEclipse Struts + * Creation date: 11-30-2004 + * + * XDoclet definition: + * @struts:action path="/addFileContent" name="addFileContentForm" input="nodeSelection.jsp" scope="request" validate="true" parameter="method" + */ +public class AddFileContentAction extends RepositoryDispatchAction { + + // --------------------------------------------------------- Instance Variables + + // --------------------------------------------------------- Methods + + /** + * Uploads a single file. + * + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + * @throws FileException + * @throws AccessDeniedException + * @throws InvalidParameterException + * @throws ItemNotFoundException + */ + public ActionForward uploadFile( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws FileException, AccessDeniedException, InvalidParameterException, ItemNotFoundException { + + ITicket ticket = getTicket(request); + log.debug("In getNode, ticket is "+ticket); + if ( ticket == null ) { + log.error("Ticket missing from session"); + return returnError(mapping, request, + new ActionError("error.noTicket")); + } + + AddFileContentForm addFileContentForm = (AddFileContentForm) form; + + FormFile theFile = addFileContentForm.getTheFile(); + String filename = theFile.getFileName(); + String contentType = theFile.getContentType(); + String versionDescription = addFileContentForm.getDescription(); + + Long uuid = addFileContentForm.getUuid(); + + if ( log.isDebugEnabled() ) { + log.debug("Adding file content "+filename+" type "+contentType + +" version description "+versionDescription + +" for uuid "+uuid); + } + + InputStream is; + try { + is = theFile.getInputStream(); + } catch (Exception e) { + log.error("Error getting file from input form.", e); + return returnError(mapping, request, + new ActionError("exception.file")); + } + + + // exception will be handled by struts but listed explicitly + // here so (1) I can log them and (2) you can see what + // exceptions are thrown. + try { + NodeKey nodeKey = null; + if ( uuid != null ) { + // create a new version of this node + nodeKey = Download.getRepository().updateFileItem(ticket, uuid, filename, + is, contentType, versionDescription); + } else { + // create a new node + nodeKey = Download.getRepository().addFileItem(ticket, is, filename, + contentType, versionDescription); + } + + // normally the application would store the node key and + // various details in their own tables. + + } catch (FileException e1) { + log.error("FileException occured ",e1); + throw e1; + } catch (AccessDeniedException e1) { + log.error("Not allowed to do this exception occured ",e1); + throw e1; + } catch (InvalidParameterException e1) { + log.error("Parameter missing exception occured ",e1); + throw e1; + } catch (ItemNotFoundException e1) { + log.error("Item Not Found exception occured ",e1); + throw e1; + } + + log.debug("File Uploaded, forwarding to "+mapping.findForward(SUCCESS_PATH)); + return mapping.findForward(SUCCESS_PATH); + } + + /** + * Uploads a package + * + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + * @throws FileException + * @throws AccessDeniedException + * @throws InvalidParameterException + * @throws ItemNotFoundException + */ + public ActionForward uploadPackage( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws FileException, AccessDeniedException, InvalidParameterException, ItemNotFoundException { + + ITicket ticket = getTicket(request); + log.debug("In getNode, ticket is "+ticket); + if ( ticket == null ) { + log.error("Ticket missing from session"); + return returnError(mapping, request, + new ActionError("error.noTicket")); + } + + AddFileContentForm addFileContentForm = (AddFileContentForm) form; + + String dirName = addFileContentForm.getDirName(); + String entryString = addFileContentForm.getEntryString(); + String versionDescription = addFileContentForm.getDescription(); + + Long uuid = addFileContentForm.getUuid(); + + if ( log.isDebugEnabled() ) { + log.debug("Adding package content "+dirName+" start point "+entryString + +" version description "+versionDescription + +" for uuid "+uuid); + } + + // exception will be handled by struts but listed explicitly + // here so (1) I can log them and (2) you can see what + // exceptions are thrown. + try { + // if entryString is null, the repository will set it to index.html + + NodeKey nodeKey = null; + if ( uuid != null ) { + // create a new version of this node + nodeKey = Download.getRepository().updatePackageItem(ticket, uuid, dirName, + entryString, versionDescription); + } else { + // create a new node + nodeKey = Download.getRepository().addPackageItem(ticket,dirName, entryString, versionDescription); + } + + // normally the application would store the node key and + // various details in their own tables. + + } catch (FileException e1) { + log.error("FileException occured ",e1); + throw e1; + } catch (AccessDeniedException e1) { + log.error("Not allowed to do this exception occured ",e1); + throw e1; + } catch (InvalidParameterException e1) { + log.error("Parameter missing exception occured ",e1); + throw e1; + } catch (ItemNotFoundException e1) { + log.error("Item Not Found exception occured ",e1); + throw e1; + } + + log.debug("File Uploaded, forwarding to "+mapping.findForward(SUCCESS_PATH)); + return mapping.findForward(SUCCESS_PATH); + } + + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/Download.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/Download.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/Download.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,386 @@ +/* + * Created on Nov 30, 2004 + */ +package org.lamsfoundation.lams.contentrepository.struts.action; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.IRepository; +import org.lamsfoundation.lams.contentrepository.ITicket; +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.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + + +/** + * This servlet must load on startup as it contains the link + * to the repository required for the other servlets. + * + * Specialised servlet that supports the rendering of packages. + * It has a rather odd format - you can call it initially with + * the package id and uuid (and optional version) using + * download?uuid=<uuid>&version=<version> + * but then it redirects to download/<uuid>/<version>/relPath + * where the <uuid> and <version> are the uuid and version + * of the package node. + * + * The download/<uuid>/<version>/relPath should only be used + * internally - the servlet should be called with the parameter + * version initially. + * + * It also supports the fetching of ordinary file nodes - in + * this case it doesn't need to do the mucking around with + * redirecting. + * + * This / format allows the relative pathed links + * within an html file to work properly. + * + * @author Fiona Malikoff + */ + +/* A package node could be handled by either getting the + stream from the package node - this is the first file + in the package - or by using the property in the node + that specifies the path to the first file and go back + to the repository and get that node. In a roundabout + way, this servlet uses the second method - it redirects + to the path for the first file. + + method 1: the package node returns a stream which is the first file. + InputStream = node.getFile(); + set up any header variables + + + method 2: get initial path node and download that + IValue value = node.getProperty(PropertyName.INITIALPATH); + String initialPath = value != null ? value.getString() : null; + IVersionedNode childNode = getRepository().getFileItem(ticket,uuid, initialPath, null); + InputStream = node.getFile(); + + +*/ + +public class Download extends HttpServlet { + + private static IRepository repository = null; + + protected static Logger log = Logger.getLogger(Download.class); + + private static final String expectedFormat = + "Expected format /download?" + +RepositoryDispatchAction.UUID_NAME + +"&" + +RepositoryDispatchAction.VERSION_NAME + +"= (version number optional) or /download///"; + /** + * 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{ + + long start = System.currentTimeMillis(); + + ITicket ticket = RepositoryDispatchAction.getTicket(request); + if ( ticket == null ) + errorInContent(request, response,"No ticket found in session. Unable to access repository.",null); + + Long uuid = RepositoryDispatchAction.getLong(request.getParameter(RepositoryDispatchAction.UUID_NAME)); + Long version = null; + + String callId = null; + + if ( uuid != null ) { + + callId = "download "+Math.random()+" "+uuid; + + version = RepositoryDispatchAction.getLong(request.getParameter(RepositoryDispatchAction.VERSION_NAME)); + + IVersionedNode node = getFileItem(ticket, uuid, version,null); + log.error(callId+" getFileItem1 (ms) "+(System.currentTimeMillis()-start)); + // update versionId in case it was null and we got the latest version... + version = node.getVersion(); + + if ( node.isNodeType(NodeType.PACKAGENODE) ) { + + // now get the path of the initial page in the package + String initialPage = getInitialPage(request, response, node); + + // redirect to the initial path + // prepend with servlet and id - initial call doesn't include the id + // and depending on "/"s, the servlet name is sometimes lost by the redirect. + initialPage = request.getRequestURL() + "/" + uuid + + "/" + version + "/" + initialPage; + log.debug("Request url was "+request.getRequestURL()); + log.debug("Servlet path was "+request.getServletPath()); + log.debug("Attempting to redirect to initial page "+initialPage); + response.sendRedirect(initialPage); + + } else if ( node.isNodeType(NodeType.FILENODE) ) { + + handleFileNode(request, response, node); + + } else { + errorInContent(request, response,"Unsupported node type " + +node.getNodeType()+". Node Data is "+node.toString(),null); + } + + } else { + + // using the /download// format - must be a file node! + String pathString = request.getPathInfo(); + String[] strings = deriveIdFile(pathString); + uuid = RepositoryDispatchAction.getLong(strings[0]); + version = RepositoryDispatchAction.getLong(strings[1]); + String relPathString = strings[2]; + + callId = "download "+Math.random()+" "+uuid; + + if ( uuid == null ) + errorInContent(request, response, "UUID value is missing. "+expectedFormat,null); + + if ( version == null ) + errorInContent(request, response, "Version value is missing. "+expectedFormat,null); + + if ( relPathString == null ) + errorInContent(request, response, "Filename is missing. "+expectedFormat,null); + + IVersionedNode node = getFileItem(ticket, uuid, version, relPathString); + log.error(callId+" getFileItem2 (ms) "+(System.currentTimeMillis()-start)); + if ( ! node.isNodeType(NodeType.FILENODE) ) { + errorInContent(request, response,"Unexpected type of node " + +node.getNodeType()+" Expected File node. Data is "+node,null); + } + handleFileNode(request, response, node); + + } + + log.error(callId+" handleFileNode (ms) "+(System.currentTimeMillis()-start)); + + } + + /** + * The call getFileItem was throwing a runtime hibernate/jdbc error when being + * thrash tested, and I couldn't work out the context, so I've wrapped + * the call here so it can be debugged. + */ + private IVersionedNode getFileItem(ITicket ticket, Long uuid, Long version, String relPathString) + throws AccessDeniedException, ItemNotFoundException, FileException { + try { + IVersionedNode node = null; + if ( relPathString != null ) { + // get file in package + node = repository.getFileItem(ticket,uuid, version, relPathString); + } else { + // get node + node = repository.getFileItem(ticket,uuid, version); + } + return node; + } catch ( RuntimeException e ) { + log.error("Exception thrown calling repository.getFileItem(," + +uuid+","+version+","+relPathString+"). "+e.getMessage(), e); + throw e; + } + } + + /** + * @param request + * @param response + * @param node + * @param value + * @return + * @throws ValueFormatException + * @throws IOException + */ + private String getInitialPage(HttpServletRequest request, HttpServletResponse response, IVersionedNode node) + throws ValueFormatException, IOException { + + IValue value = node.getProperty(PropertyName.INITIALPATH); + String initialPage = value != null ? value.getString() : null; + if ( initialPage == null || initialPage.length() ==0 ) { + errorInContent(request, response,"No initial page found for this set of content. Node Data is "+node.toString(),null); + } + return initialPage; + } + + /** + * @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[3]; + + if ( pathInfo != null ) { + + String[] strings = pathInfo.split("/",4); + + for ( int i=0, j=0; i 0 ) { + result[j++] = strings[i]; + } + } + + } + log.debug("Split path into following strings: '" + +result[0] + +"' '"+result[1] + +"' '"+result[2]); + + 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); + } + } + + /** + * Gets the application context and gets the repository object. + * Required for the demo to run, so make sure this servlet loads on startup. + * + * @throws ServletException if an error occure + */ + public void init() throws ServletException { + System.err.println("Repository Demo calling context and getting repository singleton."); + ApplicationContext context = new ClassPathXmlApplicationContext(IRepository.REPOSITORY_CONTEXT_PATH); + repository = (IRepository)context.getBean(IRepository.REPOSITORY_SERVICE_ID); + } + + + 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()+"
      "; + } + + /** + * @return Returns the repository. + */ + public static IRepository getRepository() { + return repository; + } +} Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/LoginRepositoryAction.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/LoginRepositoryAction.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/LoginRepositoryAction.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,146 @@ +//Created by MyEclipse Struts +// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.2/xslt/JavaClass.xsl + +package org.lamsfoundation.lams.contentrepository.struts.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.IRepository; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.ItemExistsException; +import org.lamsfoundation.lams.contentrepository.LoginException; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.SimpleCredentials; +import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; +import org.lamsfoundation.lams.contentrepository.struts.form.LoginRepositoryForm; + + +/** + * MyEclipse Struts + * Creation date: 01-13-2005 + * + * The exceptions will be handled by struts but are listed explicitly + * here so (1) I can log them and (2) you can see what exceptions are thrown. + * + * XDoclet definition: + * @struts:action path="/loginRepository" name="loginRepositoryForm" input="/loginRepository.jsp" scope="request" validate="true" parameter="method" + */ +public class LoginRepositoryAction extends RepositoryDispatchAction { + + protected Logger log = Logger.getLogger(LoginRepositoryAction.class); + + // --------------------------------------------------------- Instance Variables + + // --------------------------------------------------------- Methods + + /** + * Login to the repository + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + */ + public ActionForward loginToWorkspace( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws RepositoryCheckedException { + return process(mapping, form, request, response, false); + } + + /** + * Create and login to a new workspace + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + */ + public ActionForward createNewWorkspace( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws RepositoryCheckedException { + return process(mapping, form, request, response, true); + } + + /* Get the repository bean and connect to the desired workspace. May need to create the + * workspace first - depends on createWorkspaceFirst flag. + * RepositoryCheckedException is the superclass for all the other repository checked exceptions + * thrown by this method. + */ + private ActionForward process(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response, + boolean createWorkspaceFirst) throws RepositoryCheckedException + { + log.debug("In process, createWorkspaceFirst="+createWorkspaceFirst); + + LoginRepositoryForm loginRepositoryForm = (LoginRepositoryForm) form; + if ( log.isDebugEnabled() ) { + log.debug("Form : "+form); + } + + // login to repository + String toolName = loginRepositoryForm.getToolName(); + char[] toolId = loginRepositoryForm.getIndentificationString().toCharArray(); + String workspaceName = loginRepositoryForm.getWorkspaceName(); + ICredentials cred = new SimpleCredentials(toolName, toolId); + + IRepository repository = Download.getRepository(); + + if ( createWorkspaceFirst ) { + try { + // add the tool credential, then create the workspace + // if the credential isn't added first, then the addWorkspace + // call will fail - only a valid credential can add a workspace. + repository.createCredential(cred); + repository.addWorkspace(cred, workspaceName); + } catch (LoginException e) { + log.error("LoginException occured ",e); + throw e; + } catch (ItemExistsException e) { + log.error("Workspace already exists Exception occured ",e); + throw e; + } catch (RepositoryCheckedException e) { + log.error("Some other repository error (usually internal error) occured ",e); + throw e; + } + } + + ITicket ticket; + try { + ticket = repository.login(cred, workspaceName); + } catch (LoginException e) { + log.error("LoginException occured ",e); + throw e; + } catch (AccessDeniedException e) { + log.error("Not allowed to do that type exception occured ",e); + throw e; + } catch (WorkspaceNotFoundException e) { + log.error("Workspace was not found exception occured ",e); + throw e; + } + + // add the ticket to the session. this ticket will need to kept somewhere + // by the application as it is the method of accessing the repository. + log.debug("New ticket being added to session: "+ticket); + setTicket(request, ticket); + + log.debug("Login succeeded, forwarding to "+mapping.findForward(SUCCESS_PATH)); + return mapping.findForward(SUCCESS_PATH); + + } + + + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/NodeSelectionAction.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/NodeSelectionAction.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/NodeSelectionAction.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,245 @@ +//Created by MyEclipse Struts +// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.2/xslt/JavaClass.xsl + +package org.lamsfoundation.lams.contentrepository.struts.action; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.SortedMap; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionError; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.contentrepository.InvalidParameterException; +import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; + + +/** + * MyEclipse Struts + * Creation date: 01-13-2005 + * + * The exceptions will be handled by struts but are listed explicitly + * here so (1) I can log them and (2) you can see what exceptions are thrown. + * + * XDoclet definition: + * @struts:action path="/nodeSelection" name="nodeSelectionForm" input="/nodeSelection.jsp" scope="request" parameter="method" + */ +public class NodeSelectionAction extends RepositoryDispatchAction { + + protected Logger log = Logger.getLogger(NodeSelectionAction.class); + + /** + * Get the list of nodes in the workspace. Displays the node list + * screen. + * + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + * @throws AccessDeniedException + * @throws ItemNotFoundException + * @throws FileException + */ + public ActionForward getList(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws AccessDeniedException, ItemNotFoundException, FileException { + + ITicket ticket = getTicket(request); + log.debug("In getList, ticket is "+ticket); + if ( ticket == null ) { + log.error("Ticket missing from session"); + return returnError(mapping, request, + new ActionError("error.noTicket")); + } + + // get the map of nodes and put it in the request, + // ready to be rendered by the jsp. This isn't "normal" - + // usually the app will have a list of all its nodes + // and know what they are. This getNodeList method + // was put in just to write this demo. So its not an + // efficient method, and should not be used by a real + // application. + log.debug("Getting node map"); + SortedMap map = null; + try { + map = Download.getRepository().getNodeList(ticket); + } catch (AccessDeniedException e) { + log.error("Not allowed to do this exception occured ",e); + throw e; + } + log.debug("Got map, map is "+map); + + // Normally, the application will have their own details about + // all the nodes but we don't, so go back and get the real + // node details, and only list (on the JSP) the direct file + // nodes and the package nodes - not the file nodes within + // the package nodes. + ArrayList jspList = new ArrayList(); + if ( map != null ) { + + Iterator iter = map.keySet().iterator(); + + while (iter.hasNext()) { + Long uuid = (Long) iter.next(); + + IVersionedNode node; + try { + + node = Download.getRepository().getFileItem(ticket, uuid, null); + + } catch (AccessDeniedException e) { + log.error("Not allowed to do this exception occured ",e); + throw e; + } catch (ItemNotFoundException e) { + log.error("Item not found exception occured ",e); + throw e; + } catch (FileException e) { + log.error("File exception occured ",e); + throw e; + } + + if ( ! node.hasParentNode() ) { + jspList.add(node); + jspList.add(map.get(uuid)); + } + } + } + request.setAttribute(NODE_LIST_NAME, jspList); + + log.debug("Added map to request, forwarding to "+mapping.findForward("nodelist")); + return mapping.findForward("nodelist"); + + } + + /** + * Get the list of nodes in the workspace. Displays the node list + * screen. + * + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + * @throws AccessDeniedException + * @throws ItemNotFoundException + * @throws FileException + */ + public ActionForward viewPackage(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws AccessDeniedException, ItemNotFoundException, FileException { + + ITicket ticket = getTicket(request); + log.debug("In getList, ticket is "+ticket); + if ( ticket == null ) { + log.error("Ticket missing from session"); + return returnError(mapping, request, + new ActionError("error.noTicket")); + } + + Long uuid = getLong(request.getParameter(UUID_NAME)); + Long version = getLong(request.getParameter(VERSION_NAME)); + + if ( uuid == null ) { + log.error("UUID missing"); + return returnError(mapping, request, + new ActionError("error.uuidMissing")); + } + + log.debug("Deleting node "+uuid+" version "+version); + + List packageList = null; + try { + + packageList = Download.getRepository().getPackageNodes(ticket, uuid, version); + request.setAttribute(PACKAGE_LIST, packageList); + + } catch (AccessDeniedException e) { + log.error("Not allowed to do this exception occured ",e); + throw e; + } catch (ItemNotFoundException e) { + log.error("Item not found exception occured ",e); + throw e; + } + + log.debug("Added map to request, forwarding to "+mapping.findForward("packagelist")); + return mapping.findForward("packagelist"); + } + + /** + * Delete a version of a node, or the whole node. + * + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + * @throws ItemNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws Exception + */ + public ActionForward deleteNode(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + + throws ItemNotFoundException, InvalidParameterException, + AccessDeniedException, FileException { + + ITicket ticket = getTicket(request); + log.debug("In deleteNode, ticket is "+ticket); + if ( ticket == null ) { + log.error("Ticket missing from session"); + return returnError(mapping, request, + new ActionError("error.noTicket")); + } + + Long uuid = getLong(request.getParameter(UUID_NAME)); + Long version = getLong(request.getParameter(VERSION_NAME)); + + if ( uuid == null ) { + log.error("UUID missing"); + return returnError(mapping, request, + new ActionError("error.uuidMissing")); + } + + + log.debug("Deleting node "+uuid+" version "+version); + + try { + if ( version == null ) { + String[] problemFiles = Download.getRepository().deleteNode(ticket,uuid); + log.info("Deleted node, " + +(problemFiles==null||problemFiles.length==0?0:problemFiles.length) + +" problem files were encountered."); + } else { + String[] problemFiles = Download.getRepository().deleteVersion(ticket,uuid,version); + } + + log.debug("Deleted nodes, forwarding to list"); + return getList(mapping,form,request,response); + + } catch (AccessDeniedException e) { + log.error("Not allowed to do this exception occured ",e); + throw e; + } catch (ItemNotFoundException e) { + log.error("Item not found exception occured ",e); + throw e; + } + + } + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/RepositoryDispatchAction.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/RepositoryDispatchAction.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/RepositoryDispatchAction.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,98 @@ +//Created by MyEclipse Struts +// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.2/xslt/JavaClass.xsl + +package org.lamsfoundation.lams.contentrepository.struts.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionError; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.actions.DispatchAction; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; + + +/** + * Base class for the dispatch actions used in the repository tests. + * Shares functionality such as checking ticket. + */ +public class RepositoryDispatchAction extends DispatchAction { + + public final static String TICKET_NAME = "ticket"; + + public static final String NODE_LIST_NAME = "nodeList"; + public static final String UUID_NAME = "uuid"; + public static final String VERSION_NAME = "version"; + + public static final String SUCCESS_PATH = "success"; + public static final String ERROR_PATH = "error"; + public static final String LOGOUT_PATH = "logout"; + + public static final String PACKAGE_LIST = "packageList"; + + protected static Logger log = Logger.getLogger(RepositoryDispatchAction.class); + + /** Adds this error to the errors, then goes to the error forward */ + protected ActionForward returnError(ActionMapping mapping, + HttpServletRequest request, ActionError error) { + ActionErrors errors = new ActionErrors(); + errors.add(ActionMessages.GLOBAL_MESSAGE, error); + saveErrors(request,errors); + return mapping.findForward(ERROR_PATH); + } + + protected static ITicket getTicket(HttpServletRequest request) { + return (ITicket) request.getSession().getAttribute(TICKET_NAME); + } + + protected static void setTicket(HttpServletRequest request, ITicket ticket) { + request.getSession().setAttribute(TICKET_NAME, ticket); + } + + protected static Long getLong(String longAsString) { + try { + return new Long(longAsString); + } catch ( NumberFormatException e ) { + return null; + } + } + + /** + * Logout of the workspace. Doesn't need a form. + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + */ + public ActionForward logout( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws RepositoryCheckedException { + + log.debug("In logout"); + + ITicket ticket = getTicket(request); + log.debug("In getNode, ticket is "+ticket); + if ( ticket == null ) { + log.error("Ticket missing from session"); + return returnError(mapping, request, + new ActionError("error.noTicket")); + } + + log.debug("About to logout"); + + Download.getRepository().logout(ticket); + + log.debug("Logged out to "+mapping.findForward(LOGOUT_PATH)); + return mapping.findForward(LOGOUT_PATH); + + } +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/TestLogin.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/TestLogin.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/action/TestLogin.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,122 @@ +package org.lamsfoundation.lams.contentrepository.struts.action; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.SimpleCredentials; + + +/** + * This standalone servlet is for performance testing. It acts + * as an "interface" between JMeter and the Repository jar file. + * + * All it does is logs in and puts the ticket in the session. + * It is designed to be as bare bones as possible, so that the + * performance of the servlet doesn't affect the testing too much. + * + * The user and the workspace must already exist. + * + * Parameters w=&t=&id= + * e.g. /lamscr/testlogin?w=atoolworkspace&t=atool&id=atool + * + * The login can be followed up with a call to download to get + * a file + * e.g. /lamscr/download/3/1/index.html, + * /lamscr/download/3/1/images/giralookout.jpg, + * + */ +public class TestLogin extends HttpServlet { + + + public void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + try { + login(request); + output(response); + } catch ( RepositoryCheckedException e ) { + outputError(response, e); + } + } + + public void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + try { + login(request); + output(response); + } catch ( RepositoryCheckedException e ) { + outputError(response, e); + } + } + + /* Get the repository bean and connect to the desired workspace. May need to create the + * workspace first - depends on createWorkspaceFirst flag. + * RepositoryCheckedException is the superclass for all the other repository checked exceptions + * thrown by this method. + * + * Putting System.out.printlns and running some JMeter tests showed usually + * 0 ms between start and calling login, and 0 to 94 ms between the return + * of the login call and the end of the function. During those tests, logins + * took between 15 ms and 3641 ms, and putting of the ticket in the + * request took at most 94ms. The test combined + * with downloading a large file, which creates variability. It was considered + * "verified" that most of the time is the login call, and this will be reasonably + * fast unless the system is overloaded. + */ + protected void login (HttpServletRequest request) throws RepositoryCheckedException { + + String callId = "login handleCall "+Math.random(); + long start = System.currentTimeMillis(); + + String workspaceName = request.getParameter("w"); + String toolName = request.getParameter("t"); + char[] toolId = request.getParameter("id").toCharArray(); + + ICredentials cred = new SimpleCredentials(toolName, toolId); + ITicket ticket = Download.getRepository().login(cred, workspaceName); + request.getSession().setAttribute(RepositoryDispatchAction.TICKET_NAME, ticket); + } + + protected void output(HttpServletResponse response ) throws IOException { + + response.setContentType("text/html"); + PrintWriter out = response.getWriter(); + out.println(""); + out.println(""); + out.println(" Logged In"); + out.println(" "); + out.println("

      We have logged in.

      "); + out.println(" "); + out.println(""); + out.flush(); + out.close(); + } + + protected void outputError(HttpServletResponse response, RepositoryCheckedException e ) throws IOException { + + response.setContentType("text/html"); + PrintWriter out = response.getWriter(); + out.println(""); + out.println(""); + out.println(" Error Getting Document"); + out.println(" "); + out.println("

      An error occurred: "+e.getMessage()+"

      "); + out.println(" "); + out.println(""); + out.flush(); + out.close(); + + System.err.println("Error thrown logging in."); + e.printStackTrace(System.err); + } + + + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/AddFileContentForm.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/AddFileContentForm.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/AddFileContentForm.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,159 @@ +package org.lamsfoundation.lams.contentrepository.struts.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionError; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.upload.FormFile; + +/** + * MyEclipse Struts + * Creation date: 11-30-2004 + * + * XDoclet definition: + * @struts:form name="addFileContentForm" + */ +public class AddFileContentForm extends ActionForm { + + // --------------------------------------------------------- Instance Variables + + /** theFile property */ + private FormFile theFile; + private String dirName; + private String entryString; + private String method; + private String description; + private Long uuid; + + // --------------------------------------------------------- Methods + + /** + * Method validate + * @param mapping + * @param request + * @return ActionErrors + */ + public ActionErrors validate( + ActionMapping mapping, + HttpServletRequest request) { + + ActionErrors errors = super.validate(mapping,request); + if ( errors == null ) errors = new ActionErrors(); + + if ( isEmpty(method) ) { + errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.mandatory", "Method")); + } + + if ( isEmpty(description) ) { + errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.mandatory", "Description")); + } + if ( "uploadFile".equals(method) && theFile==null ) { + errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.mandatory", "File")); + } + + if ( "uploadPackage".equals(method) && isEmpty(dirName) ) { + errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.mandatory", "Directory Name")); + } + + if ( errors.size() == 0 ) return null; + return errors; + + } + + private boolean isEmpty(String str) { + return str == null || str.trim().length() == 0 ; + } + /** + * Method reset + * @param mapping + * @param request + */ + public void reset(ActionMapping mapping, HttpServletRequest request) { + theFile = null; + dirName = null; + entryString = "index.html"; + description = null; + method = null; + uuid = null; + } + + /** + * Returns the theFile. + * @return FormFile + */ + public FormFile getTheFile() { + return theFile; + } + + /** + * Set the theFile. + * @param theFile The theFile to set + */ + public void setTheFile(FormFile theFile) { + this.theFile = theFile; + } + + /** + * @return Returns dirName + */ + public String getDirName() { + return dirName; + } + /** + * @param dirName Sets dirName + */ + public void setDirName(String dirName) { + this.dirName = dirName; + } + + /** + * @return Returns the uuid. + */ + public Long getUuid() { + return uuid; + } + /** + * @param uuid The uuid to set. + */ + public void setUuid(Long uuid) { + this.uuid = uuid; + } + /** + * @return Returns the entryString. + */ + public String getEntryString() { + return entryString; + } + /** + * @param entryString The entryString to set. + */ + public void setEntryString(String entryString) { + this.entryString = entryString; + } + /** + * @return Returns the method. + */ + public String getMethod() { + return method; + } + /** + * @param method The method to set. + */ + public void setMethod(String method) { + this.method = method; + } + /** + * @return Returns the description. + */ + public String getDescription() { + return description; + } + /** + * @param description The description to set. + */ + public void setDescription(String description) { + this.description = description; + } +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/LoginRepositoryForm.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/LoginRepositoryForm.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/LoginRepositoryForm.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,123 @@ +//Created by MyEclipse Struts +// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.2/xslt/JavaClass.xsl + +package org.lamsfoundation.lams.contentrepository.struts.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionError; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; + +/** + * MyEclipse Struts + * Creation date: 01-13-2005 + * + * XDoclet definition: + * @struts:form name="loginRepositoryForm" + */ +public class LoginRepositoryForm extends ActionForm { + + // --------------------------------------------------------- Instance Variables + + /** toolName property */ + private String toolName; + + /** workspaceName property */ + private String workspaceName; + + /** indentificationString property */ + private String indentificationString; + + // --------------------------------------------------------- Methods + + /** + * Method validate + * @param mapping + * @param request + * @return ActionErrors + */ + public ActionErrors validate( + ActionMapping mapping, + HttpServletRequest request) { + + ActionErrors errors = super.validate(mapping,request); + if ( errors == null ) errors = new ActionErrors(); + + if ( getToolName() == null || getToolName().length() < 1 ) { + errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.mandatory","Tool Name")); + } + + if ( getWorkspaceName() == null || getWorkspaceName().length() < 1 ) { + errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.mandatory","Tool Name")); + } + + if ( getIndentificationString() == null || getIndentificationString().length() < 1 ) { + errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.mandatory","Tool Name")); + } + + if ( errors.size() == 0 ) return null; + return errors; + } + + /** + * Method reset + * @param mapping + * @param request + */ + public void reset(ActionMapping mapping, HttpServletRequest request) { + setToolName(""); + setWorkspaceName(""); + setIndentificationString(""); + } + + /** + * Returns the toolName. + * @return String + */ + public String getToolName() { + return toolName; + } + + /** + * Set the toolName. + * @param toolName The toolName to set + */ + public void setToolName(String toolName) { + this.toolName = toolName; + } + + /** + * Returns the workspaceName. + * @return String + */ + public String getWorkspaceName() { + return workspaceName; + } + + /** + * Set the workspaceName. + * @param workspaceName The workspaceName to set + */ + public void setWorkspaceName(String workspaceName) { + this.workspaceName = workspaceName; + } + + /** + * Returns the indentificationString. + * @return String + */ + public String getIndentificationString() { + return indentificationString; + } + + /** + * Set the indentificationString. + * @param indentificationString The indentificationString to set + */ + public void setIndentificationString(String indentificationString) { + this.indentificationString = indentificationString; + } + +} \ No newline at end of file Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/NodeSelectionForm.java =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/NodeSelectionForm.java (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/struts/form/NodeSelectionForm.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,61 @@ +//Created by MyEclipse Struts +// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.2/xslt/JavaClass.xsl + +package org.lamsfoundation.lams.contentrepository.struts.form; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; + +/** + * Didn't want to create this class, but I keep getting "Cannot retrieve definition for form bean null" + * exception so it was just easier to write it and ignore it... + * XDoclet definition: + * @struts:form name="nodeSelectionForm" + */ +public class NodeSelectionForm extends ActionForm { + + // --------------------------------------------------------- Instance Variables + + private Map nodeMap; + + // --------------------------------------------------------- Methods + + /** + * Method validate + * @param mapping + * @param request + * @return ActionErrors + */ + public ActionErrors validate( + ActionMapping mapping, + HttpServletRequest request) { + + return null; + } + + /** + * Method reset + * @param mapping + * @param request + */ + public void reset(ActionMapping mapping, HttpServletRequest request) { + } + + /** + * @return Returns the nodeMap. + */ + public Map getNodeMap() { + return nodeMap; + } + /** + * @param nodeMap The nodeMap to set. + */ + public void setNodeMap(Map nodeMap) { + this.nodeMap = nodeMap; + } +} \ No newline at end of file Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/AllTests.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/AllTests.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/AllTests.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,34 @@ +/* + * Created on Jan 11, 2005 + */ +package org.lamsfoundation.lams.contentrepository; + +import org.lamsfoundation.lams.contentrepository.dao.file.TestFileDAO; + +import junit.framework.Test; +import junit.framework.TestSuite; + + +/** + * Runs all the currently implemented tests for the Content Repository. + * Before running, load the test data in the database, clear + * the repository and check that the files listed in BaseTestCase + * exist. + * + * @author Fiona Malikoff + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite( + "Test for org.lamsfoundation.lams.contentrepository"); + //$JUnit-BEGIN$ + suite.addTestSuite(TestSimpleTicket.class); + suite.addTestSuite(TestSimpleVersionDetail.class); + suite.addTestSuite(TestSimpleVersionedNode.class); + suite.addTestSuite(TestSimpleRepository.class); + suite.addTestSuite(TestFileDAO.class); + //$JUnit-END$ + return suite; + } +} \ No newline at end of file Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/BaseTestCase.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/BaseTestCase.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/BaseTestCase.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,100 @@ +package org.lamsfoundation.lams.contentrepository; + +import junit.framework.TestCase; + +import org.apache.log4j.BasicConfigurator; +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.IRepository; +import org.lamsfoundation.lams.contentrepository.IRepositoryAdmin; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; +import org.lamsfoundation.lams.contentrepository.SimpleCredentials; +import org.lamsfoundation.lams.contentrepository.SimpleVersionedNode; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + + +public class BaseTestCase extends TestCase { + protected static ApplicationContext context = null; + + protected static IRepositoryAdmin repository = null; + protected static ITicket ticket = null; + + // two workspaces exist initially, and atool has access to both. + protected static final String INITIAL_WORKSPACE = "atoolWorkspace"; + protected static final Long INITIAL_WORKSPACE_ID = new Long(1); + protected static final String INITIAL_WORKSPACE_USER = "atool"; + protected static final char[] INITIAL_WORKSPACE_PASSWORD = {'a','t','o','o','l'}; + + protected static final String SECONDARY_WORKSPACE = "atoolWorkspace2"; + + protected static final String TEST_NODE_PATH = "/test"; + protected static final Long TEST_DATA_NODE_ID = new Long(1); // A datanode that should already be in db + protected static final Long TEST_FILE_NODE_ID = new Long(2); // A filenode that should already be in db + + protected final String TEXT_FILEPATH = "D:\\eclipse\\notice.html"; + protected final String TEXT_FILENAME = "notice.html"; + protected final String BINARY_FILEPATH = "D:\\eclipse\\startup.jar"; + protected final String BINARY_FILENAME = "startup.jar"; + + // directory containing index.html and related files + // PACKAGE_NUM_FILES should be the number of files in the + // package excluding the directories e.g 1 html & 6 images = 7 + // no matter how many directories they may be spread across. + protected final String PACKAGE_DIR_PATH = "C:\\temp\\girakool2003"; + protected final String PACKAGE_TEST_FILE = "images/girafalls3.jpg"; + protected final int PACKAGE_NUM_FILES = 7; + + public BaseTestCase(){ + super(); + // Uncomment the following line to get debuggging. + // BasicConfigurator.configure(); + + // this is run for each test so once we have it, we don't + // want to get it again! + if ( context == null ) { + context = new ClassPathXmlApplicationContext(IRepository.REPOSITORY_CONTEXT_PATH); + } + + if ( repository == null ) { + // get repository object from bean factory + repository =(IRepositoryAdmin)context.getBean(IRepository.REPOSITORY_SERVICE_ID); + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, INITIAL_WORKSPACE_PASSWORD); + try { + ticket = repository.login(cred, INITIAL_WORKSPACE); + } catch ( Exception e ) { + failUnexpectedException(e); + } + } + } + + protected void failUnexpectedException(Exception e) { + System.out.println("Unexpected exception: "); + e.printStackTrace(); + fail("Unexpected exception thrown."+e.getMessage()); + } + + protected void failUnexpectedException(String testName, Exception e) { + System.out.println(testName+": unexpected exception: "); + e.printStackTrace(); + fail("Unexpected exception thrown."+e.getMessage()); + } + + /** Normally this functionality is handled by the ticket */ + protected SimpleVersionedNode getNode(Long workspaceId, Long nodeId) { + SimpleVersionedNode loadNode =(SimpleVersionedNode)context.getBean("node", SimpleVersionedNode.class); + try { + loadNode.loadData(workspaceId, nodeId, null); // loads the latest version + } catch (ItemNotFoundException e) { + e.printStackTrace(); + fail("Latest version of test node not found, id="+nodeId); + } + return loadNode; + } + + protected SimpleVersionedNode getTestNode() { + return getNode(INITIAL_WORKSPACE_ID, TEST_DATA_NODE_ID); + } + + +} Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/NodeTransactionTest.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/NodeTransactionTest.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/NodeTransactionTest.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,66 @@ +package org.lamsfoundation.lams.contentrepository; + +import junit.framework.TestCase; + +/** + * Test the node's transaction handling. Need to test the following scenarios: + * + *
        + *
      • Start to create a new node with a file. Before ending the transaction, start + * another transaction that tries to create a node with the same file. Save the second + * node, then the first node. This test should successfully write two UNRELATED nodes. + *
      • Read an existing node. Start a transaction and make a change to the node. Save + * the node. This test should be successful, with a new version of this node created. + *
      • Read an existing node. Create a file (in the filesystem) to conflict with the + * next version to be written for this node. Start a transaction, make a change to the + * node and save the node. This test should fail, with a conflict on the added file. + *
      • Read an existing node. Start a transaction and make a change to the node. + * Start another transaction and make a change to the same version of the node. + * Save the node in the first transaction. Save the node in the second transaction. This + * test should fail with the save to the node in the second transaction + * rolling back (node out of date). + *
      • Read an existing node. Start a transaction and make a change to the node. + * Start another transaction and make a change to the same version of the node. + * Save the node in the second transaction then the node in the first transaction. This + * test should fail with the save to node in the first transaction rolling back + * (node out of date). + *
      • Read an existing node. Start a transaction and make a change to the node. + * Start another transaction and make a change to the same version of the node. + * Save the node in the first transaction but do not end the transaction. + * Save the node in the second transaction. This test should fail with the save + * to the node in the second transaction rolling back due to the database lock (either + * db level or our own field lock. + *
      • Read an existing node. Start a transaction and create a new version + * of the node, with a very large file. Save the node. When it is partway through + * writing the file, kill the file write at an operating system level. + * e.g. disconnect the filesystem. This should fail but the outcome on the database + * changes have not yet been decided. Note: it may not be possible to automate + * this test! + *
      + * @author Fiona Malikoff + */ +public class NodeTransactionTest extends TestCase { + + /* + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUp(); + } + + /* + * @see TestCase#tearDown() + */ + protected void tearDown() throws Exception { + super.tearDown(); + } + + /** + * Constructor for NodeTransactionTest. + * @param name + */ + public NodeTransactionTest(String name) { + super(name); + } + +} Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleRepository.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleRepository.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleRepository.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,596 @@ +package org.lamsfoundation.lams.contentrepository; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.SortedSet; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.IVersionDetail; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; +import org.lamsfoundation.lams.contentrepository.LoginException; +import org.lamsfoundation.lams.contentrepository.NodeKey; +import org.lamsfoundation.lams.contentrepository.NodeType; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.SimpleCredentials; +import org.lamsfoundation.lams.contentrepository.SimpleVersionedNode; +import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; +import org.lamsfoundation.lams.contentrepository.dao.IFileDAO; +import org.lamsfoundation.lams.contentrepository.dao.file.FileDAO; + + +/** + * Test SimpleRepository and the Credentials code. + * + * @author Fiona Malikoff + */ +public class TestSimpleRepository extends BaseTestCase { + + protected Logger log = Logger.getLogger(TestSimpleRepository.class); + + String wrongWorkspaceExists = "btoolWorkspace"; + String wrongWorkspaceDoesNotExist = "ctoolWorkspace"; + String newWorkspace = "newtoolWorkspace"; + String workspaceAlreadyExistsMessage = "Workspace newtoolWorkspace already exists, cannot add workspace."; + String wrongUser = "btool"; + String newUser = "ctool"; + String userAlreadyExistsMessage = "Credential name ctool already exists - cannot create credential."; + char[] wrongPassword = {'b','t','o','o','l'}; + char[] newPassword1 = {'c','t','o','o','l','x'}; + char[] newPassword2 = {'d','t','o','o','l','x'}; + + Long one = new Long(1); + Long two = new Long(2); + String v1Description = "Draft"; + String v2Description = "Final"; + + /** + * Constructor for SimpleRepositoryTest. + * @param arg0 + */ + public TestSimpleRepository() { + super(); + } + + public void testLoginPass() { + // get a credential from the bean factory + // setup credential with known username/password + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, INITIAL_WORKSPACE_PASSWORD); + try { + ITicket ticket = repository.login(cred, INITIAL_WORKSPACE); + assertNotNull("Login succeeded, ticket returned.", ticket); + } catch ( Exception e ) { + failUnexpectedException(e); + } + } + + public void testLoginFailWrongUser() { + // get a credential from the bean factory + // setup credential with known username/password + ICredentials cred = new SimpleCredentials(wrongUser, INITIAL_WORKSPACE_PASSWORD); + try { + ITicket ticket = repository.login(cred, INITIAL_WORKSPACE); + fail("Login succeeded but expected it to fail as username was wrong. Ticket is "+ticket); + } catch ( LoginException le ) { + assertTrue("Login exception thrown as expected. Exception was "+le.getMessage(),true); + } catch ( Exception e ) { + failUnexpectedException(e); + } + } + + public void testLoginFailWrongPassword() { + // get a credential from the bean factory + // setup credential with known username/password + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, wrongPassword); + try { + ITicket ticket = repository.login(cred, INITIAL_WORKSPACE); + fail("Login succeeded but expected it to fail as password was wrong. Ticket is "+ticket); + } catch ( LoginException le ) { + assertTrue("Login exception thrown as expected. Exception was "+le.getMessage(),true); + } catch ( Exception e ) { + failUnexpectedException(e); + } + } + + public void testLoginFailWrongWorkspaceExists() { + // get a credential from the bean factory + // setup credential with known username/password + try { + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, INITIAL_WORKSPACE_PASSWORD); + ITicket ticket = repository.login(cred, wrongWorkspaceExists); + fail("Login succeeded but expected it to fail as password was wrong. Ticket is "+ticket); + } catch ( WorkspaceNotFoundException we ) { + assertTrue("Workspace not found exception thrown as expected.",true); + } catch ( Exception e ) { + failUnexpectedException(e); + } + } + + public void testLoginFailWrongWorkspaceDoesNotExist() { + // get a credential from the bean factory + // setup credential with known username/password + try { + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, INITIAL_WORKSPACE_PASSWORD); + ITicket ticket = repository.login(cred, wrongWorkspaceDoesNotExist); + fail("Login succeeded but expected it to fail as password was wrong. Ticket is "+ticket); + } catch ( WorkspaceNotFoundException we ) { + assertTrue("Workspace not found exception thrown as expected. Exception was "+we.getMessage(), true); + } catch ( Exception e ) { + failUnexpectedException(e); + } + } + + public void testAddWorkspace() { + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, INITIAL_WORKSPACE_PASSWORD); + try { + repository.addWorkspace(cred,newWorkspace); + ITicket ticket = repository.login(cred, newWorkspace); + assertNotNull("Add workspace succeeded - can login to workspace. Ticket is "+ticket, ticket); + } catch ( AccessDeniedException ae ) { + assertTrue("Access denied exception thrown as expected. Exception was "+ae.getMessage(), true); + } catch ( Exception e ) { + failUnexpectedException(e); + } + + // repeat the add - should fail as the workspace name already exists + try { + repository.addWorkspace(cred,newWorkspace); + ITicket ticket = repository.login(cred, newWorkspace); + fail("Add workspace suceeded but it should have failed as workspace already exists."); + } catch ( RepositoryCheckedException re ) { + assertTrue("Repository exception thrown was due to name duplication as expected: "+re.getMessage(), + re.getMessage() != null && re.getMessage().equals(workspaceAlreadyExistsMessage)); + } catch ( Exception e ) { + failUnexpectedException(e); + } +} + + /** Tests adding a new user and changing a password */ + public void testUserAdmin() { + // try creating a new user. + // setup credential with known username/password + ICredentials cred1 = new SimpleCredentials(newUser, newPassword1); + ICredentials cred2 = new SimpleCredentials(newUser, newPassword2); + try { + repository.createCredential(cred1); + repository.assignCredentials(cred1, INITIAL_WORKSPACE); + ITicket newTicket = repository.login(cred1, INITIAL_WORKSPACE); + assertTrue("Login succeeded for new user to original workspace.",true); + } catch ( LoginException le ) { + assertTrue("Login exception unexpectededly - user newly created. Exception was "+le.getMessage(),true); + } catch ( Exception e ) { + failUnexpectedException(e); + } + + try { + // resetup the credential as the password will have been cleared by login. + cred1 = new SimpleCredentials(newUser, newPassword1); + repository.updateCredentials(cred1,cred2); + ITicket newTicket = repository.login(cred2, INITIAL_WORKSPACE); + assertTrue("Login succeeded for new user to original workspace with new password.",true); + } catch ( LoginException le ) { + assertTrue("Login exception unexpectededly - user password changed. Exception was "+le.getMessage(),true); + } catch ( Exception e ) { + failUnexpectedException(e); + } + + // try recreating a new user - should fail + // setup credential with known username/password + try { + repository.createCredential(cred1); + fail("User creation should have failed due to duplicate username"); + } catch ( RepositoryCheckedException re ) { + assertTrue("Repository exception thrown was due to name duplication as expected: "+re.getMessage(), + re.getMessage() != null && re.getMessage().equals(userAlreadyExistsMessage)); + } catch ( Exception e ) { + failUnexpectedException(e); + } + } + + /** create a node with two versions and test deleting them using delete version */ + public void testFileItemDeleteVersion() { + IFileDAO fileDAO = (FileDAO)context.getBean("fileDAO", FileDAO.class); + + NodeKey keys = testAddFileItem(TEXT_FILEPATH, TEXT_FILENAME,null,one); + checkFileNodeExist(fileDAO, keys.getUuid(), one, 1); + keys = testAddFileItem(BINARY_FILEPATH, BINARY_FILENAME,keys.getUuid(),two); + checkFileNodeExist(fileDAO, keys.getUuid(), two, 2); + + deleteVersion(keys.getUuid(), two); + checkFileNodeExist(fileDAO, keys.getUuid(), one, 1); + checkFileNodeDoesNotExist(fileDAO, keys.getUuid(), two, 1); + + deleteVersion(keys.getUuid(), one); + checkFileNodeDoesNotExist(fileDAO, keys.getUuid(), one, 0); + checkFileNodeDoesNotExist(fileDAO, keys.getUuid(), two, 0); + } + + /** create a node with two versions and test deleting them using delete node */ + public void testFileItemDeleteNode() { + + IFileDAO fileDAO = (FileDAO)context.getBean("fileDAO", FileDAO.class); + + NodeKey keys = testAddFileItem(TEXT_FILEPATH, TEXT_FILENAME,null,one); + checkFileNodeExist(fileDAO, keys.getUuid(), one, 1); + testAddFileItem(BINARY_FILEPATH, BINARY_FILENAME,keys.getUuid(),two); + checkFileNodeExist(fileDAO, keys.getUuid(), two, 2); + + deleteNode(keys.getUuid()); + checkFileNodeDoesNotExist(fileDAO, keys.getUuid(), one, 0); + checkFileNodeDoesNotExist(fileDAO, keys.getUuid(), two, 0); + } + + /** create a node with two versions and test deleting them using delete node + * but first rig the files so one of them is already gone and the other one is + * read only. Note: java can delete a read only file - the status just + * stops you from writing it. + */ + public void testFileItemDeleteNodeFileProb() { + + IFileDAO fileDAO = (FileDAO)context.getBean("fileDAO", FileDAO.class); + + NodeKey keys = testAddFileItem(TEXT_FILEPATH, TEXT_FILENAME,null,one); + checkFileNodeExist(fileDAO, keys.getUuid(), one, 1); + testAddFileItem(BINARY_FILEPATH, BINARY_FILENAME,keys.getUuid(),two); + checkFileNodeExist(fileDAO, keys.getUuid(), two, 2); + + String expectProbPath = null; + try { + File file = new File(fileDAO.getFilePath(keys.getUuid(), one)); + boolean success = file.delete(); + assertTrue("Fudge deletion worked.", success); + file = new File(fileDAO.getFilePath(keys.getUuid(), two)); + file.setReadOnly(); + } catch (RepositoryCheckedException re) { + failUnexpectedException("testTextFileItem",re); + } + + deleteNode(keys.getUuid()); + checkFileNodeDoesNotExist(fileDAO, keys.getUuid(), one, 0); + checkFileNodeDoesNotExist(fileDAO, keys.getUuid(), two, 0); + + } + + private void checkFileNodeExist(IFileDAO fileDAO, Long uuid, Long version, int expectNumVersions) { + + InputStream isOut = null; + try { + IVersionedNode node = repository.getFileItem(ticket, uuid, version); + isOut = node.getFile(); + assertTrue("Input stream is returned.", isOut != null); + int ch = isOut.read(); + assertTrue("Input stream can be read, first byte is "+ch, ch != -1); + + SortedSet history = repository.getVersionHistory(ticket, uuid); + assertTrue("History contains "+history.size()+" objects, expected "+expectNumVersions, + history != null && history.size()==expectNumVersions); + Iterator iter = history.iterator(); + while (iter.hasNext()) { + IVersionDetail element = (IVersionDetail) iter.next(); + if ( element.getVersionId().longValue() == 1) + assertTrue("Description is "+element.getDescription() + +" as expected "+v1Description, + v1Description.equals(element.getDescription())); + else + assertTrue("Description is "+element.getDescription() + +" as expected "+v2Description, + v2Description.equals(element.getDescription())); + } + + String filepath = fileDAO.getFilePath(uuid, version); + File file = new File(filepath); + assertTrue("File "+filepath+" exists. ", file.exists() ); + + } catch (RepositoryCheckedException re) { + failUnexpectedException("checkFileNode",re); + } catch (IOException ioe) { + failUnexpectedException("checkFileNode",ioe); + } finally { + try { + if ( isOut != null ) { + isOut.close(); + } + } catch (IOException ioe1) { + System.err.println("Unable to close file"); + ioe1.printStackTrace(); + } + } + } + + private void checkFileNodeDoesNotExist(IFileDAO fileDAO, Long uuid, Long version, int expectNumVersions) { + + try { + try { + IVersionedNode node; + node = repository.getFileItem(ticket, uuid, version); + fail("Should have thrown ItemNotFoundException exception for uuid " + +uuid+" version "+version+" got node "+node); + } catch ( ItemNotFoundException e ) { + assertTrue("ItemNotFoundException thrown as expected", true); + } + + try { + + SortedSet history = repository.getVersionHistory(ticket, uuid); + if ( expectNumVersions > 0 ) + assertTrue("History contains "+history.size()+" objects, expected "+expectNumVersions, + history != null && history.size()==expectNumVersions); + else + fail("Should have thrown ItemNotFoundException exception for uuid " + +uuid+" as all versions have been deleted so node should have been deleted."); + + } catch ( ItemNotFoundException e ) { + if ( expectNumVersions > 0 ) + fail("ItemNotFoundException thrown unexpectedly - there should be other versions! "); + else + assertTrue("ItemNotFoundException thrown as expected", true); + } + + String filepath = fileDAO.getFilePath(uuid, version); + File file = new File(filepath); + assertTrue("File "+filepath+" does not exist. ", ! file.exists() ); + + // should the directory still be there? + int pos = file.getPath().lastIndexOf(File.separator+version); + String dirPath = file.getPath().substring(0,pos); + System.out.println("Checking dir path "+dirPath); + File dir = new File(dirPath); + if ( expectNumVersions > 0 ) { + assertTrue("Directory still exists for other files", dir.exists()); + } else { + assertTrue("Directory removed", ! dir.exists()); + } + + } catch (RepositoryCheckedException re) { + re.printStackTrace(); + failUnexpectedException("checkFileNodeDoesNotExist",re); + } + + + } + + private void deleteVersion(Long uuid, Long version) { + try { + String[] problemFiles = repository.deleteVersion(ticket,uuid,version); + assertTrue("No problematic files should be found. " + +(problemFiles!=null ? problemFiles.length+" found":"") + ,problemFiles==null || problemFiles.length==0); + } catch (RepositoryCheckedException re) { + re.printStackTrace(); + failUnexpectedException("checkFileNodeDoesNotExist",re); + } + } + + private void deleteNode(Long uuid) { + try { + String[] problemFiles = repository.deleteNode(ticket,uuid); + assertTrue("No problematic files should be found. " + +(problemFiles!=null ? problemFiles.length+" found":"") + ,problemFiles==null || problemFiles.length==0); + } catch (RepositoryCheckedException re) { + re.printStackTrace(); + failUnexpectedException("checkFileNodeDoesNotExist",re); + } + } + + private NodeKey testAddFileItem(String filePath, String filename, Long uuid, Long expectedVersion) { + + InputStream isIn = null; + NodeKey keys = null; + try { + File file = new File(filePath); + if ( ! file.exists() || file.isDirectory() ) { + fail("File "+filePath+" not found on computer or is a directory. Please set this variable to a known file that may be read on this computer." + +" Note: this is a shortcoming in the test, it is not a failure of the repository."); + } + + isIn = new FileInputStream(file); + + if ( uuid == null ) { + // new file + keys = repository.addFileItem(ticket, isIn, filename, null, v1Description); + assertTrue("File save returns uuid",keys != null && keys.getUuid() != null); + assertTrue("File save got expected version "+expectedVersion, + keys != null && keys.getVersion() != null + && keys.getVersion().equals(expectedVersion)); + } else { + // update existing node + keys = repository.updateFileItem(ticket, uuid, filename, + isIn, null, v2Description); + assertTrue("File save returns same uuid",keys != null && keys.getUuid().equals(uuid)); + assertTrue("File save got expected version "+expectedVersion, + keys != null && keys.getVersion() != null + && keys.getVersion().equals(expectedVersion)); + } + + + } catch (RepositoryCheckedException re) { + failUnexpectedException("testAddFileItem",re); + } catch (IOException ioe) { + failUnexpectedException("testAddFileItem",ioe); + } finally { + try { + if ( isIn != null ) { + isIn.close(); + } + } catch (IOException ioe1) { + System.err.println("Unable to close file"); + ioe1.printStackTrace(); + } + } + + return keys; + + + } + + public void testPackageItem() { + NodeKey keys = testPackageItem(null); + testPackageItem(keys.getUuid()); + } + + private NodeKey testPackageItem(Long uuid) { + + String v1Description = "Draft"; + String v2Description = "Final"; + NodeKey keys = null; + try { + File directory = new File(PACKAGE_DIR_PATH); + if ( ! directory.exists() || ! directory.isDirectory() ) { + fail("Directory "+PACKAGE_DIR_PATH+" not found on computer or is not a directory. Please set this variable to a directory containing an index.html file and related files." + +" Note: this is a shortcoming in the test, it is not a failure of the repository."); + } + String[] filenames = directory.list(); + + if ( uuid == null ) { + keys = repository.addPackageItem(ticket, PACKAGE_DIR_PATH, "index.html", v1Description); + assertTrue("Package save returns uuid",keys != null && keys.getUuid() != null); + assertTrue("Package save got version 1", + keys != null && keys.getVersion() != null + && keys.getVersion().longValue() == 1); + } else { + keys = repository.updatePackageItem(ticket, uuid, PACKAGE_DIR_PATH, "index.html", v2Description); + assertTrue("Package save returns uuid",keys != null && keys.getUuid() != null); + assertTrue("Package save got version >1", + keys != null && keys.getVersion() != null + && keys.getVersion().longValue() > 1); + } + + // try getting the start file - index.html + checkFileInPackage(keys, null); + + // now try another file in the package + checkFileInPackage(keys, PACKAGE_TEST_FILE); + + // check that there is the expected number of files in pacakge. + // expect an extra node over the number of files (for the package node) + List nodes = repository.getPackageNodes(ticket, keys.getUuid(), null); + assertTrue("Expected number of nodes found. Expected " + +(PACKAGE_NUM_FILES+1)+" got " + +(nodes != null ? nodes.size() : 0 ), + nodes != null && nodes.size() == (PACKAGE_NUM_FILES+1)); + Iterator iter = nodes.iterator(); + if ( iter.hasNext() ) { + SimpleVersionedNode packageNode = (SimpleVersionedNode) iter.next(); + assertTrue("First node is the package node.", + packageNode.isNodeType(NodeType.PACKAGENODE)); + } + while ( iter.hasNext() ) { + SimpleVersionedNode childNode = (SimpleVersionedNode) iter.next(); + assertTrue("Child node is a file node.", + childNode.isNodeType(NodeType.FILENODE)); + } + + } catch (RepositoryCheckedException re) { + failUnexpectedException("testPackageItem",re); + } catch (IOException ioe) { + failUnexpectedException("testPackageItem",ioe); + } + return keys; + } + + /** + * @param keys + * @param relPath + * @throws AccessDeniedException + * @throws ItemNotFoundException + * @throws FileException + * @throws IOException + */ + private void checkFileInPackage(NodeKey keys, String relPath) throws AccessDeniedException, ItemNotFoundException, FileException, IOException { + IVersionedNode node = repository.getFileItem(ticket, keys.getUuid(), keys.getVersion()); + InputStream isOut = node.getFile(); + assertTrue("Input stream is returned for file path "+relPath, isOut != null); + try { + int ch = isOut.read(); + assertTrue("Input stream can be read, first byte is "+ch, ch != -1); + } catch ( IOException e ) { + throw e; + } finally { + if (isOut != null) + isOut.close(); + } + } + + public void testLogout() { + // relogin then logout so that we don't affect the other tests. + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, INITIAL_WORKSPACE_PASSWORD); + ITicket localTicket = null; + try { + localTicket = repository.login(cred, INITIAL_WORKSPACE); + assertTrue("Login okay",localTicket != null); + SortedSet history = repository.getVersionHistory(ticket, TEST_DATA_NODE_ID); + assertTrue("History can be accessed before logging out",true); + repository.logout(ticket); + } catch (RepositoryCheckedException e) { + failUnexpectedException("testLogout",e); + } + + try { + Long id = ticket.getWorkspaceId(); + assertTrue("Workspace id is not avaiable after logging out",id==null); + try { + SortedSet history = repository.getVersionHistory(ticket, TEST_DATA_NODE_ID); + fail("History shouldn't be available after logging out"); + } catch (AccessDeniedException ade ) { + assertTrue("AccessDeniedException thrown as expected - can't get history after logging out",true); + } + } catch (RepositoryCheckedException e) { + failUnexpectedException("testLogout",e); + } + } + + /** Checks that the system will give us an error if we get try to + * get a node that belongs to a different workspace to our ticket. + */ + public void testWrongWorkspaceAccess() { + // relogin then logout so that we don't affect the other tests. + ICredentials cred = new SimpleCredentials(INITIAL_WORKSPACE_USER, INITIAL_WORKSPACE_PASSWORD); + ITicket localTicket = null; + try { + localTicket = repository.login(cred, SECONDARY_WORKSPACE); + assertTrue("Login okay",localTicket != null); + } catch (RepositoryCheckedException e) { + failUnexpectedException("testWrongWorkspaceAccess",e); + } + + try { + // should fail as this node is in the INITIAL_WORKSPACE, + // not the SECONDARY_WORKSPACE + IVersionedNode node = repository.getFileItem(localTicket, TEST_DATA_NODE_ID, null); + fail("Node can be accessed for the wrong workspace."); + } catch (ItemNotFoundException e) { + assertTrue("ItemNotFoundException thrown as expected when getting node from wrong workspace.", true); + } catch (RepositoryCheckedException e) { + failUnexpectedException("testWrongWorkspaceAccess",e); + } + + try { + // should fail as this node is in the INITIAL_WORKSPACE, + // not the SECONDARY_WORKSPACE + SortedSet history = repository.getVersionHistory(localTicket, TEST_DATA_NODE_ID); + fail("History can be accessed for the wrong workspace."); + } catch (ItemNotFoundException e) { + assertTrue("ItemNotFoundException thrown as expected when getting history for node from wrong workspace.", true); + } catch (RepositoryCheckedException e) { + failUnexpectedException("testWrongWorkspaceAccess",e); + } + + try { + // be nice and clean up. + repository.logout(localTicket); + } catch (RepositoryCheckedException e) { + failUnexpectedException("testWrongWorkspaceAccess",e); + } + } + + +} Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleTicket.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleTicket.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleTicket.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,59 @@ +/* + * Created on Jan 11, 2005 + */ +package org.lamsfoundation.lams.contentrepository; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.LoginException; +import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; + +/** + * Test the SimpleTicket class. Tests the methods for + * the ITicket interface. + * + * @author Fiona Malikoff + */ +public class TestSimpleTicket extends BaseTestCase { + + protected Logger log = Logger.getLogger(TestSimpleTicket.class); + + /** + * Constructor for TestSimpleTicket. + * @throws WorkspaceNotFoundException + * @throws AccessDeniedException + * @throws LoginException + */ + public TestSimpleTicket() throws LoginException, AccessDeniedException, WorkspaceNotFoundException { + super(); + } + + /* + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUp(); + } + + /* + * @see TestCase#tearDown() + */ + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testGetWorkspaceId() { + Long id = ticket.getWorkspaceId(); + assertTrue("Ticket has workspaceId.", id != null ); + assertTrue("Workspace id is "+id + +" as expected "+INITIAL_WORKSPACE_ID, + INITIAL_WORKSPACE_ID.equals(id)); + } + + public void testGetTicketId() { + String id = ticket.getTicketId(); + assertTrue("Ticket has a ticketId.", id != null ); + } + + +} Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleVersionDetail.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleVersionDetail.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleVersionDetail.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,105 @@ +/* + * Created on Jan 10, 2005 + */ +package org.lamsfoundation.lams.contentrepository; + +import java.util.Date; +import java.util.Iterator; +import java.util.TreeSet; + +import org.lamsfoundation.lams.contentrepository.IVersionDetail; +import org.lamsfoundation.lams.contentrepository.SimpleVersionDetail; + +import junit.framework.TestCase; + +/** + * Checks creation and ordering of SimpleVersionDetail objects, + * using the IVersionDetail interface. + * + * Needs to be in the same package as SimpleVersionDetail + * to access protected constructor. + * + * @author Fiona Malikoff + */ +public class TestSimpleVersionDetail extends TestCase { + + private IVersionDetail detail1a = null; + private IVersionDetail detail1aSame = null; + private IVersionDetail detail1b = null; + private IVersionDetail detail1c = null; + private IVersionDetail detail2 = null; + private IVersionDetail detailnull = null; + + private static Date KNOWNDATE = new Date(0); + private static Long V1 = new Long(1); + private static Long V2 = new Long(1); + + /* + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUp(); + + Date dt = new Date(System.currentTimeMillis()); + detail1a = new SimpleVersionDetail(new Long(1), KNOWNDATE, "1"); + detail1aSame = new SimpleVersionDetail(new Long(1), KNOWNDATE, "1"); + detail1b = new SimpleVersionDetail(new Long(1), dt, "2"); + detail1c = new SimpleVersionDetail(new Long(1), dt, "3"); + detail2 = new SimpleVersionDetail(new Long(2), dt, "4"); + } + + public void testGetCreatedDateTime() { + Date dt = detail1a.getCreatedDateTime(); + assertTrue("Date is as expected. Expected "+KNOWNDATE+" got "+dt, KNOWNDATE.equals(dt)); + } + + public void testGetDescription() { + String desc = detail1b.getDescription(); + assertTrue("Description is as expected. Expected 2 got "+desc, "2".equals(desc)); + } + + public void testGetVersionId() { + Long id = detail1c.getVersionId(); + assertTrue("Description is as expected. Expected "+V1+" got "+id, V1.equals(id)); + } + + /* + * Class under test for boolean equals(Object) + */ + public void testEqualsObject() { + assertTrue("Detail 1a and detail 1a same are equal as expected ",detail1a.equals(detail1aSame)); + assertTrue("Detail 1a and detail 1b are different as expected ",!detail1a.equals(detail1b)); + assertTrue("Detail 1b and detail 1c are different as expected ",!detail1b.equals(detail1c)); + assertTrue("Detail 1a and detail 2 are different as expected ",!detail1b.equals(detail2)); + assertTrue("Detail 1a and detailnull are different as expected ",!detail1a.equals(null)); + } + + public void testCompareTo() { + assertTrue("Null object comes at end of sort order (i.e. null is high)", detail2.compareTo(detailnull) < 0); + assertTrue("Detail 1a earlier in sort order than 1c (i.e. lower)", detail1a.compareTo(detail1c) < 0); + assertTrue("Detail 1a earlier in sort order than 1c (i.e. lower)", detail1a.compareTo(detail1c) < 0); + TreeSet sortedSet = new TreeSet(); + sortedSet.add(detail1c); + sortedSet.add(detail2); + sortedSet.add(detail1a); + sortedSet.add(detail1b); + Iterator iter = sortedSet.iterator(); + int i = 1; + while ( iter.hasNext() ) { + IVersionDetail detail = (IVersionDetail) iter.next(); + switch ( i ) { + case 1: assertTrue("First object is detail1a", detail.equals(detail1a)); + break; + case 2: assertTrue("First object is detail1b", detail.equals(detail1b)); + break; + case 3: assertTrue("First object is detail1c", detail.equals(detail1c)); + break; + case 4: assertTrue("First object is detail2", detail.equals(detail2)); + break; + default: fail("More objects in set than expected. Object was "+detail); + } + i++; + } + } + +} Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleVersionedNode.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleVersionedNode.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/TestSimpleVersionedNode.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,583 @@ +/* + * Created on Jan 6, 2005 + */ +package org.lamsfoundation.lams.contentrepository; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Calendar; +import java.util.Date; +import java.util.Iterator; +import java.util.Set; +import java.util.SortedSet; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.CrNodeVersionProperty; +import org.lamsfoundation.lams.contentrepository.CrWorkspace; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.IValue; +import org.lamsfoundation.lams.contentrepository.IVersionDetail; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.contentrepository.IVersionedNodeAdmin; +import org.lamsfoundation.lams.contentrepository.ItemExistsException; +import org.lamsfoundation.lams.contentrepository.NoSuchNodeTypeException; +import org.lamsfoundation.lams.contentrepository.NodeType; +import org.lamsfoundation.lams.contentrepository.PropertyName; +import org.lamsfoundation.lams.contentrepository.PropertyType; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.SimpleVersionedNode; +import org.lamsfoundation.lams.contentrepository.ValidationException; +import org.lamsfoundation.lams.contentrepository.ValueFormatException; +import org.lamsfoundation.lams.contentrepository.dao.hibernate.WorkspaceDAO; + + + + +/** + * @author Fiona Malikoff + * + * Test the non-persistence related features of a SimpleVersionedNode. + * Unable to test the ids as these are generated when written to the database. + * + * When running tests, please make sure the FILEPATH is set to a file on your PC + * or comment out the file tests. + * + * Needs to be in the same package as SimpleVersionedNode + * to access protected methods. + */ +public class TestSimpleVersionedNode extends BaseTestCase { + + protected Logger log = Logger.getLogger(TestSimpleVersionedNode.class); + + /** + * Constructor for TestSimpleVersionedNode. Called for each test, so the stuff + * is sets up is static and is only done once. + * @param arg0 + * @throws RepositoryCheckedException + * @throws NoSuchNodeTypeException + * @throws ItemExistsException + */ + public TestSimpleVersionedNode() throws ItemExistsException, NoSuchNodeTypeException, RepositoryCheckedException { + super(); + } + + /* + * Class under test for void setProperty(String, IValue) + */ + public void testSetPropertyStringIValue() { + IValue value = new CrNodeVersionProperty("IVALUE name", + "IVALUE value", PropertyType.STRING, null); + } + + /* + * Guts of tests for setProperty calls using implied types and explicit types. + * For implied types, past it in as its own object type (Boolean, Double, etc) and leave type null. + * For explicit types, past it in as a string and set type to the appropriate type. + */ + private void testSetProperty(String name, Object value, Integer type, String expectedString, + Boolean expectedBoolean, Long expectedLong, Double expectedDouble, Calendar expectedCalendar) + { + SimpleVersionedNode testNode = getTestNode(); + try { + if ( type != null ) { + testNode.setProperty(name, (String)value, type.intValue()); + } else if ( String.class.isInstance(value) ) + testNode.setProperty(name, (String)value ); + else if ( Boolean.class.isInstance(value) ) + testNode.setProperty(name, ((Boolean)value).booleanValue() ); + else if ( Double.class.isInstance(value) ) + testNode.setProperty(name, ((Double)value).doubleValue() ); + else if ( Long.class.isInstance(value) ) + testNode.setProperty(name, ((Long)value).longValue() ); + else if ( Calendar.class.isInstance(value) ) + testNode.setProperty(name, (Calendar)value ); + } catch (Exception e) { + failUnexpectedException(e); + } + + try { + testNode.save(null, null); + } catch (Exception e) { + failUnexpectedException(e); + } + + IValue iValue = null; + IVersionedNode rereadNode = getTestNode(); + assertTrue("Able to reread node", rereadNode != null); + iValue = rereadNode.getProperty(name); + assertTrue("Property for name "+name+" was able to be read from db.",iValue != null); + + if ( expectedString != null ) { + try { + String val = iValue.getString(); + assertTrue("Property accessable as string ("+val+")", + expectedString.equals(val)); + } catch (ValueFormatException e1) { + e1.printStackTrace(); + fail("ValueFormatException thrown unexpectedly. "+e1.getMessage()); + } + } else { + try { + String val = iValue.getString(); + fail("ValueFormatException exception expected. Value returned as "+val); + } catch (ValueFormatException e1) { + assertTrue("ValueFormatException thrown as expected",true); + } + } + + if ( expectedBoolean != null ) { + try { + boolean val = iValue.getBoolean(); + assertTrue("Property accessable as boolean ("+val+")", + val == expectedBoolean.booleanValue()); + } catch (ValueFormatException e1) { + failUnexpectedException(e1); + } + } else { + try { + boolean val = iValue.getBoolean(); + fail("ValueFormatException exception expected. Value returned as "+val); + } catch (ValueFormatException e1) { + assertTrue("ValueFormatException thrown as expected",true); + } + } + + if ( expectedLong != null ) { + try { + long val = iValue.getLong(); + assertTrue("Property accessable as long ("+val+")", + val == expectedLong.longValue()); + } catch (ValueFormatException e1) { + e1.printStackTrace(); + fail("ValueFormatException thrown unexpectedly. "+e1.getMessage()); + } + } else { + try { + long val = iValue.getLong(); + fail("ValueFormatException exception expected. Value returned as "+val); + } catch (ValueFormatException e1) { + assertTrue("ValueFormatException thrown as expected",true); + } + } + + if ( expectedDouble != null ) { + try { + double val = iValue.getDouble(); + assertTrue("Property accessable as long ("+val+")", + val == expectedDouble.doubleValue()); + } catch (ValueFormatException e1) { + e1.printStackTrace(); + fail("ValueFormatException thrown unexpectedly. "+e1.getMessage()); + } + } else { + try { + double val = iValue.getLong(); + fail("ValueFormatException exception expected. Value returned as "+val); + } catch (ValueFormatException e1) { + assertTrue("ValueFormatException thrown as expected",true); + } + } + + if ( expectedCalendar != null ) { + try { + Calendar val = iValue.getDate(); + assertTrue("Property accessable as string ("+val+")", + expectedCalendar.equals(val)); + } catch (ValueFormatException e1) { + e1.printStackTrace(); + fail("ValueFormatException thrown unexpectedly. "+e1.getMessage()); + } + } else { + try { + Calendar val = iValue.getDate(); + fail("ValueFormatException exception expected. Value returned as "+val); + } catch (ValueFormatException e1) { + assertTrue("ValueFormatException thrown as expected",true); + } + } + + testNode = null; + } + + /* + * Class under test for void setProperty(String, String, int) + * Integer type, String expectedString, + Boolean expectedBoolean, Long expectedLong, Double expectedDouble, Calendar expectedCalendar) + */ + public void testSetPropertySpecifiedType() { + testSetProperty("NAME STRING", "VALUE STRING", new Integer(PropertyType.STRING), + "VALUE STRING", Boolean.FALSE, null, null, null); + testSetProperty("NAME STRING 100.01", "100.01", new Integer(PropertyType.STRING), + "100.01", Boolean.FALSE, null, new Double(100.01), null); +// calendar test! testSetPropertyImpliedType("NAME STRING 100.01", "100.01", new Integer(PropertyType.STRING), +// "VALUE STRING", Boolean.FALSE, new Long(100), new Double(100.01), null); + testSetProperty("NAME BOOLEAN True", "True", new Integer(PropertyType.BOOLEAN), + "True", Boolean.TRUE, null, null, null); + testSetProperty("NAME LONG 100", "100", new Integer(PropertyType.LONG), + "100", Boolean.FALSE, new Long(100), new Double(100), null); + testSetProperty("NAME DOUBLE 100.02", "100.02", new Integer(PropertyType.DOUBLE), + "100.02", Boolean.FALSE, null, new Double(100.02), null); +// calendar test! testSetPropertyImpliedType("NAME CALENDAR ???", "???", new Integer(PropertyType.CALENDAR), +// "???", Boolean.FALSE, null, null, value); + } + + /* + * Class under test for void setProperty(String, String) + */ + public void testSetPropertyStringString() { + testSetProperty("NAME STRING2", "VALUE STRING2", null, + "VALUE STRING2", Boolean.FALSE, null, null, null); + testSetProperty("NAME STRING 200.01", "200.01", new Integer(PropertyType.STRING), + "200.01", Boolean.FALSE, null, new Double(200.01), null); +// calendar test! testSetPropertyImpliedType("NAME STRING 100.01", "100.01", new Integer(PropertyType.STRING), +// "VALUE STRING", Boolean.FALSE, new Long(100), new Double(100.01), null); + } + + /* + * Class under test for void setProperty(String, boolean) + */ + public void testSetPropertyStringboolean() { + testSetProperty("NAME BOOLEAN True", Boolean.TRUE, null, + "true", Boolean.TRUE, null, null, null); + } + + /* + * Class under test for void setProperty(String, double) + */ + public void testSetPropertyStringdouble() { + testSetProperty("NAME DOUBLE 200.02", new Double(200.02), null, + "200.02", Boolean.FALSE, null, new Double(200.02), null); + } + + /* + * Class under test for void setProperty(String, long) + */ + public void testSetPropertyStringlong() { + testSetProperty("NAME LONG 200", new Long(200), null, + "200", Boolean.FALSE, new Long(200), new Double(200), null); + } + + /* + * Class under test for void setProperty(String, Calendar) + */ + public void testSetPropertyStringCalendar() { +// calendar test! testSetPropertyImpliedType("NAME CALENDAR ???", "???", new Integer(PropertyType.CALENDAR), +// "???", Boolean.FALSE, null, null, value); + } + + /* + * Class under test for void setProperty(String, IValue) + */ + public void testClearPropertyStringIValue() { + // set the value + String name = "TO DELETE"; + String value = "This value is to be deleted."+System.currentTimeMillis(); + + try { + SimpleVersionedNode testNode = getTestNode(); + testNode.setProperty(name, value, PropertyType.STRING); + testNode.save(null, null); + + IValue iValue = null; + IVersionedNode rereadNode = getTestNode(); + assertTrue("Able to reread node", rereadNode != null); + iValue = rereadNode.getProperty(name); + assertTrue("Property for name "+name+" was able to be read from db.",iValue != null); + assertTrue("Property contained expected data "+value,value.equals(iValue.getString())); + + // delete the value. Row in db should be deleted. + testNode = getTestNode(); + testNode.setProperty(name, null, PropertyType.STRING); + testNode.save(null, null); + + iValue = null; + rereadNode = getTestNode(); + assertTrue("Able to reread node", rereadNode != null); + iValue = rereadNode.getProperty(name); + assertTrue("Property for name "+name+" was not in the db.",iValue == null); + } catch (RepositoryCheckedException e) { + e.printStackTrace(); + fail("RepositoryCheckedException thrown unexpectedly. "+e.getMessage()); + } + } + + public void testGetProperties() { + Set properties = null; + IVersionedNodeAdmin testNode = getNode(INITIAL_WORKSPACE_ID, TEST_FILE_NODE_ID); + properties = testNode.getProperties(); + int num = properties != null ? properties.size() : -1; + assertTrue("Expect that node has 3 property, finds "+num+" properties.",num==3); + testNode = null; + } + + public void testHasProperty() { + IVersionedNodeAdmin testNode = getTestNode(); + assertTrue("Test node has version desc property ",testNode.hasProperty(PropertyName.VERSIONDESC)); + testNode = null; + } + + public void testHasProperties() { + IVersionedNodeAdmin testNode = getTestNode(); + assertTrue("Test node has properties ",testNode.hasProperties()); + testNode = null; + } + + public void testGetNodeType() { + IVersionedNodeAdmin testNode = getTestNode(); + String nodeType = testNode.getNodeType(); + assertTrue("Test node has node type, should be DATANODE, returned as "+nodeType, + NodeType.DATANODE.equals(nodeType)); + testNode = null; + } + + public void testIsNodeType() { + IVersionedNodeAdmin testNode = getTestNode(); + assertTrue("Test node is correct DATANODE type", + testNode.isNodeType(NodeType.DATANODE)); + testNode = null; + } + + public void testGetVersionHistory() { + IVersionedNodeAdmin testNode = getTestNode(); + + SortedSet history = testNode.getVersionHistory(); + assertTrue("history exists and is not empty ", + history != null && ! history.isEmpty()); + Iterator iter = history.iterator(); + Long previousVersionId = null; + + while (iter.hasNext()) { + + IVersionDetail element = (IVersionDetail) iter.next(); + assertTrue("Version id is a +ve long", + element.getVersionId() != null && + element.getVersionId().longValue() > 0 ); + + assertTrue("Version has a date", + element.getCreatedDateTime() != null); + + if ( previousVersionId != null && + previousVersionId.longValue() > element.getVersionId().longValue() ) { + fail("Version history is in wrong order"); + } + previousVersionId = element.getVersionId(); + } + + testNode = null; + } + + public void testGetPath() { + IVersionedNodeAdmin testNode = getTestNode(); + String val = testNode.getPath(); + assertTrue("Test node should have path "+TEST_NODE_PATH+" has path "+val, + TEST_NODE_PATH.equals(val)); + testNode = null; + } + + public void testGetVersion() { + IVersionedNodeAdmin testNode = getTestNode(); + Long version = testNode.getVersion(); + assertTrue("Test node is initial version.",version != null && version.longValue()==2); + testNode = null; + } + + public void testGetCreatedDateTime() { + IVersionedNodeAdmin testNode = getTestNode(); + Date dt = testNode.getCreatedDateTime(); + assertTrue("Test node has a created date time.",dt != null); + testNode = null; + } + + public void testAddNode() { + Long fileNodeUUID = null; + Long dataNodeUUID = null; + Long packageNodeUUID = null; + try { + // file nodes are tested in another test + SimpleVersionedNode dataNode = createNode(INITIAL_WORKSPACE_ID, NodeType.DATANODE); + + SimpleVersionedNode packageNode = createNode(INITIAL_WORKSPACE_ID, NodeType.PACKAGENODE); + packageNode.setProperty(PropertyName.INITIALPATH,"index.html"); + + assertTrue("2 nodes created, but not saved into database ", + dataNode != null && dataNode.getUUID() == null + && packageNode != null && packageNode.getUUID() == null); + + saveCheckNode("Data", NodeType.DATANODE, dataNode); + saveCheckNode("Package", NodeType.PACKAGENODE, packageNode); + + } catch ( Exception e ) { + failUnexpectedException(e); + } + + } + + public void testTextFileNode() { + Long uuid = testFileNodeInternal(TEXT_FILEPATH, TEXT_FILENAME, null); + testFileNodeInternal(TEXT_FILEPATH, TEXT_FILENAME, uuid); + } + + public void testBinaryFileNode() { + Long uuid = testFileNodeInternal(BINARY_FILEPATH, BINARY_FILENAME, null); + testFileNodeInternal(BINARY_FILEPATH, BINARY_FILENAME, uuid); + } + + /* + * Tests a file node using the given filePath. + * Will also make sure it can't add the file to a data node. + * if repositoryEntryExists == true then assume that there should + * already be a file in the directory hence an error will be thrown. + */ + private Long testFileNodeInternal(String filePath, String filename, Long uuid) { + + FileInputStream is = null; + InputStream newIs = null; + SimpleVersionedNode fileNode = null; + Long newUuid = uuid; + IVersionedNodeAdmin testNode = getTestNode(); + + try { + File file = new File(filePath); + if ( ! file.exists() || file.isDirectory() ) { + fail("File "+filePath+" not found on computer or is a directory. Please set this variable to a known file that may be read on this computer." + +" Note: this is a shortcoming in the test, it is not a failure of the repository."); + } + + is = new FileInputStream(file); + + // first try adding the file to a data node. Should fail as that's not allowed + try { + testNode.setFile(is, filename, null); + } catch (RepositoryCheckedException e) { + assertTrue("Exception thrown as test node will not accept an input stream - it is only a data node. " + +e.getMessage(),e.getMessage().indexOf("Node must be of type FILE_NODE") != -1); + } + + // now try adding to a new filenode. Check that it enforces a file stream and the name, + // before writing it out properly + if ( newUuid == null ) { + fileNode = createNode(INITIAL_WORKSPACE_ID, NodeType.FILENODE); + } else { + fileNode = (SimpleVersionedNode) getNode(INITIAL_WORKSPACE_ID, newUuid); + } + + try { + fileNode.setFile(null, filename, null); + } catch (RepositoryCheckedException e) { + assertTrue("Exception thrown as input stream is missing", + e.getMessage().indexOf("InputStream is required.")!=-1); + } + + try { + fileNode.setFile(is, null, null); + } catch (RepositoryCheckedException e) { + assertTrue("Exception thrown as filename is missing", + e.getMessage().indexOf("Filename is required.")!=-1); + } + + fileNode.setFile(is, filename, null); + saveCheckNode("File", NodeType.FILENODE, fileNode); + newUuid = fileNode.getUUID(); + newIs = fileNode.getFile(); + assertTrue("File node has an input stream.",newIs != null); + + } catch (FileNotFoundException fe) { + fail("File "+filePath+" not found on computer. Please set this variable to a known file that may be read on this computer." + +" Note: this is a shortcoming in the test, it is not a failure of the repository."); + } catch (FileException fe2) { + if ( uuid != null && fe2.getMessage().indexOf("exists")!=-1) { + assertTrue("File exists error thrown as expected.", true); + } else { + fe2.printStackTrace(); + fail("Exception thrown unexpectedly. "+fe2.getMessage()); + } + + } catch (RepositoryCheckedException e2) { + e2.printStackTrace(); + fail("Exception thrown unexpectedly. "+e2.getMessage()); + } finally { + if ( is != null ) { + try { + is.close(); + } catch (IOException e1) { + System.err.println("Unable to close input file - was there a failure ?"); + e1.printStackTrace(); + } + } + + if ( newIs != null ) { + try { + newIs.close(); + } catch (IOException e1) { + System.err.println("Unable to close reread file"); + e1.printStackTrace(); + } + } + } + testNode = null; + return newUuid; + } + + /** + * @param nodeDesc + * @param expectedType + * @param fileNode + * @throws ValidationException + * @throws RepositoryCheckedException + */ + private void saveCheckNode(String nodeDesc, String expectedType, SimpleVersionedNode nodeToSave) + throws ValidationException, RepositoryCheckedException { + Long nodeUUID; + nodeToSave.save(null, null); + nodeUUID = nodeToSave.getUUID(); + assertTrue(nodeDesc+" Node saved in database, assigned a UUID", nodeUUID != null); + + IVersionedNode retrievedNode = getNode(INITIAL_WORKSPACE_ID, nodeUUID); + assertTrue(nodeDesc+" Node can be retrieved, has correct UUID", + retrievedNode != null && retrievedNode.getUUID().equals(nodeUUID)); + assertTrue(nodeDesc+" Node is of expected type. Expected "+expectedType+" found "+retrievedNode.getNodeType(), + retrievedNode.isNodeType(expectedType)); + } + + public void testAddNodeBadType() { + try { + SimpleVersionedNode newNode = createNode(INITIAL_WORKSPACE_ID, "XYZ"); + newNode.save(null, null); + fail("NoSuchNodeTypeException should have been thrown"); + } catch (Exception e) { + if ( NoSuchNodeTypeException.class.isInstance(e) ) { + assertTrue("NoSuchNodeTypeException thrown as expected ",true); + } else { + e.printStackTrace(); + fail("Exception thrown unexpectedly. "+e.getMessage()); + } + } + + } + + /** Normally this functionality is handled by the repository object + * but this test case is trying to test the stuff below the repository + * object + * @return Node + * @throws NoSuchNodeTypeException + * @throws AccessDeniedException + */ + protected SimpleVersionedNode createNode(Long workspaceId, String nodeType) throws NoSuchNodeTypeException, AccessDeniedException { + + SimpleVersionedNode newNode = (SimpleVersionedNode)context.getBean("node", SimpleVersionedNode.class); + WorkspaceDAO workspaceDAO = (WorkspaceDAO)context.getBean("workspaceDAO"); + + CrWorkspace workspace = (CrWorkspace) workspaceDAO.find(CrWorkspace.class, workspaceId); + if ( workspace == null ) { + fail("Workspace id="+workspaceId+" does not exist."); + } + + newNode.initialiseNode(null,nodeType,workspace,null); + return newNode; + } + +} Index: lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/dao/file/TestFileDAO.java =================================================================== diff -u --- lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/dao/file/TestFileDAO.java (revision 0) +++ lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/dao/file/TestFileDAO.java (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -0,0 +1,83 @@ +/* + * Created on Jan 10, 2005 + */ +package org.lamsfoundation.lams.contentrepository.dao.file; + +import org.lamsfoundation.lams.contentrepository.BaseTestCase; +import org.lamsfoundation.lams.contentrepository.FileException; +import org.lamsfoundation.lams.contentrepository.dao.file.FileDAO; + + +/** + * @author Fiona Malikoff + * + * Tests just the generation of file names. The actual writing is + * tested via the save/get file functions on SimpleVersionedNode + */ +public class TestFileDAO extends BaseTestCase { + + Long idEven = null; + Long idUneven = null; + Long v1 = null; + Long v101 = null; + static FileDAO fileDAO = null; + + public void setUp() { + if ( fileDAO == null ) { + fileDAO = (FileDAO)context.getBean("fileDAO", FileDAO.class); + } + } + + public void testGenerateFilePathEven1() { + String paths[] = null; + try { + paths = fileDAO.generateFilePath(new Long(140412),new Long(1)); + assertTrue("Directory path ends with \\14\\04\\12 and file path ends with /14/04/12/1", + paths[0].endsWith("\\14\\04\\12") && paths[1].endsWith("\\14\\04\\12\\1")); + System.out.println("Directory path is "+paths[0]); + } catch (FileException e) { + e.printStackTrace(); + fail("Unexpected exception thrown "+e.getMessage()+" paths "+paths); + } + } + + public void testGenerateFilePathEven101() { + String paths[] = null; + try { + paths = fileDAO.generateFilePath(new Long(140412),new Long(101)); + assertTrue("Directory path ends with \\14\\04\\12 and file path ends with \\14\\04\\12\\101", + paths[0].endsWith("\\14\\04\\12") && paths[1].endsWith("\\14\\04\\12\\101")); + System.out.println("Directory path is "+paths[0]); + } catch (FileException e) { + e.printStackTrace(); + fail("Unexpected exception thrown "+e.getMessage()+" paths "+paths); + } + } + + public void testGenerateFilePathOdd1() { + String paths[] = null; + try { + paths = fileDAO.generateFilePath(new Long(12345),new Long(1)); + assertTrue("Directory path ends with \\01\\23\\45 and file path ends with \\01\\23\\45\\1", + paths[0].endsWith("\\01\\23\\45") && paths[1].endsWith("\\01\\23\\45\\1")); + System.out.println("Directory path is "+paths[0]); + } catch (FileException e) { + e.printStackTrace(); + fail("Unexpected exception thrown "+e.getMessage()+" paths "+paths); + } + } + + public void testGenerateFilePathOdd101() { + String paths[] = null; + try { + paths = fileDAO.generateFilePath(new Long(12345),new Long(101)); + assertTrue("Directory path ends with \\01\\23\\45 and file path ends with \\01\\23\\45\\101", + paths[0].endsWith("\\01\\23\\45") && paths[1].endsWith("\\01\\23\\45\\101")); + System.out.println("Directory path is "+paths[0]); + } catch (FileException e) { + e.printStackTrace(); + fail("Unexpected exception thrown "+e.getMessage()+" paths "+paths); + } + + } +} Index: lams_contentrepository/web/WEB-INF/struts/.struts-config.mex =================================================================== diff -u -rde6d90d33c99f038934612745e92f352c9586f62 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/web/WEB-INF/struts/.struts-config.mex (.../.struts-config.mex) (revision de6d90d33c99f038934612745e92f352c9586f62) +++ lams_contentrepository/web/WEB-INF/struts/.struts-config.mex (.../.struts-config.mex) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -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 -raed7d69bb397fa1187f11280a8a615dc3f1d55a9 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision aed7d69bb397fa1187f11280a8a615dc3f1d55a9) +++ lams_contentrepository/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -3,45 +3,45 @@ - - - + + + - + - + - + - + - + - + - + - + @@ -57,7 +57,7 @@ @@ -79,7 +79,7 @@ @@ -89,6 +89,6 @@ - + Index: lams_contentrepository/web/WEB-INF/web.xml =================================================================== diff -u -r8042c2dabe3800728a22a8ab916260e3941784df -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/web/WEB-INF/web.xml (.../web.xml) (revision 8042c2dabe3800728a22a8ab916260e3941784df) +++ lams_contentrepository/web/WEB-INF/web.xml (.../web.xml) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -22,16 +22,31 @@ *.do + + + Download file(s) Download file Download - com.lamsinternational.lams.contentrepository.struts.action.Download + org.lamsfoundation.lams.contentrepository.struts.action.Download + 1 Download /download/* + + Test Login + Test Login + TestLogin + org.lamsfoundation.lams.contentrepository.struts.action.TestLogin + + + TestLogin + /testlogin + + Index: lams_contentrepository/web/nodeSelection.jsp =================================================================== diff -u -raed7d69bb397fa1187f11280a8a615dc3f1d55a9 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/web/nodeSelection.jsp (.../nodeSelection.jsp) (revision aed7d69bb397fa1187f11280a8a615dc3f1d55a9) +++ lams_contentrepository/web/nodeSelection.jsp (.../nodeSelection.jsp) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -1,11 +1,11 @@ <%@ page language="java"%> <%@ page import="java.util.*"%> -<%@ page import="com.lamsinternational.lams.contentrepository.IValue"%> -<%@ page import="com.lamsinternational.lams.contentrepository.IVersionDetail"%> -<%@ page import="com.lamsinternational.lams.contentrepository.IVersionedNode"%> -<%@ page import="com.lamsinternational.lams.contentrepository.PropertyName"%> -<%@ page import="com.lamsinternational.lams.contentrepository.NodeType"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.IValue"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.IVersionDetail"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.IVersionedNode"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.PropertyName"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.NodeType"%> <%@ taglib uri="/WEB-INF/struts/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts/struts-html.tld" prefix="html" %> Index: lams_contentrepository/web/packageList.jsp =================================================================== diff -u -raed7d69bb397fa1187f11280a8a615dc3f1d55a9 -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/web/packageList.jsp (.../packageList.jsp) (revision aed7d69bb397fa1187f11280a8a615dc3f1d55a9) +++ lams_contentrepository/web/packageList.jsp (.../packageList.jsp) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -1,9 +1,9 @@ <%@ page language="java"%> <%@ page import="java.util.*"%> -<%@ page import="com.lamsinternational.lams.contentrepository.IValue"%> -<%@ page import="com.lamsinternational.lams.contentrepository.IVersionedNode"%> -<%@ page import="com.lamsinternational.lams.contentrepository.PropertyName"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.IValue"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.IVersionedNode"%> +<%@ page import="org.lamsfoundation.lams.contentrepository.PropertyName"%> <%@ taglib uri="/WEB-INF/struts/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts/struts-html.tld" prefix="html" %> Index: lams_contentrepository/xdoclet-build.xml =================================================================== diff -u -r3f80f42891cd062d8d769854a57e7efeec02eb2a -r09decccca1a4d871be5772d51638fa13aa928349 --- lams_contentrepository/xdoclet-build.xml (.../xdoclet-build.xml) (revision 3f80f42891cd062d8d769854a57e7efeec02eb2a) +++ lams_contentrepository/xdoclet-build.xml (.../xdoclet-build.xml) (revision 09decccca1a4d871be5772d51638fa13aa928349) @@ -1,24 +1,45 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +