mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added desktop action attribute to allow file/folder parameters to be optional.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3535 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -148,7 +148,7 @@ BOOL CCAlfrescoAppApp::InitInstance()
|
||||
|
||||
// Action does not use targets, just run the action
|
||||
|
||||
else {
|
||||
else if ( actionInfo.allowsNoParameters()) {
|
||||
|
||||
// Run the action
|
||||
|
||||
@@ -465,6 +465,13 @@ bool CCAlfrescoAppApp::runAction( AlfrescoInterface& alfresco, StringList& pathL
|
||||
|
||||
if ( buildDesktopParameters( alfresco, pathList, actionInfo, desktopParams)) {
|
||||
|
||||
// Check if the action requires parameters
|
||||
|
||||
if ( actionInfo.allowsNoParameters() == false && desktopParams.numberOfTargets() == 0) {
|
||||
AfxMessageBox( L"No parameters for action", MB_OK | MB_ICONEXCLAMATION);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Run the desktop action
|
||||
|
||||
DesktopResponse response = alfresco.runAction( actionInfo, desktopParams);
|
||||
|
@@ -106,6 +106,7 @@ namespace Alfresco {
|
||||
#define AttrAlfrescoFiles 0x0010
|
||||
#define AttrAlfrescoFolders 0x0020
|
||||
#define AttrMultiplePaths 0x0040
|
||||
#define AttrAllowNoParams 0x0080
|
||||
|
||||
#define AttrAnyFiles (AttrTargetFiles + AttrClientFiles + AttrAlfrescoFiles)
|
||||
#define AttrAnyFolders (AttrTargetFolders + AttrClientFolders + AttrAlfrescoFolders)
|
||||
@@ -367,6 +368,10 @@ public:
|
||||
inline bool supportsFiles(void) const { return hasAttribute(AttrTargetFiles+AttrClientFiles+AttrAlfrescoFiles); }
|
||||
inline bool supportsFolders(void) const { return hasAttribute(AttrTargetFolders+AttrClientFolders+AttrAlfrescoFolders); }
|
||||
|
||||
// Check if the action allows no parameters
|
||||
|
||||
inline bool allowsNoParameters(void) const { return hasAttribute(AttrAllowNoParams) || hasAttribute(AttrAnyFilesFolders) == false; }
|
||||
|
||||
// Set the action name, pseudo name, set the confirmation message
|
||||
|
||||
inline void setName(const String& name) { m_name = name; }
|
||||
|
Reference in New Issue
Block a user