diff --git a/config/alfresco/desktop/Alfresco.exe b/config/alfresco/desktop/Alfresco.exe index 1dc932a15d..94aee691ab 100644 Binary files a/config/alfresco/desktop/Alfresco.exe and b/config/alfresco/desktop/Alfresco.exe differ diff --git a/source/cpp/CAlfrescoApp/CAlfrescoApp.cpp b/source/cpp/CAlfrescoApp/CAlfrescoApp.cpp index 4362c84821..2120081d24 100644 --- a/source/cpp/CAlfrescoApp/CAlfrescoApp.cpp +++ b/source/cpp/CAlfrescoApp/CAlfrescoApp.cpp @@ -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); diff --git a/source/cpp/CAlfrescoApp/includes/alfresco/Alfresco.hpp b/source/cpp/CAlfrescoApp/includes/alfresco/Alfresco.hpp index 0bce50c321..397bd18831 100644 --- a/source/cpp/CAlfrescoApp/includes/alfresco/Alfresco.hpp +++ b/source/cpp/CAlfrescoApp/includes/alfresco/Alfresco.hpp @@ -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; } diff --git a/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java b/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java index 77b6456074..d17fca8b31 100644 --- a/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java +++ b/source/java/org/alfresco/filesys/smb/server/repo/DesktopAction.java @@ -65,6 +65,8 @@ public abstract class DesktopAction { public static final int AttrMultiplePaths = 0x0040; // run action using multiple paths // default is to run the action against a single path with the client app calling the action // multiple times + public static final int AttrAllowNoParams = 0x0080; // allow action to run without parameters + // used when files/folder parameters are optional public static final int AttrAnyFiles = AttrTargetFiles + AttrClientFiles + AttrAlfrescoFiles; public static final int AttrAnyFolders = AttrTargetFolders + AttrClientFolders + AttrAlfrescoFolders; @@ -117,7 +119,7 @@ public abstract class DesktopAction { /** * Default constructor */ - public DesktopAction() + protected DesktopAction() { } @@ -127,7 +129,7 @@ public abstract class DesktopAction { * @param attr int * @param preActions int */ - public DesktopAction(int attr, int preActions) + protected DesktopAction(int attr, int preActions) { setAttributes(attr); setPreProcessActions(preActions); @@ -138,7 +140,7 @@ public abstract class DesktopAction { * * @param name String */ - public DesktopAction(String name) + protected DesktopAction(String name) { m_name = name; } diff --git a/source/java/org/alfresco/filesys/smb/server/repo/desk/CmdLineDesktopAction.java b/source/java/org/alfresco/filesys/smb/server/repo/desk/CmdLineDesktopAction.java index a67b4768cf..6744204fdf 100644 --- a/source/java/org/alfresco/filesys/smb/server/repo/desk/CmdLineDesktopAction.java +++ b/source/java/org/alfresco/filesys/smb/server/repo/desk/CmdLineDesktopAction.java @@ -34,7 +34,7 @@ public class CmdLineDesktopAction extends DesktopAction { */ public CmdLineDesktopAction() { - super( 0, DesktopAction.PreConfirmAction); + super( 0, PreConfirmAction); } @Override diff --git a/source/java/org/alfresco/filesys/smb/server/repo/desk/EchoDesktopAction.java b/source/java/org/alfresco/filesys/smb/server/repo/desk/EchoDesktopAction.java index 78a8bb9783..2293d3efff 100644 --- a/source/java/org/alfresco/filesys/smb/server/repo/desk/EchoDesktopAction.java +++ b/source/java/org/alfresco/filesys/smb/server/repo/desk/EchoDesktopAction.java @@ -36,7 +36,7 @@ public class EchoDesktopAction extends DesktopAction { */ public EchoDesktopAction() { - super( 0, DesktopAction.PreConfirmAction); + super( 0, PreConfirmAction); } @Override diff --git a/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java b/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java index 23129a5ac5..ca63252963 100644 --- a/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java +++ b/source/java/org/alfresco/filesys/smb/server/repo/desk/URLDesktopAction.java @@ -34,7 +34,7 @@ public class URLDesktopAction extends DesktopAction { */ public URLDesktopAction() { - super( 0, DesktopAction.PreConfirmAction); + super( 0, PreConfirmAction); } @Override