diff --git a/README.md b/README.md index 61bc9e3..b70e50b 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,25 @@ # EQUELLA Blackboard Integration -Information about the Equella open source community and supporting documentation can be found at https://equella.github.io/ +Information about the openEQUELLA community and supporting documentation can be found at https://equella.github.io/ -Versions are repo-wide (ie all building blocks will have the same version for a given build). Versioning will be loosely tied to SemVer. +Versions are repo-wide (ie all building blocks / web services will have the same version for a given build). Versioning will be loosely tied to SemVer. Version 1.X.Y will support Blackboard v3200 - v3300 Version 2.W.V will support Blackboard v3400+ ## Building the primary building block ``` -~$ ./gradlew :oeqPrimary:cleanAndRebuild +~$ ./gradlew :oeqPrimaryB2:clean +~$ ./gradlew :oeqPrimaryB2:buildB2 ``` -The war is placed in (cloned repo)/oeqPrimary/build/libs/ +The war is placed in (cloned repo)/oeqPrimaryB2/build/libs/ + +## Building the primary web service +``` +~$ ./gradlew :oeqPrimaryWS:clean +~$ ./gradlew :oeqPrimaryWS:buildWs +``` +The jar is placed in (cloned repo)/oeqPrimaryWS/build/libs/ ## Building the audit building block For now, this is just a skeleton building block for testing. @@ -19,9 +27,10 @@ For now, this is just a skeleton building block for testing. Eventually it may be a helper building block to audit the Blackboard / openEQUELLA integration. ``` -~$ ./gradlew :oeqAudit:cleanAndRebuild +~$ ./gradlew :oeqAuditB2:clean +~$ ./gradlew :oeqAuditB2:buildB2 ``` -The war is placed in (cloned repo)/oeqAudit/build/libs/ +The war is placed in (cloned repo)/oeqAuditB2/build/libs/ ## Building the linkFixer building block TODO diff --git a/build-oldBb9.1.xml b/build-oldBb9.1.xml index 0f00e4b..f29c0b0 100644 --- a/build-oldBb9.1.xml +++ b/build-oldBb9.1.xml @@ -2,8 +2,7 @@ - - + @@ -29,110 +28,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Making temp copy of source... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -216,53 +114,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build.gradle b/build.gradle index 87bb691..d347aea 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ -// Needed for pre-compiling the JSPs buildscript { repositories { jcenter() } dependencies { + // Needed for pre-compiling the JSPs classpath "com.bmuschko:gradle-tomcat-plugin:${gradleTomcatPluginVersion}" } } @@ -14,7 +14,7 @@ allprojects { apply plugin: "war" apply plugin: "com.bmuschko.tomcat" group = 'org.apereo.openequella.integration.blackboard' - version = buildingBlockVersion + version = artifactVersion repositories { mavenCentral() maven { @@ -50,7 +50,7 @@ allprojects { } war { - from 'build/jsps/org/apache/jsp' // this and the following exclude used to move the pre-compiled JSPs + from 'build/jsps/org/apache/jsp' // include the pre-compiled JSPs from ('src/main/manifests/bb-manifest-unresolved.xml'){ // set the B2 version and place in the war filter{ it.replaceAll('@VERSION@', buildingBlockVersion)} rename { String fileName -> @@ -58,8 +58,9 @@ allprojects { } into("WEB-INF") } - exclude('org/**') // Clear out the jasper build - exclude('WEB-INF/org/**') // Clear out the jasper build + from ('src/main/java/icons.xml') { + into("WEB-INF/classes") + } } tomcat { @@ -68,24 +69,63 @@ allprojects { outputDir = file("build/jsps") } } +} - task cleanAndRebuild() { +project(':oeqAuditB2') { + dependencies { + compile project(':oeqCommon') + } + + task buildB2() { group 'oEQ' - description 'Cleans the build, precompiles the JSPs, and packages the WAR file' - dependsOn clean + description 'Precompiles the JSPs, compiles the source, and packages the building block as a WAR' dependsOn tomcatJasper dependsOn war } } - -project(':oeqAudit') { + +project(':oeqPrimaryB2') { dependencies { compile project(':oeqCommon') } + + task buildB2() { + group 'oEQ' + description 'Precompiles the JSPs, compiles the source, and packages the building block as a WAR' + dependsOn tomcatJasper + dependsOn war + } } - -project(':oeqPrimary') { + +project(':oeqPrimaryWS') { dependencies { compile project(':oeqCommon') } + + task generateJavadoc(type: Javadoc) { + source = sourceSets.main.allJava + } + + task zipJavadoc(type: Zip, dependsOn: generateJavadoc) { + archiveName 'documentation.zip' + destinationDir buildDir + from ("${buildDir}/docs/javadoc") { + into 'documentation' + } + } + + task buildWS(type: Jar) { + dependsOn classes + dependsOn zipJavadoc + group 'oEQ' + description 'Compiles the source and packages the web service as a JAR' + baseName = 'oeq-blackboard-primary-ws' + with jar + from (project(':oeqCommon').sourceSets.main.output) // Include the common classes as well. + from ('src/main/manifests/bb-manifest.xml'){ // set the B2 version and place in the war + into("META-INF") + } + from ('src/main/java/icons.xml') + from ("${buildDir}/documentation.zip") + } } diff --git a/gradle.properties b/gradle.properties index 8c3fefc..92e1646 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,5 +6,5 @@ jstlVersion=1.2 jspApiVersion=2.3.3 servletApiVersion=4.0.1 junitVersion=4.12 -# All building blocks are re-versioned when this changes. -buildingBlockVersion=1.0.0-SNAPSHOT \ No newline at end of file +# All building blocks / web services are re-versioned when this changes. +artifactVersion=1.0.1-SNAPSHOT \ No newline at end of file diff --git a/oeqAudit/.classpath b/oeqAuditB2/.classpath similarity index 100% rename from oeqAudit/.classpath rename to oeqAuditB2/.classpath diff --git a/oeqAudit/.gitignore b/oeqAuditB2/.gitignore similarity index 100% rename from oeqAudit/.gitignore rename to oeqAuditB2/.gitignore diff --git a/oeqAudit/.project b/oeqAuditB2/.project similarity index 97% rename from oeqAudit/.project rename to oeqAuditB2/.project index 5f19a83..a530b05 100644 --- a/oeqAudit/.project +++ b/oeqAuditB2/.project @@ -1,6 +1,6 @@ - oeqAudit + oeqAuditB2 Project oeqAudit created by Buildship. diff --git a/oeqAudit/.settings/org.eclipse.buildship.core.prefs b/oeqAuditB2/.settings/org.eclipse.buildship.core.prefs similarity index 100% rename from oeqAudit/.settings/org.eclipse.buildship.core.prefs rename to oeqAuditB2/.settings/org.eclipse.buildship.core.prefs diff --git a/oeqAudit/src/main/java/org/apereo/openequella/integration/blackboard/oeqAudit/Audit.java b/oeqAuditB2/src/main/java/org/apereo/openequella/integration/blackboard/oeqAudit/Audit.java similarity index 100% rename from oeqAudit/src/main/java/org/apereo/openequella/integration/blackboard/oeqAudit/Audit.java rename to oeqAuditB2/src/main/java/org/apereo/openequella/integration/blackboard/oeqAudit/Audit.java diff --git a/oeqAudit/src/main/manifests/bb-manifest-unresolved.xml b/oeqAuditB2/src/main/manifests/bb-manifest-unresolved.xml similarity index 100% rename from oeqAudit/src/main/manifests/bb-manifest-unresolved.xml rename to oeqAuditB2/src/main/manifests/bb-manifest-unresolved.xml diff --git a/oeqAudit/src/main/webapp/WEB-INF/web.xml b/oeqAuditB2/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from oeqAudit/src/main/webapp/WEB-INF/web.xml rename to oeqAuditB2/src/main/webapp/WEB-INF/web.xml diff --git a/oeqAudit/src/main/webapp/admin/config.jsp b/oeqAuditB2/src/main/webapp/admin/config.jsp similarity index 100% rename from oeqAudit/src/main/webapp/admin/config.jsp rename to oeqAuditB2/src/main/webapp/admin/config.jsp diff --git a/oeqAudit/src/main/webapp/error.jsp b/oeqAuditB2/src/main/webapp/error.jsp similarity index 100% rename from oeqAudit/src/main/webapp/error.jsp rename to oeqAuditB2/src/main/webapp/error.jsp diff --git a/oeqAudit/src/main/webapp/taglibs/bbData.tld b/oeqAuditB2/src/main/webapp/taglibs/bbData.tld similarity index 100% rename from oeqAudit/src/main/webapp/taglibs/bbData.tld rename to oeqAuditB2/src/main/webapp/taglibs/bbData.tld diff --git a/oeqAudit/src/main/webapp/taglibs/bbUI.tld b/oeqAuditB2/src/main/webapp/taglibs/bbUI.tld similarity index 100% rename from oeqAudit/src/main/webapp/taglibs/bbUI.tld rename to oeqAuditB2/src/main/webapp/taglibs/bbUI.tld diff --git a/oeqAudit/src/main/webapp/taglibs/bbUI.xsl b/oeqAuditB2/src/main/webapp/taglibs/bbUI.xsl similarity index 100% rename from oeqAudit/src/main/webapp/taglibs/bbUI.xsl rename to oeqAuditB2/src/main/webapp/taglibs/bbUI.xsl diff --git a/oeqAudit/src/main/webapp/taglibs/tle.tld b/oeqAuditB2/src/main/webapp/taglibs/tle.tld similarity index 100% rename from oeqAudit/src/main/webapp/taglibs/tle.tld rename to oeqAuditB2/src/main/webapp/taglibs/tle.tld diff --git a/oeqPrimary/.classpath b/oeqPrimary/.classpath deleted file mode 100644 index 64a0d2f..0000000 --- a/oeqPrimary/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/EquellaWebservice.java b/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/EquellaWebservice.java deleted file mode 100644 index bd217ae..0000000 --- a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/EquellaWebservice.java +++ /dev/null @@ -1,239 +0,0 @@ -package org.apereo.openequella.integration.blackboard.webservice; - -import blackboard.platform.ws.anns.AuthenticatedMethod; - -// God damn comment formatting. -/** - * Please use ContextWS.emulateUser before invoking any method. - *

