// Copyright 2000 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wAllCommands: // Comprehensive enum of all commands. Includes method for determining // if commands are supported in browse-only mode. // ------------------------------------- // Includes // #include <p4wp4.h> #include "p4wAllCommands.h" int p4wAllCommands::CanBrowse(AllCommands cmd) { int canBrowse = 0; // // Is specified command allowed in browse only mode switch(cmd) { case AC_NONE: case AC_SUBMITTEDCHANGELISTS: case AC_SUBMITTEDCHANGELISTSFILE: case AC_FILESMATCHING: case AC_FILESMATCHINGFRM: case AC_OPENEDFILESALL: case AC_FILETEXTDEPOT: case AC_TEXTCONTENT: case AC_MIMECONTENT: case AC_LABELS: case AC_LABELSPATH: case AC_SERVERINFO: case AC_CLIENTS: case AC_USERS: case AC_BRANCHES: case AC_JOBS: case AC_SHOWHIDEJOBCOLS: case AC_PATHBROWSER: case AC_DESCRIBE: case AC_DESCRIBEDEAFULT: case AC_PRINT: case AC_ICON: case AC_HELP: case AC_BROWSEFILE: case AC_DEPOT: case AC_CLIENT: case AC_BRANCHVIEW: case AC_CLIENTVIEW: case AC_LABELVIEW: case AC_USERVIEW: case AC_RSSUSER: case AC_RSSJOBVIEW: case AC_JOBVIEW: case AC_DIFF2: case AC_DIFF21: case AC_DIFF22: case AC_DIFFSVR: case AC_DIFF2FILES: case AC_DIFF2FILESPROCESSOR: case AC_DIFF2DIRS: case AC_DIFF2DIRSOUTPUT: case AC_UNSUPPORTED: case AC_CONFIGURATION: case AC_MULTIUSER: case AC_MENUPROCESSOR: case AC_MATCHPROCESSOR: case AC_CHANGESPROCESSOR: case AC_FIXSUBPROCESSOR: case AC_CONFIGPROCESSOR: case AC_MULTIUSERPROCESSOR: case AC_BRANCHESPROCESSOR: case AC_LABELSPROCESSOR: case AC_CLIENTSPROCESSOR: case AC_USERSPROCESSOR: case AC_FILESTATE: case AC_CLIENTSWITCHRES: case AC_CLIENTSWITCH: case AC_LABELFILES: case AC_LABELFILESTEXT: case AC_BRANCHDIFF: case AC_JOBFIELDS: case AC_JOBSPEC: case AC_FIXESCHANGE: case AC_FIXESJOB: case AC_JOBSPROCESSOR: case AC_GENERALANNOTATE: case AC_ANNOTATE: case AC_FULLANNOTATE: case AC_CHGLISTANNOTATE: case AC_CHGLISTFULLANNOTATE: case AC_CANCELCMD: case AC_DEPOTPROCESSOR: case AC_PATHNOOPEN: case AC_ABOUT: case AC_GOTO: case AC_GOPROCESSOR: case AC_RSSCHGS: case AC_RSSJOBS: case AC_LOGOUT: case AC_LOGOUT2: case AC_GETTHUMBNAIL: case AC_ECHOURLAsDATA: case AC_WORKSPACEFILE: case AC_SHOWHIDECOLUMNS: case AC_SHOWHIDECOLSPROC: case AC_SHOWHIDEFILECOLS: case AC_CHGLISTANNOTATEPROC: case AC_USERPSWD: ++canBrowse; break; case AC_P4CMD: case AC_P4CMDTAGGED: case AC_P4CMDXML: case AC_P4CMDPANE: case AC_P4CMDPROCESSOR: ++canBrowse; break; default: break; } return canBrowse; } int p4wAllCommands::IsPathBrowser( AllCommands cmd ) { int isPathBrowserCmd = 0; // // Is cmd a path browser command? Return 1 only if this is certain switch( cmd ) { case AC_SUBMITTEDCHANGELISTS: case AC_FIXSUBMITTED: case AC_UNSYNCED: case AC_UNRESOLVED: case AC_MISSING: case AC_OPENEDUNCHANGED: case AC_CHANGESUNOPENED: case AC_FILESMATCHING: case AC_FILESMATCHINGFRM: case AC_OPENEDFILESALL: case AC_PENDINGINTEGS: case AC_DEPOT: case AC_CLIENT: case AC_WORKSPACE: case AC_PATHBROWSER: case AC_DEPOTPROCESSOR: case AC_PATHOPENED: case AC_PATHNOOPEN: case AC_PATHNOCURRENT: case AC_DIFF2DIRS: case AC_DIFF2DIRSOUTPUT: ++isPathBrowserCmd; break; default: break; } return isPathBrowserCmd; } int p4wAllCommands::IsFileBrowser( AllCommands cmd ) { int isFileBrowserCmd = 0; // // Is cmd a file browser command? Return 1 only if this is certain switch( cmd ) { case AC_PRINT: case AC_DIFF2: case AC_DIFF21: case AC_DIFF22: case AC_DIFF2FILES: case AC_HELP: case AC_BROWSEFILE: case AC_SYNCFILE: case AC_SYNCFILEFRM: case AC_SUBMITFILEFRM: case AC_EDITFILE: case AC_EDITFILEFRM: case AC_ADDFILE: case AC_DELETEFILE: case AC_DELETEFILEFRM: case AC_FILETYPEFILEFRM: case AC_REMOVEFILEFRM: case AC_INTEGRATEFILEFRM: case AC_RESOLVEFILEFRM: case AC_LOCKFILE: case AC_LOCKFILEFRM: case AC_UNLOCKFILE: case AC_UNLOCKFILEFRM: case AC_REVERTUNCHANGEDFILEFRM: case AC_REVERTFILE: case AC_REVERTFILEFRM: case AC_FILETEXTDEPOT: case AC_FILETEXTLOCAL: case AC_EDITTEXTLOCAL: case AC_EDITTEXTLOCALPROCESSOR: case AC_UPLOADTOLOCAL: case AC_UPLOADTOLOCALPROCESSOR: case AC_DOWNLOADTOLOCAL: case AC_MIMECONTENT: case AC_TEXTCONTENT: case AC_DIFFWVC: case AC_DIFFCVH: case AC_DIFFWVH: case AC_DIFFRVW: case AC_SUBMITTEDCHANGELISTSFILE: case AC_LAUNCHEDITOR: case AC_ADDFILEFRM: case AC_FILESTATE: case AC_GENERALANNOTATE: case AC_ANNOTATE: case AC_FULLANNOTATE: case AC_CHGLISTANNOTATE: case AC_CHGLISTFULLANNOTATE: case AC_GETTHUMBNAIL: case AC_ECHOURLAsDATA: case AC_WORKSPACEFILE: ++isFileBrowserCmd; break; default: break; } return isFileBrowserCmd; } int p4wAllCommands::NodeNotFile( AllCommands ac ) { // // Return 1 if the node portion of the path part of an url // is not expected to be a file switch( ac ) { case AC_DESCRIBE: case AC_DESCRIBEDEAFULT: case AC_ADDFIX: case AC_ADDFIXPROCESSOR: case AC_CHANGEEDIT: case AC_CHANGEPENDINGEDIT: case AC_BRANCHVIEW: case AC_CLIENTVIEW: case AC_LABELVIEW: case AC_USERVIEW: case AC_RSSUSER: case AC_RSSJOBVIEW: case AC_ICON: case AC_HELP: case AC_SUBMIT: case AC_EDITCHANGE: case AC_EDITCLIENT: case AC_EDITUSER: case AC_CLIENTSWITCH: case AC_EDITJOB: case AC_JOBVIEW: case AC_DELETELABEL: case AC_REPLACELABEL: case AC_CREATELABEL: case AC_CREATELABELTMP: case AC_EDITLABEL: case AC_LABELFILES: case AC_LABELFILESTEXT: case AC_EDITBRANCH: case AC_DELETEBRANCH: case AC_CREATEBRANCH: case AC_BRANCHDIFF: case AC_CREATEJOB: case AC_DELETEJOB: case AC_JOBSPEC: case AC_JOBFIELDS: case AC_FIXESCHANGE: case AC_FIXESJOB: case AC_DELETEJOBCONFIRM: case AC_DELETELABELCONFIRM: case AC_DELETEBRANCHCONFIRM: case AC_DELETECONFPROC: case AC_REVERTCONFIRM: case AC_SHOWHIDECOLUMNS: case AC_CHANGECMD: case AC_CHANGEORSUBMITCMD: case AC_CLIENTCMD: case AC_USERCMD: case AC_JOBCMD: case AC_LABELCMD: case AC_BRANCHCMD: case AC_LABSYNCPROCESSOR: case AC_P4CMD: case AC_P4CMDTAGGED: case AC_P4CMDXML: case AC_P4CMDPANE: case AC_P4CMDPROCESSOR: return 1; break; default: return 0; break; } return 0; } int p4wAllCommands::ShowRecentActivity( AllCommands ac ) { // // Confirmation pages and intermediate pages don't // display recent activity. switch( ac ) { case AC_SUBMITFRM: case AC_FILESMATCHINGFRM: case AC_DELETEJOBCONFIRM: case AC_DELETEBRANCHCONFIRM: case AC_DELETELABELCONFIRM: case AC_REVERTCONFIRM: case AC_SHOWHIDECOLUMNS: case AC_SYNCPROCESSOR: case AC_EDITPROCESSOR: case AC_DELETEPROCESSOR: case AC_INTEGPROCESSOR: case AC_FTYPEPROCESSOR: case AC_ADDPROCESSOR: case AC_SYNCREV: case AC_SYNCCMD: case AC_EDITFILE: case AC_SYNCFILE: case AC_DELETEFILE: case AC_REVERTFILE: case AC_REVERTCMD: case AC_REVERTUNCHANGEDFILEFRM: return 0; // neither recent activity nor raw commands button case AC_HELP: case AC_ABOUT: return 2; // no recent activity button } return 1; // both buttons OK } int p4wAllCommands::AllowedInStandardMode( char *cmd ) { // // Return 0 if this command is not allowed to be run // from P4Web. switch( *cmd ) { case 'a': if( !strcmp( cmd, "admin" ) ) return 0; break; case 'c': if( !strncmp( cmd, "counter", 7 ) ) // counter or counters return 0; break; case 'd': if( !strcmp( cmd, "depots" ) ) return 0; break; case 'f': if( !strcmp( cmd, "flush" ) ) return 0; break; case 'g': if( !strncmp( cmd, "group", 5 ) ) // group or groups return !strcmp( cmd, "groups" ); break; case 'j': if( !strcmp( cmd, "jobspec" ) ) return 0; break; case 'l': if( !strcmp( cmd, "logger" ) ) return 0; break; case 'm': if( !strcmp( cmd, "monitor" ) ) return 0; break; case 'o': if( !strcmp( cmd, "obliterate" ) ) return 0; break; case 'p': if( !strcmp( cmd, "passwd" ) ) return 0; if( !strcmp( cmd, "protect" ) ) return 0; break; case 'r': if( !strncmp( cmd, "review", 6 ) ) // review or reviews return !strcmp( cmd, "reviews" ); break; case 's': if( !strcmp( cmd, "set" ) ) return 0; break; case 't': if( !strcmp( cmd, "tickets" ) ) return 0; if( !strcmp( cmd, "triggers" ) ) return 0; if( !strcmp( cmd, "typemap" ) ) return 0; break; case 'v': if( !strcmp( cmd, "verify" ) ) return 0; break; default: break; } return 1; } TabType p4wAllCommands::GetTab( AllCommands ac ) { // // Returns the current tab value based on the current // ac code switch( ac ) { case AC_CHANGEORSUBMITCMD: case AC_CHANGEEDIT: case AC_CHANGEPENDINGEDIT: case AC_CHANGES: case AC_SUBMIT: case AC_SUBMITFRM: case AC_SUBMITFILEFRM: case AC_PENDINGCHANGELISTS: case AC_FIXPENDING: return TT_PENDING; case AC_CHANGECMD: case AC_DESCRIBE: case AC_ADDFIX: case AC_ADDFIXPROCESSOR: case AC_SUBMITTEDCHANGELISTS: case AC_SUBMITTEDCHANGELISTSFILE: case AC_CHANGESPROCESSOR: case AC_SYNCCHANGERNG: case AC_FIXESCHANGE: case AC_SYNCCHANGE: case AC_FIXSUBMITTED: return TT_SUBMITTED; case AC_BRANCHVIEW: case AC_BRANCHES: case AC_EDITBRANCH: case AC_DELETEBRANCH: case AC_CREATEBRANCH: case AC_INTEGRATEBRANCH: case AC_BRANCHCMD: case AC_BRANCHDIFF: case AC_DELETEBRANCHCONFIRM: case AC_BRANCHESPROCESSOR: return TT_BRANCH; case AC_LABELVIEW: case AC_LABELS: case AC_DELETELABEL: case AC_REPLACELABEL: case AC_SYNCLABEL: case AC_CREATELABEL: case AC_CREATELABELTMP: case AC_EDITLABEL: case AC_LABELFILES: case AC_LABELFILESTEXT: case AC_LABELCMD: case AC_LABSYNCPROCESSOR: case AC_LABELSPATH: case AC_DELETELABELCONFIRM: case AC_LABELSPROCESSOR: return TT_LABEL; case AC_CLIENTCMD: case AC_CLIENTVIEW: case AC_EDITCLIENT: case AC_EDITNEWCLIENT: case AC_CLIENTS: case AC_CLIENTSWITCH: case AC_CLIENTSWITCHRES: case AC_CLIENTSPROCESSOR: case AC_MULTIUSER: case AC_MULTIUSERPROCESSOR: return TT_CLIENT; case AC_USERCMD: case AC_USERVIEW: case AC_EDITUSER: case AC_USERS: case AC_USERSPROCESSOR: return TT_USER; case AC_JOBS: case AC_SHOWHIDEJOBCOLS: case AC_EDITJOB: case AC_JOBSPROCESSOR: case AC_JOBCMD: case AC_JOBVIEW: case AC_CREATEJOB: case AC_DELETEJOB: case AC_JOBFIELDS: case AC_JOBSPEC: case AC_DELETEJOBCONFIRM: case AC_FIXESJOB: return TT_JOB; case AC_SERVERINFO: // XXX ????Is this the right tab? case AC_CONFIGURATION: case AC_CONFIGPROCESSOR: return TT_SETTINGS; case AC_P4CMDPANE: return TT_P4CMD; case AC_NONE: case AC_PATHBROWSER: case AC_BROWSEFILE: case AC_MIMECONTENT: case AC_SYNCFILE: case AC_EDITFILE: case AC_ADDFILE: case AC_DELETEFILE: case AC_LOCKFILE: case AC_UNLOCKFILE: case AC_REVERTFILE: case AC_REVERTCONFIRM: case AC_FILESMATCHING: case AC_SYNCFRM: case AC_EDITFRM: case AC_ADDFRM: case AC_DELETEFRM: case AC_FILETYPEFRM: case AC_REMOVEFRM: case AC_INTEGRATEFRM: case AC_RESOLVEFRM: case AC_LOCKFRM: case AC_UNLOCKFRM: case AC_REVERTFRM: case AC_SYNCFILEFRM: case AC_EDITFILEFRM: case AC_DELETEFILEFRM: case AC_FILETYPEFILEFRM: case AC_REMOVEFILEFRM: case AC_INTEGRATEFILEFRM: case AC_RESOLVEFILEFRM: case AC_LOCKFILEFRM: case AC_UNLOCKFILEFRM: case AC_REVERTUNCHANGEDFILEFRM: case AC_REVERTFILEFRM: case AC_UNSYNCED: case AC_UNRESOLVED: case AC_MISSING: case AC_OPENEDUNCHANGED: case AC_FILESMATCHINGFRM: case AC_OPENEDFILESALL: case AC_PENDINGINTEGS: case AC_FILETEXTDEPOT: case AC_FILETEXTLOCAL: case AC_EDITTEXTLOCAL: case AC_EDITTEXTLOCALPROCESSOR: case AC_UPLOADTOLOCAL: case AC_UPLOADTOLOCALPROCESSOR: case AC_DOWNLOADTOLOCAL: case AC_RESOLVEIAPROCESSOR: case AC_DIFFWVC: case AC_DIFFCVH: case AC_DIFFWVH: case AC_DIFFRVW: case AC_LAUNCHEDITOR: case AC_DEPOT: case AC_CLIENT: case AC_WORKSPACE: case AC_SYNCCMD: case AC_SYNCREV: case AC_LOCKCMD: case AC_UNLOCKCMD: case AC_REVERTCMD: case AC_PRINT: case AC_DIFF2: case AC_DIFF21: case AC_DIFF22: case AC_DIFF2FILES: case AC_DIFF2FILESPROCESSOR: case AC_DIFF2DIRS: case AC_DIFF2DIRSOUTPUT: case AC_ADDPROCESSOR: case AC_SYNCPROCESSOR: case AC_EDITPROCESSOR: case AC_DELETEPROCESSOR: case AC_RESOLVEPROCESSOR: case AC_REVERTPROCESSOR: case AC_LOCKPROCESSOR: case AC_UNLOCKPROCESSOR: case AC_MATCHPROCESSOR: case AC_INTEGPROCESSOR: case AC_FTYPEPROCESSOR: case AC_ADDSELECTPROCESSOR: case AC_FILESTATE: case AC_ADDFILEFRM: case AC_TEXTCONTENT: case AC_GENERALANNOTATE: case AC_ANNOTATE: case AC_FULLANNOTATE: case AC_CHGLISTANNOTATE: case AC_CHGLISTFULLANNOTATE: case AC_P4CMD: case AC_P4CMDTAGGED: case AC_P4CMDXML: case AC_WORKSPACEFILE: case AC_WORKSPACEFILEPATH: return TT_FILE; case AC_SHOWHIDECOLUMNS: case AC_CANCELCMD: case AC_LOGOUT: case AC_LOGOUT2: case AC_ABOUT: case AC_HELP: default: return TT_NOTAB; } return TT_NOTAB; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Main/p4wAllCommands.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |