Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
DestinationObject
Ralf
Hi,
has anybody a hint for me how to get a certain destination passed to the FileSaveCmd? I don`t really understand how to pass the information to the dialog from with in the nrs.
What I want to do with this is to preset a location in the FileSave Dialog, so that a user from with in e.g. Word could just click save in the dialog if the preset information is correct, instead of navigating somewhere. I have the information of an prior selected DestinationObject to pass to the dialog.
I know how to use this contextitem to call a new FileSaveCmd.
Thanx,
Ralf
Find more posts tagged with
Comments
DaleN
By default the enhanced dialogs open to the last folder used by whatever Open, Save etc command was executed. The id for that folder container is stored in the registry under the following key:
[HKEY_CURRENT_USER\Software\Interwoven\WorkSite\8.0\iManExt\BrowseDlg\Last Location]
You may be able to set the Path string value to the id of the DestinationObject you have stored just before the dialog is loaded.
Regards,
Dale
jny
You may certainly try writing to this key before executing your IManFileOpenCmd to see if that will work correctly for you.
Please note that if another instance of a dialog, i.e., SaveAs, Open, from any other application is used for the end-user to select a location, the value you added will get overwritten by the last used dialog. So you would always need to write to this key before execution of your IManFileOpenCmd Object.
Here's a code snippet to demonstrate building the last location path to a folder under a workspace:
[C#]
// Constants for building preselect location
const string WORKSPACE_NODE = "My Workspaces"; // or "Other Workspaces"; interchangable
const string DELIMITER = "\\"; // location path separator
// Assuming the location in the dialog to bring user to is _
// a specified folder named, FolderTestA-a, inside a _
// workspace belonging to the currently logged on user, _
// we'll search for the folder.
// (i.e.,\ServerDevelopment\DatabaseTest\My WorkSpaces\
// WorkspaceTest\TabTest\FolderTestA\FolderTestA-a)
// Create search parameters
IManFolderSearchParameters oParams = oDMS.CreateFolderSearchParameters();
// Add search criteria
oParams.Add (imFolderAttributeID.imFolderName, "FolderTestA-a");
oParams.Add (imFolderAttributeID.imFolderOwner, oSess.UserID);
// Search for folder
IManFolders oResults = oSess.WorkArea.SearchFolders(oList, oParams);
// Check oResults
if (oResults.Empty == true)
{
// Destination folder is not found; exit app.
MessageBox.Show( "folder not found.");
Environment.Exit(0);
}
// Assuming the first item is the oTarget folder
IManFolder oTarget = oResults.ItemByIndex(1);
// Path, which returns IManFolders collection representing _
// the ancestors of the IManFolder object and including _
// the folder itself, is ordered from the root to the current folder, _
// i.e., the root level folder is ItemByIndex(1).
IManFolders oPath = oTarget.Path;
// Build preselected path
string strPreSelectedLoc = string.Empty;
for(int i=1; i<=oPath.Count; i++)
{
// Concatenate the Object ID of each folder object in the oTarget's path
strPreSelectedLoc = strPreSelectedLoc + DELIMITER + oPath.ItemByIndex(i).ObjectID;
}
// The object ID's of oSession and database to which the oTarget folder belongs come first
// in the order of object ID's in the preselected path.
string sessID = oTarget.Database.Session.ObjectID;
string dbID = oTarget.Database.ObjectID;
// Concatenate Object ID's to build preselected location
strPreSelectedLoc = DELIMITER + sessID + DELIMITER + dbID + DELIMITER + WORKSPACE_NODE + strPreSelectedLoc;
shahbm
hi guys,
To ask a question relevant in this post, i am trying to get the imProfileDatabase from the IManfilesavedlg object on the onchange event, which to me looks like is the destination object or part of it as a user would select a workspace folder to save a doc into.
This is ofcourse from a template which has hooked into the IManVBA and sinked into the IManFileSavecmd and the Dlg objects.
Can anyone please tell me if its possible to capture or know the database name from the location the user would select in the filesavedlg !!
I know about the reg key that holds the last saved or used folder path(id)
thanks in advance,
koms/ bhavin