- * Error codes: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
EQ001Error getting persistence manager
EQ002Error generating ID
EQ003Error saving item
EQ004Invalid item
EQ005Error listing courses for user
EQ006Error listing folders for course
EQ007Error listing folders for folder
EQ010Error synchronising content
EQ011Error finding usage
EQ012Error getting course code
EQ013Error deleting content
EQ014Error editing content
EQ015Error moving content
EQ100Permission denied
- */ -// @NonNullByDefault -public interface EquellaWebservice { - /** - * Returns the current version of this web service on the server - * - * @return The version of the webservice. This will only be incremented once the - * webservice is changed and there exists a released version of the old - * webservice in the wild. - * @since 1 - */ - int getServerVersion(); - - /** - * Tests that the EQUELLA webservice is reachable - * - * @param param - * A parameter to be echoed back - * @return The value of param - * @since 1 - */ - String testConnection(String param); - - /** - * @param username - * unused. Please use ContextWS.emulateUser before invoking this - * method. - * @return A shallow load of AVAILABLE courses that user is enrolled in - * @since 2 - */ - Course[] listCoursesForUser(String username, boolean archived, boolean modifiableOnly); - - /** - * @param courseId - * @return A shallow load of folders - * @since 1 - */ - Folder[] listFoldersForCourse(String courseId); - - /** - * @param folderId - * @return A shallow load of folders - * @since 1 - */ - Folder[] listFoldersForFolder(String folderId); - - /** - * @param username - * unused. Please use ContextWS.emulateUser before invoking this - * method. - * @param courseid - * @param folderId - * @param itemUuid - * @param itemVersion - * @param url - * Appears to be of the form ?attachment.uuid=blah - * @param title - * @param description - * @param xml - * @param serverUrl - * @param attachmentUuid - * UUID of the attachment. Specify null for the item summary - * @return The folder it was successfully added to. Or null if not. - * @since 1 - */ - @AuthenticatedMethod(entitlements = { "course.content.CREATE" }, checkEntitlement = true) - AddItemResult addItemToCourse(String username, String courseid, String folderId, String itemUuid, int itemVersion, - String url, String title, String description, String xml, String serverUrl, String attachmentUuid); - - /** - * @param serverUrl - * The institution URL. Should be the same as configured in the - * Building Block - * @param itemUuid - * The uuid of the item to get usage for. - * @param itemVersion - * The version of the item to get usage for. Unused if allVersions - * specified - * @param available - * If true, will only check courses that are available - * @param allVersions - * Find all versions of said item - * @return An array of folders with populated course details - * @since 1 - */ - SearchResult findUsages(String serverUrl, String itemUuid, int itemVersion, boolean versionIsLatest, - boolean available, boolean allVersions); - - /** - * @param serverUrl - * The institution URL. Should be the same as configured in the - * Building Block - * @param query - * A freetext query to match external content name. ie. the name of the - * resource in Blackboard - * @param courseId - * restrict to this course - * @param folderId - * restrict to this folder - * @param available - * If true, will only check courses that are available - * @param offset - * Search paging - * @param count - * Search paging - * @param sortColumn - * "name" or "dateAdded" - * @param sortReverse - * @return An array of folders with populated course details - * @since 2 - */ - SearchResult findAllUsages(String serverUrl, String query, String courseId, String folderId, boolean available, - int offset, int count, String sortColumn, boolean sortReverse); - - /** - * Scans for EQUELLA content and updates the EQUELLA DB table for quick access - * - * @param institutionUrl - * @param available - * Only check available courses and available registered content - * @return Always true - * @since 1 - */ - boolean synchroniseEquellaContentTables(String institutionUrl, boolean available); - - /** - * Get the course code e.g. EQ101 for the supplied Blackboard internal course ID - * - * @param courseId - * @return null if the course doesn't have a code (may not even be allowed?) - */ - String getCourseCode(String courseId); - - /** - * Removes EQUELLA content (well, technically any content) from Blackboard - * - * @param contentId - * @return true - * @since 3 - */ - boolean deleteContent(String contentId); - - /** - * Updates EQUELLA content with a new title and description - * - * @param contentId - * @param title - * @param description - * @param institutionUrl - * @return true - * @since 3 - */ - boolean editContent(String contentId, String title, String description, String institutionUrl); - - /** - * Moves EQUELLA content from one location to another (course and folder) - * - * @param contentId - * @param courseId - * @param folderId - * @return true - * @since 3 - */ - boolean moveContent(String contentId, String courseId, String folderId); - - /** - * Do not use. Required to prevent two Course elements appearing in WSDL. - * - * @return A blank Base - */ - Base aBaseReturningMethod(); -} diff --git a/oeqPrimaryB2/.classpath b/oeqPrimaryB2/.classpath new file mode 100644 index 0000000..394f57b --- /dev/null +++ b/oeqPrimaryB2/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/oeqPrimary/.gitignore b/oeqPrimaryB2/.gitignore similarity index 66% rename from oeqPrimary/.gitignore rename to oeqPrimaryB2/.gitignore index f547dc2..dc6e088 100644 --- a/oeqPrimary/.gitignore +++ b/oeqPrimaryB2/.gitignore @@ -1,2 +1,3 @@ /.gradle/ /bin/ +/build/ diff --git a/oeqPrimary/.project b/oeqPrimaryB2/.project similarity index 55% rename from oeqPrimary/.project rename to oeqPrimaryB2/.project index 30d07c5..3a796ea 100644 --- a/oeqPrimary/.project +++ b/oeqPrimaryB2/.project @@ -1,6 +1,6 @@ - Blackboard Building Block 9 SP11+ + oeqPrimaryB2 @@ -10,6 +10,21 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + com.ibm.sse.model.structuredbuilder @@ -28,6 +43,9 @@ org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.buildship.core.gradleprojectnature com.tle.jpfclasspath.jpfproject diff --git a/oeqPrimaryB2/.settings/org.eclipse.buildship.core.prefs b/oeqPrimaryB2/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..b1886ad --- /dev/null +++ b/oeqPrimaryB2/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/oeqPrimary/src/main/java/icons.xml b/oeqPrimaryB2/src/main/java/icons.xml similarity index 100% rename from oeqPrimary/src/main/java/icons.xml rename to oeqPrimaryB2/src/main/java/icons.xml diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/BlockUtil.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/BlockUtil.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/BlockUtil.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/BlockUtil.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/Configuration.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/Configuration.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/Configuration.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/Configuration.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/TokenGenerator.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/TokenGenerator.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/TokenGenerator.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/TokenGenerator.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedContent.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedContent.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedContent.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedContent.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedCourse.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedCourse.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedCourse.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedCourse.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedUser.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedUser.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedUser.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/data/WrappedUser.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/lti/FixedBasicLtiLauncher.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/lti/FixedBasicLtiLauncher.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/lti/FixedBasicLtiLauncher.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/lti/FixedBasicLtiLauncher.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/ContentServlet.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/ContentServlet.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/ContentServlet.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/ContentServlet.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/RedirectServlet.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/RedirectServlet.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/RedirectServlet.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/integration/blackboard/buildingblock/servlet/RedirectServlet.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/web/remoting/soap/SoapService51.java b/oeqPrimaryB2/src/main/java/org/apereo/openequella/web/remoting/soap/SoapService51.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/web/remoting/soap/SoapService51.java rename to oeqPrimaryB2/src/main/java/org/apereo/openequella/web/remoting/soap/SoapService51.java diff --git a/oeqPrimary/src/main/manifests/bb-manifest-plugin.xsd b/oeqPrimaryB2/src/main/manifests/bb-manifest-plugin.xsd similarity index 100% rename from oeqPrimary/src/main/manifests/bb-manifest-plugin.xsd rename to oeqPrimaryB2/src/main/manifests/bb-manifest-plugin.xsd diff --git a/oeqPrimary/src/main/manifests/bb-manifest-unresolved.xml b/oeqPrimaryB2/src/main/manifests/bb-manifest-unresolved.xml similarity index 100% rename from oeqPrimary/src/main/manifests/bb-manifest-unresolved.xml rename to oeqPrimaryB2/src/main/manifests/bb-manifest-unresolved.xml diff --git a/oeqPrimary/src/main/manifests/bb-manifest-webservice.xml b/oeqPrimaryB2/src/main/manifests/bb-manifest-webservice.xml similarity index 100% rename from oeqPrimary/src/main/manifests/bb-manifest-webservice.xml rename to oeqPrimaryB2/src/main/manifests/bb-manifest-webservice.xml diff --git a/oeqPrimary/src/main/webapp/WEB-INF/web.xml b/oeqPrimaryB2/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from oeqPrimary/src/main/webapp/WEB-INF/web.xml rename to oeqPrimaryB2/src/main/webapp/WEB-INF/web.xml diff --git a/oeqPrimary/src/main/webapp/admin/config.jsp b/oeqPrimaryB2/src/main/webapp/admin/config.jsp similarity index 87% rename from oeqPrimary/src/main/webapp/admin/config.jsp rename to oeqPrimaryB2/src/main/webapp/admin/config.jsp index 6bba438..aae882b 100644 --- a/oeqPrimary/src/main/webapp/admin/config.jsp +++ b/oeqPrimaryB2/src/main/webapp/admin/config.jsp @@ -156,25 +156,6 @@ int number = 1; - <% - //Show webservice download if on 9.1 or greater (until we know the version the BB bug is fixed in) - int major = BbUtil.getMajorVersionNumber(); - if (major > 9 || major == 9 && BbUtil.getMinorVersionNumber() >= 1) { - %> - - -

