|
From: creedon <icr...@us...> - 2006-02-10 03:21:34
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/discuss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1634 Modified Files: getMessageAttachmentsFolder Log Message: added flStoreInSiteFolder parameter which when set to true just simply returns the site name Index: getMessageAttachmentsFolder =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/discuss/getMessageAttachmentsFolder,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** getMessageAttachmentsFolder 26 Mar 2005 21:45:34 -0000 1.1.1.1 --- getMessageAttachmentsFolder 10 Feb 2006 03:21:26 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:mainResponder.discuss.getMessageAttachmentsFolder ! on getMessageAttachmentsFolder (adrMsgTable, adrUrl=nil, pta=nil) { ÇGet the path to the folder on disk where uploads attached to this message get stored. This is code factored out from mainResponder.discuss.editMessageForm, postAttachedFile, and postEditedMessage. adrUrl^, if not nil, will contain the url of the folder. Ç03/15/00; 4:53:20 PM by PBS if pta == nil { pta = html.getPageTableAddress ()}; local (adrDiscuss = mainResponder.discuss.openRoot ()); local (dgName = nameOf (adrDiscuss^)); local (groupName); bundle { //get the real name of the dg (it might be an address in discuss.root) ÇWhy not just use pta^.discussionRoot -- since that should be the real name? Because some static servers have case sensitive file systems. So get the name from discuss.root, so it's always the same. The same thing is done for the membership group name. local (adr = @[system.temp.mainResponder.discussRootFile]); if defined (adr^.[pta^.discussionRoot]) { dgName = nameOf (adr^.[pta^.discussionRoot])}}; bundle { //get the real name of the membership group (it might be an address in members.root) if defined (pta^.members) { groupName = pta^.members} else { groupName = pta^.defaultMembershipGroup}; local (adr = @[system.temp.mainResponder.membersRootFile]); if defined (adr^.[groupName]) { groupName = nameOf (adr^.[groupName])}}; local (folderPath = adrDiscuss^.prefs.binaryServerFolder); local (url = adrDiscuss^.prefs.binaryServerURL); local (pc = file.getPathChar ()); on addToPath (s) { //append sub-folders to folderpath folderPath = folderPath + s + pc; url = url + s + "/"; return (true)}; addToPath (groupName); addToPath (adrMsgTable^.member); addToPath (dgName); addToPath (adrMsgTable^.msgNum); if adrUrl != nil { //put the URL in adrUrl^ if wanted adrUrl^ = url}; return (folderPath)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:mainResponder.discuss.getMessageAttachmentsFolder ! on getMessageAttachmentsFolder (adrMsgTable, adrUrl = nil, pta = nil, flStoreInSiteFolder = false) { ÇChanges Ç2/9/06; 5:44:18 PM by TAC Çadded flStoreInSiteFolder parameter which when set to true just simply returns the site name Ç03/15/00; 4:53:20 PM by PBS Çcreated ÇGet the path to the folder on disk where uploads attached to this message get stored. This is code factored out from mainResponder.discuss.editMessageForm, postAttachedFile, and postEditedMessage. adrUrl^, if not nil, will contain the url of the folder. if pta == nil { pta = html.getPageTableAddress ()}; Çscratchpad.pt = pta^ // testing local (adrDiscuss = mainResponder.discuss.openRoot ()); local (dgName = nameOf (adrDiscuss^)); local (groupName); local (siteName = nameOf (pta^.adrSiteRootTable^)); if flStoreInSiteFolder { if string.lower (siteName) endsWith "mrws" { siteName = string.delete (siteName, sizeOf (siteName) - 3, infinity)}} else { bundle { //get the real name of the dg (it might be an address in discuss.root) ÇWhy not just use pta^.discussionRoot -- since that should be the real name? Because some static servers have case sensitive file systems. So get the name from discuss.root, so it's always the same. The same thing is done for the membership group name. local (adr = @[system.temp.mainResponder.discussRootFile]); if defined (adr^.[pta^.discussionRoot]) { dgName = nameOf (adr^.[pta^.discussionRoot])}}; bundle { //get the real name of the membership group (it might be an address in members.root) if defined (pta^.members) { groupName = pta^.members} else { groupName = pta^.defaultMembershipGroup}; local (adr = @[system.temp.mainResponder.membersRootFile]); if defined (adr^.[groupName]) { groupName = nameOf (adr^.[groupName])}}}; local (folderPath = adrDiscuss^.prefs.binaryServerFolder); local (url = adrDiscuss^.prefs.binaryServerURL); local (pc = file.getPathChar ()); on addToPath (s) { //append sub-folders to folderpath folderPath = folderPath + s + pc; url = url + s + "/"; return (true)}; if flStoreInSiteFolder { addToPath (siteName)} else { addToPath (groupName); addToPath (adrMsgTable^.member); addToPath (dgName); addToPath (adrMsgTable^.msgNum)}; if adrUrl != nil { //put the URL in adrUrl^ if wanted adrUrl^ = url}; return (folderPath)}; Çbundle // testing Çhtml.setPageTableAddress (@scratchpad.pt) Ç Çdialog.alert (getMessageAttachmentsFolder (@workingSampleMrWs.["#discussionGroup"].messages.["0000017"], flStoreInSiteFolder: true)) Ç Çhtml.deletePageTableAddress () \ No newline at end of file |