Index: fluid-engage-kettle/src/main/webapp/application/engageConfig.json =================================================================== --- fluid-engage-kettle/src/main/webapp/application/engageConfig.json (revision 9447) +++ fluid-engage-kettle/src/main/webapp/application/engageConfig.json (working copy) @@ -28,7 +28,8 @@ "fluid.codeEntry.initCodeEntryDataFeed", "fluid.codeEntry.initCodeEntryService", "fluid.myCollection.initMyCollectionService", - "fluid.collectOperations.initAcceptor" + "fluid.collectOperations.initAcceptor", + "fluid.myCollection.initSubmitFeed" ], views: { all: "all", Index: fluid-engage-kettle/src/main/webapp/application/engageStandaloneConfig.json =================================================================== --- fluid-engage-kettle/src/main/webapp/application/engageStandaloneConfig.json (revision 9447) +++ fluid-engage-kettle/src/main/webapp/application/engageStandaloneConfig.json (working copy) @@ -26,7 +26,8 @@ "fluid.codeEntry.initCodeEntryDataFeed", "fluid.codeEntry.initCodeEntryService", "fluid.myCollection.initMyCollectionService", - "fluid.collectOperations.initAcceptor" + "fluid.collectOperations.initAcceptor", + "fluid.myCollection.initSubmitFeed" ], views: { all: "all", Index: fluid-engage-kettle/src/main/webapp/kettle/KettleIncludes.json =================================================================== --- fluid-engage-kettle/src/main/webapp/kettle/KettleIncludes.json (revision 9447) +++ fluid-engage-kettle/src/main/webapp/kettle/KettleIncludes.json (working copy) @@ -33,5 +33,6 @@ "../services/myCollection/js/myCollectionService.js", "../services/myCollection/js/collectOperations.js", "../services/myCollection/js/collectionCommon.js", - "../services/user/js/userService.js" + "../services/user/js/userService.js", + "../services/myCollection/js/submitMyCollectionService.js" ] Index: fluid-engage-kettle/src/main/webapp/services/myCollection/js/myCollectionService.js =================================================================== --- fluid-engage-kettle/src/main/webapp/services/myCollection/js/myCollectionService.js (revision 9447) +++ fluid-engage-kettle/src/main/webapp/services/myCollection/js/myCollectionService.js (working copy) @@ -78,7 +78,7 @@ urlsByMuseum.push({ url: compileArtifactQueryURL(urlTemplate, view, museum, query), museum: museum - }) + }); } } @@ -98,6 +98,7 @@ return fluid.transform(artifacts, function (artifact) { return { id: artifact.id, + artifactId: artifact.artifactId, // TODO: This is not actually part of the navigation list model target: baseArtifactURL + "?" + $.param({ accessNumber: artifact.artifactAccessionNumber, db: dbName, @@ -157,7 +158,8 @@ 'comments': artifact.comments ? artifact.comments.comment || [] : [], 'relatedArtifactsCount': artifact.related_artifacts ? artifact.related_artifacts.cnt || "0" : "0", 'relatedArtifacts': artifact.related_artifacts ? artifact.related_artifacts.artifact || [] : [], - 'image': artifact.images ? artifact.images.image : [] + 'image': artifact.images ? artifact.images.image : [], + 'artifactId': artifact.id }; } return mappedModel; @@ -174,7 +176,9 @@ return fluid.transform(dataRows, function (row) { var artifact = preMap(row.doc, database); - return fluid.engage.mapModel(artifact, database); + var mappedModel = fluid.engage.mapModel(artifact, database); + mappedModel.artifactId = artifact.value.artifactId; // Another ugly walkaround that should be dealt with + return mappedModel; }); }; @@ -242,7 +246,7 @@ return { ID: "initBlock", functionname: "fluid.engage.myCollection", - arguments: [".flc-myCollection", options] + "arguments": [".flc-myCollection", options] }; }); }; Index: fluid-engage-kettle/src/main/webapp/services/myCollection/js/submitMyCollectionService.js =================================================================== --- fluid-engage-kettle/src/main/webapp/services/myCollection/js/submitMyCollectionService.js (revision 0) +++ fluid-engage-kettle/src/main/webapp/services/myCollection/js/submitMyCollectionService.js (revision 0) @@ -0,0 +1,46 @@ +/* +Copyright 2009 University of Cambridge +Copyright 2009 University of Toronto + +Licensed under the Educational Community License (ECL), Version 2.0 or the New +BSD license. You may not use this file except in compliance with one these +Licenses. + +You may obtain a copy of the ECL 2.0 License and BSD License at +https://source.fluidproject.org/svn/LICENSE.txt +*/ + +// Declare dependencies. +/*global jQuery, fluid*/ +"use strict"; + +fluid = fluid || {}; + +(function ($) { + + var submitMyCollection = function (params, config) { + $.ajax({ + url: params.url, + type: "GET", + dataType: "xml", + success: function (data) { + return [200, {"Content-Type": "text/plain"}, JSON.stringify({response: "Success"})]; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + return [200, {"Content-Type": "text/plain"}, JSON.stringify({ + XMLHttpRequest: XMLHttpRequest, + textStatus: textStatus + })]; + } + }); + }; + + fluid.myCollection.initSubmitFeed = function (config, app) { + var submitMyCollectionDataHandler = function (env) { + return [200, {"Content-Type": "text/plain"}, JSON.stringify(submitMyCollection(env.urlState.params, config))]; + }; + var acceptor = fluid.engage.makeAcceptorForResource("submit", "json", submitMyCollectionDataHandler); + fluid.engage.mountAcceptor(app, "myCollection", acceptor); + }; + +})(jQuery);