-

The web service is required to be installed for the Blackboard "External System Connector" within EQUELLA to function.

-

To install it you must download the web service jar and - upload it under Web Service administration and then set it to "Available".

-
- - -
Download the web service jar
-
- - <% } %> - diff --git a/oeqPrimary/src/main/webapp/contribute/create.jsp b/oeqPrimaryB2/src/main/webapp/contribute/create.jsp similarity index 100% rename from oeqPrimary/src/main/webapp/contribute/create.jsp rename to oeqPrimaryB2/src/main/webapp/contribute/create.jsp diff --git a/oeqPrimary/src/main/webapp/contribute/modify.jsp b/oeqPrimaryB2/src/main/webapp/contribute/modify.jsp similarity index 100% rename from oeqPrimary/src/main/webapp/contribute/modify.jsp rename to oeqPrimaryB2/src/main/webapp/contribute/modify.jsp diff --git a/oeqPrimary/src/main/webapp/contribute/modify_proc.jsp b/oeqPrimaryB2/src/main/webapp/contribute/modify_proc.jsp similarity index 100% rename from oeqPrimary/src/main/webapp/contribute/modify_proc.jsp rename to oeqPrimaryB2/src/main/webapp/contribute/modify_proc.jsp diff --git a/oeqPrimary/src/main/webapp/contribute/remove.jsp b/oeqPrimaryB2/src/main/webapp/contribute/remove.jsp similarity index 100% rename from oeqPrimary/src/main/webapp/contribute/remove.jsp rename to oeqPrimaryB2/src/main/webapp/contribute/remove.jsp diff --git a/oeqPrimary/src/main/webapp/error.jsp b/oeqPrimaryB2/src/main/webapp/error.jsp similarity index 100% rename from oeqPrimary/src/main/webapp/error.jsp rename to oeqPrimaryB2/src/main/webapp/error.jsp diff --git a/oeqPrimary/src/main/webapp/images/export.gif b/oeqPrimaryB2/src/main/webapp/images/export.gif similarity index 100% rename from oeqPrimary/src/main/webapp/images/export.gif rename to oeqPrimaryB2/src/main/webapp/images/export.gif diff --git a/oeqPrimary/src/main/webapp/images/modify_off.gif b/oeqPrimaryB2/src/main/webapp/images/modify_off.gif similarity index 100% rename from oeqPrimary/src/main/webapp/images/modify_off.gif rename to oeqPrimaryB2/src/main/webapp/images/modify_off.gif diff --git a/oeqPrimary/src/main/webapp/images/tle.gif b/oeqPrimaryB2/src/main/webapp/images/tle.gif similarity index 100% rename from oeqPrimary/src/main/webapp/images/tle.gif rename to oeqPrimaryB2/src/main/webapp/images/tle.gif diff --git a/oeqPrimary/src/main/webapp/images/update_off.gif b/oeqPrimaryB2/src/main/webapp/images/update_off.gif similarity index 100% rename from oeqPrimary/src/main/webapp/images/update_off.gif rename to oeqPrimaryB2/src/main/webapp/images/update_off.gif diff --git a/oeqPrimary/src/main/webapp/portal/images/searchbutton.gif b/oeqPrimaryB2/src/main/webapp/portal/images/searchbutton.gif similarity index 100% rename from oeqPrimary/src/main/webapp/portal/images/searchbutton.gif rename to oeqPrimaryB2/src/main/webapp/portal/images/searchbutton.gif diff --git a/oeqPrimary/src/main/webapp/portal/images/searchbuttondn.gif b/oeqPrimaryB2/src/main/webapp/portal/images/searchbuttondn.gif similarity index 100% rename from oeqPrimary/src/main/webapp/portal/images/searchbuttondn.gif rename to oeqPrimaryB2/src/main/webapp/portal/images/searchbuttondn.gif diff --git a/oeqPrimary/src/main/webapp/portal/view.jsp b/oeqPrimaryB2/src/main/webapp/portal/view.jsp similarity index 100% rename from oeqPrimary/src/main/webapp/portal/view.jsp rename to oeqPrimaryB2/src/main/webapp/portal/view.jsp diff --git a/oeqPrimary/src/main/webapp/taglibs/config/bbNG.tld b/oeqPrimaryB2/src/main/webapp/taglibs/config/bbNG.tld similarity index 100% rename from oeqPrimary/src/main/webapp/taglibs/config/bbNG.tld rename to oeqPrimaryB2/src/main/webapp/taglibs/config/bbNG.tld diff --git a/oeqPrimary/src/main/webapp/taglibs/config/bbNG.xsl b/oeqPrimaryB2/src/main/webapp/taglibs/config/bbNG.xsl similarity index 100% rename from oeqPrimary/src/main/webapp/taglibs/config/bbNG.xsl rename to oeqPrimaryB2/src/main/webapp/taglibs/config/bbNG.xsl diff --git a/oeqPrimary/src/main/webapp/taglibs/config/struts/struts-bean.tld b/oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-bean.tld similarity index 100% rename from oeqPrimary/src/main/webapp/taglibs/config/struts/struts-bean.tld rename to oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-bean.tld diff --git a/oeqPrimary/src/main/webapp/taglibs/config/struts/struts-html.tld b/oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-html.tld similarity index 100% rename from oeqPrimary/src/main/webapp/taglibs/config/struts/struts-html.tld rename to oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-html.tld diff --git a/oeqPrimary/src/main/webapp/taglibs/config/struts/struts-logic.tld b/oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-logic.tld similarity index 100% rename from oeqPrimary/src/main/webapp/taglibs/config/struts/struts-logic.tld rename to oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-logic.tld diff --git a/oeqPrimary/src/main/webapp/taglibs/config/struts/struts-nested.tld b/oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-nested.tld similarity index 100% rename from oeqPrimary/src/main/webapp/taglibs/config/struts/struts-nested.tld rename to oeqPrimaryB2/src/main/webapp/taglibs/config/struts/struts-nested.tld diff --git a/oeqPrimary/src/main/webapp/taglibs/tle.tld b/oeqPrimaryB2/src/main/webapp/taglibs/tle.tld similarity index 100% rename from oeqPrimary/src/main/webapp/taglibs/tle.tld rename to oeqPrimaryB2/src/main/webapp/taglibs/tle.tld diff --git a/oeqPrimary/test.reports/TEST-com.tle.blackboard.common.content.LegacyItemUtilTest.xml b/oeqPrimaryB2/test.reports/TEST-com.tle.blackboard.common.content.LegacyItemUtilTest.xml similarity index 100% rename from oeqPrimary/test.reports/TEST-com.tle.blackboard.common.content.LegacyItemUtilTest.xml rename to oeqPrimaryB2/test.reports/TEST-com.tle.blackboard.common.content.LegacyItemUtilTest.xml diff --git a/oeqPrimary/test/com/tle/blackboard/common/content/LegacyItemUtilTest.java b/oeqPrimaryB2/test/com/tle/blackboard/common/content/LegacyItemUtilTest.java similarity index 100% rename from oeqPrimary/test/com/tle/blackboard/common/content/LegacyItemUtilTest.java rename to oeqPrimaryB2/test/com/tle/blackboard/common/content/LegacyItemUtilTest.java diff --git a/oeqPrimaryWS/.classpath b/oeqPrimaryWS/.classpath new file mode 100644 index 0000000..394f57b --- /dev/null +++ b/oeqPrimaryWS/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/oeqPrimaryWS/.gitignore b/oeqPrimaryWS/.gitignore new file mode 100644 index 0000000..dc6e088 --- /dev/null +++ b/oeqPrimaryWS/.gitignore @@ -0,0 +1,3 @@ +/.gradle/ +/bin/ +/build/ diff --git a/oeqPrimaryWS/.project b/oeqPrimaryWS/.project new file mode 100644 index 0000000..05d4d04 --- /dev/null +++ b/oeqPrimaryWS/.project @@ -0,0 +1,51 @@ + + + oeqPrimaryWS + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + com.ibm.sse.model.structuredbuilder + + + + + com.ibm.etools.validation.validationbuilder + + + + + com.tle.jpfclasspath.manifestBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.buildship.core.gradleprojectnature + com.tle.jpfclasspath.jpfproject + + diff --git a/oeqPrimaryWS/.settings/org.eclipse.buildship.core.prefs b/oeqPrimaryWS/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..b1886ad --- /dev/null +++ b/oeqPrimaryWS/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/oeqPrimaryWS/src/main/java/icons.xml b/oeqPrimaryWS/src/main/java/icons.xml new file mode 100644 index 0000000..31559fb --- /dev/null +++ b/oeqPrimaryWS/src/main/java/icons.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/AddItemResult.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/AddItemResult.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/AddItemResult.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/AddItemResult.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Base.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Base.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Base.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Base.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Content.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Content.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Content.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Content.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Course.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Course.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Course.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Course.java diff --git a/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/EquellaWebservice.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/EquellaWebservice.java new file mode 100644 index 0000000..e1d45a3 --- /dev/null +++ b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/EquellaWebservice.java @@ -0,0 +1,238 @@ +package org.apereo.openequella.integration.blackboard.webservice; + +import blackboard.platform.ws.anns.AuthenticatedMethod; + +/** + * Please use ContextWS.emulateUser before invoking any method. + *

+ * Error codes: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
EQ001Error getting persistence manager
EQ002Error generating ID
EQ003Error saving item
EQ004Invalid item
EQ005Error listing courses for user
EQ006Error listing folders for course
EQ007Error listing folders for folder
EQ010Error synchronising content
EQ011Error finding usage
EQ012Error getting course code
EQ013Error deleting content
EQ014Error editing content
EQ015Error moving content
EQ100Permission denied
+ */ +// @NonNullByDefault +public interface EquellaWebservice { + /** + * Returns the current version of this web service on the server + * + * @return The version of the webservice. This will only be incremented once the + * webservice is changed and there exists a released version of the old + * webservice in the wild. + * @since 1 + */ + int getServerVersion(); + + /** + * Tests that the EQUELLA webservice is reachable + * + * @param param + * A parameter to be echoed back + * @return The value of param + * @since 1 + */ + String testConnection(String param); + + /** + * @param username + * unused. Please use ContextWS.emulateUser before invoking this + * method. + * @return A shallow load of AVAILABLE courses that user is enrolled in + * @since 2 + */ + Course[] listCoursesForUser(String username, boolean archived, boolean modifiableOnly); + + /** + * @param courseId + * @return A shallow load of folders + * @since 1 + */ + Folder[] listFoldersForCourse(String courseId); + + /** + * @param folderId + * @return A shallow load of folders + * @since 1 + */ + Folder[] listFoldersForFolder(String folderId); + + /** + * @param username + * unused. Please use ContextWS.emulateUser before invoking this + * method. + * @param courseid + * @param folderId + * @param itemUuid + * @param itemVersion + * @param url + * Appears to be of the form ?attachment.uuid=blah + * @param title + * @param description + * @param xml + * @param serverUrl + * @param attachmentUuid + * UUID of the attachment. Specify null for the item summary + * @return The folder it was successfully added to. Or null if not. + * @since 1 + */ + @AuthenticatedMethod(entitlements = { "course.content.CREATE" }, checkEntitlement = true) + AddItemResult addItemToCourse(String username, String courseid, String folderId, String itemUuid, int itemVersion, + String url, String title, String description, String xml, String serverUrl, String attachmentUuid); + + /** + * @param serverUrl + * The institution URL. Should be the same as configured in the + * Building Block + * @param itemUuid + * The uuid of the item to get usage for. + * @param itemVersion + * The version of the item to get usage for. Unused if allVersions + * specified + * @param available + * If true, will only check courses that are available + * @param allVersions + * Find all versions of said item + * @return An array of folders with populated course details + * @since 1 + */ + SearchResult findUsages(String serverUrl, String itemUuid, int itemVersion, boolean versionIsLatest, + boolean available, boolean allVersions); + + /** + * @param serverUrl + * The institution URL. Should be the same as configured in the + * Building Block + * @param query + * A freetext query to match external content name. ie. the name of the + * resource in Blackboard + * @param courseId + * restrict to this course + * @param folderId + * restrict to this folder + * @param available + * If true, will only check courses that are available + * @param offset + * Search paging + * @param count + * Search paging + * @param sortColumn + * "name" or "dateAdded" + * @param sortReverse + * @return An array of folders with populated course details + * @since 2 + */ + SearchResult findAllUsages(String serverUrl, String query, String courseId, String folderId, boolean available, + int offset, int count, String sortColumn, boolean sortReverse); + + /** + * Scans for EQUELLA content and updates the EQUELLA DB table for quick access + * + * @param institutionUrl + * @param available + * Only check available courses and available registered content + * @return Always true + * @since 1 + */ + boolean synchroniseEquellaContentTables(String institutionUrl, boolean available); + + /** + * Get the course code e.g. EQ101 for the supplied Blackboard internal course ID + * + * @param courseId + * @return null if the course doesn't have a code (may not even be allowed?) + */ + String getCourseCode(String courseId); + + /** + * Removes EQUELLA content (well, technically any content) from Blackboard + * + * @param contentId + * @return true + * @since 3 + */ + boolean deleteContent(String contentId); + + /** + * Updates EQUELLA content with a new title and description + * + * @param contentId + * @param title + * @param description + * @param institutionUrl + * @return true + * @since 3 + */ + boolean editContent(String contentId, String title, String description, String institutionUrl); + + /** + * Moves EQUELLA content from one location to another (course and folder) + * + * @param contentId + * @param courseId + * @param folderId + * @return true + * @since 3 + */ + boolean moveContent(String contentId, String courseId, String folderId); + + /** + * Do not use. Required to prevent two Course elements appearing in WSDL. + * + * @return A blank Base + */ + Base aBaseReturningMethod(); +} diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Folder.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Folder.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Folder.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/Folder.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/SearchResult.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/SearchResult.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/SearchResult.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/SearchResult.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/BbWsSession.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/BbWsSession.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/BbWsSession.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/BbWsSession.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/PermissionException.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/PermissionException.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/PermissionException.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/PermissionException.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/SynchroniseContentThread.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/SynchroniseContentThread.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/SynchroniseContentThread.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/SynchroniseContentThread.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/WebServiceUtil.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/WebServiceUtil.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/WebServiceUtil.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/WebServiceUtil.java diff --git a/oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/ZEquellaWebserviceImpl.java b/oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/ZEquellaWebserviceImpl.java similarity index 100% rename from oeqPrimary/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/ZEquellaWebserviceImpl.java rename to oeqPrimaryWS/src/main/java/org/apereo/openequella/integration/blackboard/webservice/impl/ZEquellaWebserviceImpl.java diff --git a/oeqPrimaryWS/src/main/manifests/bb-manifest.xml b/oeqPrimaryWS/src/main/manifests/bb-manifest.xml new file mode 100644 index 0000000..7e07545 --- /dev/null +++ b/oeqPrimaryWS/src/main/manifests/bb-manifest.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oeqPrimaryWS/test.reports/TEST-com.tle.blackboard.common.content.LegacyItemUtilTest.xml b/oeqPrimaryWS/test.reports/TEST-com.tle.blackboard.common.content.LegacyItemUtilTest.xml new file mode 100644 index 0000000..fac377e --- /dev/null +++ b/oeqPrimaryWS/test.reports/TEST-com.tle.blackboard.common.content.LegacyItemUtilTest.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/oeqPrimaryWS/test/com/tle/blackboard/common/content/LegacyItemUtilTest.java b/oeqPrimaryWS/test/com/tle/blackboard/common/content/LegacyItemUtilTest.java new file mode 100644 index 0000000..d906cbb --- /dev/null +++ b/oeqPrimaryWS/test/com/tle/blackboard/common/content/LegacyItemUtilTest.java @@ -0,0 +1,162 @@ +/* + * Created on Dec 21, 2004 + */ +package com.tle.blackboard.common.content; + +import java.io.UnsupportedEncodingException; + +import org.apache.cxf.common.util.URIParserUtil; + +import com.tle.blackboard.common.propbag.PropBagMin; + +import junit.framework.TestCase; + +/** + * @author Chris Beach + */ +@SuppressWarnings("nls") +public class LegacyItemUtilTest extends TestCase +{ + @Override + protected void setUp() throws Exception + { + super.setUp(); + } + + @Override + protected void tearDown() throws Exception + { + super.tearDown(); + } + + public void testFixUnescapedAmpersandsEmpty() + { + assertEquals(LegacyItemUtil.fixUnescapedAmpersands(""), ""); + } + + public void testFixUnescapedAmpersandsSingle() + { + assertEquals(LegacyItemUtil.fixUnescapedAmpersands("&"), "&"); + } + + public void testFixUnescapedAmpersandsGeneral() + { + assertEquals(LegacyItemUtil.fixUnescapedAmpersands("& & &nsbp; &tc., &tc. &tc &"), + "& & &nsbp; &tc., &tc. &tc &"); + } + + public void testFixUnescapedAmpersandsMultiples() + { + assertEquals(LegacyItemUtil.fixUnescapedAmpersands("&& &&& &ns bp;"), "&& &&& &ns bp;"); + } + + public void testFixUnescapedAmpersandsXml() + { + assertEquals( + LegacyItemUtil + .fixUnescapedAmpersands("EQAS-403 test &Desc - EQAS-403 test &mauna-kea-heaven-time-lapse-&.jpgmauna-kea-heaven-time-lapse-&.jpg"), + "EQAS-403 test &Desc - EQAS-403 test &mauna-kea-heaven-time-lapse-&.jpgmauna-kea-heaven-time-lapse-&.jpg"); + } + + public void testCreatePropBagWithAmpersands() + { + String xmlStr = "EQAS-403 test &Desc - EQAS-403 test &mauna-kea-heaven-time-lapse-&.jpgmauna-kea-heaven-time-lapse-&.jpg"; + PropBagMin props = LegacyItemUtil.createPropBag(xmlStr); + assertEquals( + props.toString(), + "EQAS-403 test &Desc - EQAS-403 test &mauna-kea-heaven-time-lapse-&.jpgmauna-kea-heaven-time-lapse-&.jpg"); + } + + public void testCreatePropBagWithXmlEscapedCharacters() + { + String xmlStr = "amp test &<>'"; & < > ' " ;amp test &<>'"; & < > ' " ; descamp test att &'<;>%22.jpg.jpgamp test att &'<;>%22.jpg.jpg"; + PropBagMin props = LegacyItemUtil.createPropBag(xmlStr); + assertEquals( + props.toString(), + "amp test &<>'"; & < > ' " ;amp test &<>'"; & < > ' " ; descamp test att &'<;>%22.jpg.jpgamp test att &'<;>%22.jpg.jpg"); + } + + public void testCreatePropBagWithoutAmpersands() + { + String xmlStr = "EQAS-403 testDesc - EQAS-403 testmauna-kea-heaven-time-lapse.jpgmauna-kea-heaven-time-lapse.jpg"; + PropBagMin props = LegacyItemUtil.createPropBag(xmlStr); + assertEquals( + props.toString(), + "EQAS-403 testDesc - EQAS-403 testmauna-kea-heaven-time-lapse.jpgmauna-kea-heaven-time-lapse.jpg"); + } + + // Currently this fails. If clients have non-xml entities in the item names, + // descriptions, or filenames of attachments, then this kind of tests will + // need to be setup on a case by case basis. + // public void testCreatePropBagWithNonXmlHtmlEntities() + // { + // String xmlStr = + // "amp test  amp test   descamp test att  .jpgamp test att  .jpg"; + // PropBagMin props = LegacyItemUtil.createPropBag(xmlStr); + // assertEquals(props.toString(), "TODO"); + // + // } + + public void testScrubLegacyPageSoloSpace() + { + assertEquals(LegacyItemUtil.scrubLegacyPage(" "), "%20"); + } + + public void testScrubLegacyPageSoloEncodedPlus() + { + assertEquals(LegacyItemUtil.scrubLegacyPage("%2B"), "%252B"); + } + + public void testScrubLegacyPageSoloPlus() + { + assertEquals(LegacyItemUtil.scrubLegacyPage("+"), "%2B"); + } + + public void testScrubLegacyPageSoloSlash() + { + assertEquals(LegacyItemUtil.scrubLegacyPage("/"), "/"); + } + + public void testScrubLegacyPageSoloPreEncodedSlash() + { + assertEquals(LegacyItemUtil.scrubLegacyPage("%2F"), "%252F"); + } + + public void testScrubLegacyPageOnlyFilename() throws UnsupportedEncodingException + { + // Test the special characters in a filename. + // Note - It's by design to not encode the slash. + String page = "I%2Fam a spacey filename !#$&'%()*+,:;=?@[].jpg"; + String uri = (URIParserUtil.escapeChars(page)).toString(); + System.out.println("URI parser output [" + uri + "]"); + assertEquals(LegacyItemUtil.scrubLegacyPage(page), + "I%252Fam%20a%20spacey%20filename%20%21%23%24%26%27%25%28%29*%2B%2C%3A%3B%3D%3F%40%5B%5D.jpg"); + } + + public void testScrubLegacyPageFolderAndFilename() throws UnsupportedEncodingException + { + String page = "this / is / a / folder/I%2Fam a spacey filename !#$&'%()*+,:;=?@[].jpg"; + + assertEquals(LegacyItemUtil.scrubLegacyPage(page), page); + } + + public void testScrubLegacyPageOnlyFolder() throws UnsupportedEncodingException + { + // Test the special characters except for : since you can't put that in + // a filename. + // Note - It's by design to not encode the slash. + String page = "this / is / a / folder/"; + + assertEquals(LegacyItemUtil.scrubLegacyPage(page), page); + } + + public void testScrubLegacyPageNullPage() throws UnsupportedEncodingException + { + assertEquals(LegacyItemUtil.scrubLegacyPage(null), ""); + } + + public void testScrubLegacyPageDotSlashPage() throws UnsupportedEncodingException + { + assertEquals(LegacyItemUtil.scrubLegacyPage("./"), ""); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index c874062..0fe20fe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -rootProject.name = 'oeq-building-block' -include 'oeqAudit', 'oeqPrimary', 'oeqCommon' +rootProject.name = 'oeq-blackboard-integration' +include 'oeqAuditB2', 'oeqPrimaryB2', 'oeqCommon', 'oeqPrimaryWS' \ No newline at end of file