public interface ProjectManager
Modifier and Type | Field and Description |
---|---|
static long |
GLOBAL_PROJECT_ID
The project id of the global project.
|
Modifier and Type | Method and Description |
---|---|
long |
addProject(Project project,
boolean overwriteIfExists) |
void |
addProjectListener(ProjectListener listener) |
long |
copyProject(java.lang.String copyFrom,
java.lang.String copyTo,
boolean overwrite) |
java.util.List<ProjectChangeRecord> |
getAvailableRollbacks(long projectId)
Gets a list of edits for the given project that could be rolled back to.
|
Project |
getGlobalProject(int scope)
Returns the special "global" project, which is really just project with id=-1.
|
java.lang.Long |
getNewResourceId()
Provides the next project resource id, used when creating new resources to add to a project.
|
Project |
getProject(long id,
int applicationScope,
ProjectVersion version)
Returns a project for the given id loaded with all project resources that meet the given
application scope.
|
Project |
getProject(java.lang.String name,
int applicationScope,
ProjectVersion version)
Returns a project for the given name loaded with all project resources that meet the given
application scope.
|
Project |
getProjectDiff(long projectId,
java.util.UUID uuid,
long fromEditCount,
int scope,
ProjectVersion version)
Creates a diff of the given project from the given edit count to the current edit count.
|
Project |
getProjectDiff(long projectId,
java.util.UUID uuid,
long fromEditCount,
long toEditCount,
int scope,
ProjectVersion version)
Creates a diff of the given project between any two edits.
|
java.lang.Long |
getProjectId(java.lang.String name)
Returns the Id for the given project, or null if none found
|
java.lang.String |
getProjectName(long projectId,
ProjectVersion version)
Returns the project's name for the given id
|
java.util.List<ScriptExecutionReport> |
getProjectScriptExecutionReports(long projectId) |
ScriptManager |
getProjectScriptManager(long id)
Returns the script manager for the given project.
|
java.util.List<Project> |
getProjectsFull(ProjectVersion version)
Returns a list of all projects, fully loaded
|
java.util.List<Project> |
getProjectsLite(ProjectVersion version)
Returns a list of all projects, but without their resources
|
SQLTagsManager |
getProjectTagManager(long id,
ProjectVersion version)
Returns a SQLTagsManager for the project that will correctly delegate for the default SQLTags
provider
|
GlobalProps |
getProps(long projectId,
ProjectVersion version)
High-speed cached call to get the project's current GlobalProps object
|
java.util.List<java.lang.Long> |
getPublishedResourceIds(long projectId) |
java.lang.Long |
getResourceLastEditCount(long projectId,
long resourceId)
Returns the edit count of the project that the given resource was most recently edited in.
|
Project |
getRollbackDiff(Project project,
long editCount) |
java.util.List<Project> |
getUnlicensedProjects()
Returns a list of all projects that cannot be loaded due to licensing.
|
void |
invokeGWMessageHandler(java.lang.String projectName,
java.lang.String messageHandlerName,
org.python.core.PyDictionary messageParams)
Invokes the specified Gateway message handler on a project.
|
boolean |
isProjectEditable(long id)
Returns whether the current licensing allows the given project id to be edited.
|
boolean |
isResourceProtected(long resourceId) |
void |
lockProject(long projectId,
ProgressListener progress)
Locks the specified project using the installed Runtime Lock.
|
void |
publishProject(long projectId,
AuthenticatedUser user,
java.lang.String host,
java.lang.String commitMessage) |
void |
publishSelected(long projectId,
java.util.Collection<java.lang.Long> resources,
AuthenticatedUser user,
java.lang.String host,
java.lang.String commitMessage) |
void |
removeProjectListener(ProjectListener listener) |
java.lang.Long |
saveProject(Project diff,
AuthenticatedUser user,
java.lang.String host,
java.lang.String commitMessage,
boolean publish)
Saves the project diff to the internal database.
|
void |
unlockProject(long projectId,
ProgressListener progress)
Unlocks a runtime locked project.
|
static final long GLOBAL_PROJECT_ID
long addProject(Project project, boolean overwriteIfExists) throws java.lang.Exception
java.lang.Exception
java.util.List<Project> getProjectsLite(ProjectVersion version)
java.util.List<Project> getProjectsFull(ProjectVersion version)
java.util.List<Project> getUnlicensedProjects()
java.lang.Long getResourceLastEditCount(long projectId, long resourceId)
Project getProject(long id, int applicationScope, ProjectVersion version)
id
- applicationScope
- The ApplicationScope
mask that project resources must match.Project getProject(java.lang.String name, int applicationScope, ProjectVersion version)
name
- applicationScope
- The ApplicationScope
mask that project resources must match.Project getGlobalProject(int scope)
void addProjectListener(ProjectListener listener)
void removeProjectListener(ProjectListener listener)
boolean isProjectEditable(long id)
id
- ScriptManager getProjectScriptManager(long id)
SQLTagsManager getProjectTagManager(long id, ProjectVersion version)
GlobalProps getProps(long projectId, ProjectVersion version)
projectId
- java.lang.IllegalArgumentException
- if the project doesn't existjava.lang.String getProjectName(long projectId, ProjectVersion version)
java.lang.Long getProjectId(java.lang.String name)
void lockProject(long projectId, ProgressListener progress) throws java.lang.Exception
UnlicensedFeatureException
- if a Runtime Lock is not installed.java.lang.IllegalArgumentException
- if the specified project doesn't exist or is already locked.java.lang.Exception
void unlockProject(long projectId, ProgressListener progress) throws java.lang.Exception
projectId
- progress
- java.lang.Exception
Project getProjectDiff(long projectId, java.util.UUID uuid, long fromEditCount, int scope, ProjectVersion version) throws java.lang.Exception
java.lang.Exception
Project getProjectDiff(long projectId, java.util.UUID uuid, long fromEditCount, long toEditCount, int scope, ProjectVersion version) throws java.lang.Exception
java.lang.Exception
java.util.List<ProjectChangeRecord> getAvailableRollbacks(long projectId)
Project getRollbackDiff(Project project, long editCount) throws java.sql.SQLException
java.sql.SQLException
java.lang.Long saveProject(Project diff, AuthenticatedUser user, java.lang.String host, java.lang.String commitMessage, boolean publish) throws java.lang.Exception
diff
- user
- commitMessage
- An option commit message to record with this save.java.lang.Exception
long copyProject(java.lang.String copyFrom, java.lang.String copyTo, boolean overwrite) throws java.lang.Exception
java.lang.Exception
void publishProject(long projectId, AuthenticatedUser user, java.lang.String host, java.lang.String commitMessage) throws java.lang.Exception
java.lang.Exception
void publishSelected(long projectId, java.util.Collection<java.lang.Long> resources, AuthenticatedUser user, java.lang.String host, java.lang.String commitMessage) throws java.lang.Exception
java.lang.Exception
java.util.List<java.lang.Long> getPublishedResourceIds(long projectId) throws java.lang.Exception
java.lang.Exception
boolean isResourceProtected(long resourceId)
java.lang.Long getNewResourceId() throws java.lang.Exception
java.lang.Exception
java.util.List<ScriptExecutionReport> getProjectScriptExecutionReports(long projectId)
projectId
- The id of the Project
.ScriptExecutionReport
s for the project specified by projectId.void invokeGWMessageHandler(java.lang.String projectName, java.lang.String messageHandlerName, org.python.core.PyDictionary messageParams) throws MessageHandlerException
projectName
- The project name.messageHandlerName
- The name of the Gateway message handler in the Project.messageParams
- a PyDictionary that is passed to the message handler. See MessageDispatchManager
for details.MessageHandlerException
- if the message handler cannot be found in the project or some other problem
occurred.