//Scrum 22272 (2/14/18): portlet version of repository var Fse; if( ! Fse ) { Fse = {}; } if( ! Fse.REP ) { Fse.REP = {}; } Fse.REP.getHandler = function() { var oLink = document.getElementById( "repHandlerLink" ); return oLink.getAttribute( "href" ); }; Fse.REP.viewRepositoryPortlet = function( sDomain, sContainerType, iContainerId, oOptions ) { var sURL = Fse.Util.updateURL( Fse.REP.getHandler() + "?view=filesRepository", { domain : sDomain, containerType: sContainerType, containerId: iContainerId } ); if( oOptions ) { sURL = Fse.Util.updateURL( sURL, oOptions ); } var oDialogOptions = { src : sURL, title : "Files Repository", width : "800px", namedButtons : "close" }; Fse.DialogManager.show( "viewFilesRepository$", oDialogOptions ); }; Fse.REP.detailFilePortlet = function( sMode, sDomain, sContainerType, iContainerId, iFileId, oOptions ) { if (iFileId !== undefined) var sQueryParams = { mode: sMode, domain : sDomain, containerType: sContainerType, containerId: iContainerId, fileId: iFileId }; else var sQueryParams = { mode: sMode, domain : sDomain, containerType: sContainerType, containerId: iContainerId}; var sURL = Fse.Util.updateURL( Fse.REP.getHandler() + "?view=detailFile", sQueryParams); if( oOptions ) { sURL = Fse.Util.updateURL( sURL, oOptions ); } var oDialogOptions = { src : sURL, title : "File Details", width : "800px" }; oDialogOptions.onSuccess = function() { Fse.REP.viewRepositoryPortlet( sDomain, sContainerType, iContainerId, oOptions ) }; Fse.DialogManager.show( "detailFile$", oDialogOptions ); }; Fse.REP.deleteRepositoryFile = function ( sTitle, sDomain, sContainerType, iContainerId, iFileId, sURL, oOptions ) { if( confirm( "Delete '" + sTitle + "'") ) { var sPostData = ("domain=" + sDomain + "&containerType=" + sContainerType + "&containerId=" + iContainerId + "&fileID=" + iFileId); var fnCall = function(){ Fse.Ajax.showWait( 50, "Deleting, Please wait..." ); Fse.REP.viewRepositoryPortlet( sDomain, sContainerType, iContainerId, oOptions ); } Fse.Ajax.postURL(sURL, sPostData , fnCall ); } };