Package com.nomagic.magicdraw.core
Class ProjectUtilities
java.lang.Object
com.nomagic.magicdraw.core.ProjectUtilities
Project decomposition related utility class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty for XmiExporterDescriptionprotected static Map<com.nomagic.ci.persistence.IProject,XmiExporterDescription> protected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddToCache(com.nomagic.ci.persistence.IProject project, XmiExporterDescription xmiExporterDescription) protected static voidaddToCacheLoaded(com.nomagic.ci.persistence.IProject project, XmiExporterDescription xmiExporterDescription) Adds to cache just loaded modules/projectsstatic intcompareVersionNumber(String versionNumber1, String versionNumber2) Compare given version numbers.static intcompareVersions(com.nomagic.ci.persistence.versioning.IVersionDescriptor versionDescriptor1, com.nomagic.ci.persistence.versioning.IVersionDescriptor versionDescriptor2) Compare given versions descriptors.static com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfigurationcreateDefaultProjectAttachmentConfiguration(org.eclipse.emf.common.util.URI uri) Create default project attachment configuration with default settings.static StringdecodeTeamworkRemoteId(String remoteId) Decodes Teamwork remote IDstatic StringencodeTeamworkRemoteId(String remoteId) Encodes Teamwork remote IDstatic com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByID(com.nomagic.ci.persistence.IProject project, String moduleID, boolean recursively) Find attached project by given id in a given projectstatic com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByID(Project project, String moduleID) Find attached project by given id in a given project.static com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByID(Project project, String moduleID, boolean recursively) Find attached project by given id in a given projectstatic com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByName(com.nomagic.ci.persistence.IProject project, String name) Find attached project by given name in a given projectstatic com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByName(Project project, String name) Find attached project by given name in a given project.static com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByName(Project project, String name, boolean recursively) Find attached project by given name in a given projectstatic com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByNames(Collection<String> names, Collection<com.nomagic.ci.persistence.IAttachedProject> modules) static com.nomagic.ci.persistence.IAttachedProjectfindAttachedProjectByProjectID(com.nomagic.ci.persistence.IProject project, String projectID, boolean recursively) Find attached project by given project idstatic com.nomagic.ci.persistence.IProjectfindProjectByResourceID(com.nomagic.ci.persistence.IPrimaryProject primaryProject, String resourceId) Search for project with given resource IDstatic Collection<com.nomagic.ci.persistence.IAttachedProject>getAllAttachedProjects(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly or indirectly to a given project.static Collection<com.nomagic.ci.persistence.IAttachedProject>getAllAttachedProjects(Project project) Return all modules in a given projectstatic Collection<com.nomagic.ci.persistence.IAttachedProject>getAllAttachedProjects(Collection<com.nomagic.ci.persistence.IAttachedProject> projects) Returns projects those are attached directly or indirectly to a given project.static Collection<com.nomagic.ci.persistence.IProject>getAllAttachedProjectsIncludingPrimary(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly or indirectly to a given project including primary project.static Set<com.nomagic.ci.persistence.mounting.IMountPoint>getAllMountPoints(com.nomagic.ci.persistence.IPrimaryProject project) Deprecated.IMountPoint is not exposed into Open APIstatic Collection<com.nomagic.ci.persistence.IProject>getAllProjects(Project project) Return all modules and primary project in a given projectstatic com.nomagic.ci.persistence.IAttachedProjectgetAttachedProject(com.nomagic.ci.persistence.IProject project, org.eclipse.emf.common.util.URI uri) Look for direct or not direct attached project in a primary project of a given project.static com.nomagic.ci.persistence.IAttachedProjectgetAttachedProject(org.eclipse.emf.ecore.EObject element) Find attached project (module) for a given elementstatic Collection<com.nomagic.ci.persistence.IAttachedProject>getAttachedProjects(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly to a given project.static Collection<com.nomagic.ci.persistence.IProject>getAttachedProjectsIncludingPrimary(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly to a given project.Primary attached project can be included also.static com.nomagic.ci.persistence.IProjectgetAttachingProject(com.nomagic.ci.persistence.IProject project) Return first project where given project is attached.static Collection<com.nomagic.ci.persistence.IProject>getAttachingProjects(com.nomagic.ci.persistence.IProject project) Return all projects where given project is attached.static com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfigurationgetAttachment(com.nomagic.ci.persistence.IProject parent, com.nomagic.ci.persistence.IProject child) Return configuration which is used to attach one project to anotherstatic AutoLoadKindgetAutoLoadKind(com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration attachment) Deprecated.use public static AutoLoadKind getAutoLoadKind( AbstractProjectAttachmentConfiguration attachment )static AutoLoadKindgetAutoLoadKind(com.nomagic.ci.persistence.IProject owner, com.nomagic.ci.persistence.IProject project) Return load kind of given module in a given projectstatic AutoLoadKindgetAutoLoadKind(com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfiguration attachment) Return load kind of module from given attachmentstatic StringgetCompatibleVersion(com.nomagic.ci.persistence.IProject project) Get compatible version of the projectstatic ElementgetElementFor(BaseElement element) Return element for a given base element.static org.eclipse.emf.common.util.URIConvert java net URI to emf uristatic StringgetESIRemoteId(com.nomagic.ci.persistence.IProject project) Gets ESI remote ID for given projectstatic StringgetESIRemoteId(org.eclipse.emf.common.util.URI uri) Gets ESI remote IDstatic XmiExporterDescriptiongetExporterDescription(com.nomagic.ci.persistence.IProject project) Provide information about project version and required resources/plugins for that project.static StringgetInternalVersion(com.nomagic.ci.persistence.IProject project) Get internal version of projectgetModifiedElements(Project project) Get modified elements.static com.nomagic.ci.persistence.mounting.IMountPointgetMountPoint(Collection<com.nomagic.ci.persistence.mounting.IMountPoint> points, Package element) Deprecated.com.nomagic.ci.persistence.mounting.IMountPoint is not exposed into Open APIstatic Collection<com.nomagic.ci.persistence.mounting.IMountPoint>getMountPoints(com.nomagic.ci.persistence.IProject project) Gets all mount points in given project.static Set<com.nomagic.ci.persistence.mounting.IMountPoint>getMountPointsFor(com.nomagic.ci.persistence.IProject owner, com.nomagic.ci.persistence.IProject attachedProject) Gets mount points for given project, i.e.static com.nomagic.ci.persistence.IProjectgetOwner(com.nomagic.ci.persistence.IProject project) Deprecated.static Collection<com.nomagic.ci.persistence.IProject>getOwners(com.nomagic.ci.persistence.IProject project) Deprecated.static ProjectgetProject(com.nomagic.ci.persistence.IProject iProject) Returns MagicDraw project for primary or attached project.static com.nomagic.ci.persistence.IProjectgetProject(org.eclipse.emf.ecore.EObject object) Return project in which object resists.static com.nomagic.ci.persistence.IProjectgetProject(org.eclipse.emf.ecore.resource.Resource resource) Return project for a resource.static com.nomagic.ci.persistence.IProjectgetProjectFor(BaseElement element) Find IProject for a given elementstatic StringgetRemoteId(org.eclipse.emf.common.util.URI uri) Retrieves project remote id from given uri.static StringgetRemoteID(com.nomagic.ci.persistence.IProject project) Return remote id for a given projectstatic StringgetRemoteID(org.eclipse.emf.common.util.URI uri) Extract remote project id from a given uri.static StringgetResourceID(com.nomagic.ci.persistence.IProject project) Gets simplified resource id for given project.static StringGets simplified resource id for given project descriptor.static StringgetResourceID(org.eclipse.emf.common.util.URI uri) Gets simplified resource id for given project location URI.static StringgetSaveID(com.nomagic.ci.persistence.IProject project) Gets current save/commit id for given project.static Collection<Package>getSharedPackages(com.nomagic.ci.persistence.IProject project) Return shared packages of a given project.static Collection<Package>getSharedPackagesIncludingReshared(com.nomagic.ci.persistence.IProject project) Return shared packages of a given project.static Collection<Package>getSharedPackagesIncludingResharedRecursively(com.nomagic.ci.persistence.IProject project) Return shared packages of a given project.static com.nomagic.ci.persistence.sharing.ISharePointgetSharePoint(com.nomagic.ci.persistence.mounting.IMountPoint point) Deprecated.com.nomagic.ci.persistence.mounting.ISharePoint is not exposed into Open APIstatic URIgetURI(org.eclipse.emf.common.util.URI emfUFI) Convert EMF uri to java.net.URIstatic com.nomagic.ci.persistence.versioning.IVersionDescriptorgetVersion(com.nomagic.ci.persistence.IProject project) Return version of given project.static StringgetVisibleURI(URI uri) Creates uri that can be shown in UI componentsstatic StringgetVisibleURI(org.eclipse.emf.common.util.URI uri) Creates uri that can be shown in UI componentsstatic booleanisAttachedProjectIDRelevant(Project project, String moduleID, com.nomagic.ci.persistence.IProject attachedProject) Checks if moduleID relevant to attached projectstatic booleanisAttachedProjectRoot(Element element) Check if given element is a root of some module.static booleanisAttachedProjectRoot(Element element, com.nomagic.ci.persistence.IAttachedProject project) Check if given element is a root of given module.static booleanisElementInAttachedProject(Element element) Check if given element belongs to some modulestatic booleanisElementProxy(BaseElement element) Checks if given element is proxy or orphan proxy.static booleanChecks if givenURIis ESI projectURIstatic booleanisESIUri(org.eclipse.emf.common.util.URI uri) Checks if givenURIis ESI projectURIstatic booleanisFromEsiServer(com.nomagic.ci.persistence.IProject project) Check if given project is from ESI.static booleanisFromStandardProfile(Element element) Checks, if the given element is a part of the Standard Profilestatic booleanisFromStandardProfile(org.eclipse.emf.ecore.EObject element) Checks if element comes from standard profilestatic booleanCheck if given project is from teamwork server.static booleanisLoaded(com.nomagic.ci.persistence.IProject project) Checks if given project loaded.static booleanisLoadedOrLoading(com.nomagic.ci.persistence.IProject project) static booleanisLoadIndex(com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfiguration configuration) Check if to load index.static booleanisModule(com.nomagic.ci.persistence.DecompositionDescriptor r) Deprecated.DecompositionDescriptor is not exposed into Open APIprotected static booleanisModuleRoot(com.nomagic.ci.persistence.IAttachedProject iProject, Element element) static booleanisModuleUsageNew(com.nomagic.ci.persistence.IProject attachedProject) Check if attached project usage from primary project is new (not yet committed to server).static booleanisMountedPackage(Package pck) Check if given package is a mounted(or is a shared root from some module)static booleanisProjectNameValid(String projectName) Checks if given project name is valid.static booleanisRemote(com.nomagic.ci.persistence.IProject project) Check if given project is remote - from teamwork server or ESI.static booleanisSharedElement(com.nomagic.ci.persistence.IProject project, Element element) Check if given element belongs to some shared (or reshared) package in a given projectstatic booleanisStandardSystemProfile(com.nomagic.ci.persistence.DecompositionDescriptor project) Deprecated.DecompositionDescriptor is not exposed into Open APIstatic booleanisStandardSystemProfile(com.nomagic.ci.persistence.IProject project) Check if given project is a standard system profilestatic voidsetLoadIndex(com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfiguration configuration, boolean loadIndex) Set if to load index.static voidupdateConfigurationWithDefaultValues(com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration configuration) Updates attachment configuration with default valuesstatic intversionToInt(String version) Deprecated.static longversionToLong(String version) Utility method to convert string representation of version into longstatic StringversionToString(int version) Utility method to convert int representation of version into string
-
Field Details
-
mExporterDescriptions
protected static Map<com.nomagic.ci.persistence.IProject,XmiExporterDescription> mExporterDescriptions -
EXPORTER_DESCRIPTION
Property for XmiExporterDescription- See Also:
-
REMOTE_ID_ENCODING
- See Also:
-
-
Constructor Details
-
ProjectUtilities
public ProjectUtilities()
-
-
Method Details
-
createDefaultProjectAttachmentConfiguration
public static com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration createDefaultProjectAttachmentConfiguration(org.eclipse.emf.common.util.URI uri) Create default project attachment configuration with default settings.- Parameters:
uri- uri- Returns:
- attachment configuration
-
updateConfigurationWithDefaultValues
public static void updateConfigurationWithDefaultValues(com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration configuration) Updates attachment configuration with default values- Parameters:
configuration- the configuration to update
-
isLoadIndex
public static boolean isLoadIndex(com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfiguration configuration) Check if to load index.- Parameters:
configuration- attachment configuration.- Returns:
- true if option is set to load index.
-
setLoadIndex
public static void setLoadIndex(com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfiguration configuration, boolean loadIndex) Set if to load index.- Parameters:
configuration- attachment configuration.loadIndex- load index.
-
getAttachedProject
@CheckReturnValue @CheckForNull public static com.nomagic.ci.persistence.IAttachedProject getAttachedProject(@CheckForNull org.eclipse.emf.ecore.EObject element) Find attached project (module) for a given element- Parameters:
element- element for which attached project will be returned- Returns:
- project or null if element does not belong to any module
-
getProjectFor
@CheckForNull public static com.nomagic.ci.persistence.IProject getProjectFor(@CheckForNull BaseElement element) Find IProject for a given element- Parameters:
element- element for which attached project will be returned- Returns:
- project
-
findAttachedProjectByID
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByID(Project project, String moduleID, boolean recursively) Find attached project by given id in a given project- Parameters:
project- project to search inmoduleID- module idrecursively- search in primary project only or recursively in whole project- Returns:
- found module
-
isAttachedProjectIDRelevant
public static boolean isAttachedProjectIDRelevant(Project project, String moduleID, com.nomagic.ci.persistence.IProject attachedProject) Checks if moduleID relevant to attached project- Parameters:
project- projectmoduleID- expected module idattachedProject- module- Returns:
- true if moduleID relevant to attached project
-
findAttachedProjectByID
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByID(com.nomagic.ci.persistence.IProject project, String moduleID, boolean recursively) Find attached project by given id in a given project- Parameters:
project- project to search inmoduleID- module idrecursively- search in primary project only or recursively in whole project- Returns:
- found module
-
findAttachedProjectByProjectID
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByProjectID(com.nomagic.ci.persistence.IProject project, String projectID, boolean recursively) Find attached project by given project id- Parameters:
project- project to search inprojectID- module idrecursively- search in primary project only or recursively in whole project- Returns:
- found module
-
findProjectByResourceID
@CheckForNull public static com.nomagic.ci.persistence.IProject findProjectByResourceID(com.nomagic.ci.persistence.IPrimaryProject primaryProject, String resourceId) Search for project with given resource ID- Parameters:
primaryProject- scope of searchingresourceId- resource ID.- Returns:
- found project or null.
-
findAttachedProjectByName
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByName(Project project, String name, boolean recursively) Find attached project by given name in a given project- Parameters:
project- project to search inname- module namerecursively- search in primary project only or recursively in whole project- Returns:
- found module
-
findAttachedProjectByName
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByName(com.nomagic.ci.persistence.IProject project, String name) Find attached project by given name in a given project- Parameters:
project- project to search inname- module name- Returns:
- found module
-
findAttachedProjectByNames
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByNames(Collection<String> names, Collection<com.nomagic.ci.persistence.IAttachedProject> modules) -
findAttachedProjectByName
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByName(Project project, String name) Find attached project by given name in a given project. Does recursive search.- Parameters:
project- project to search inname- module name- Returns:
- found module
-
findAttachedProjectByID
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject findAttachedProjectByID(Project project, String moduleID) Find attached project by given id in a given project. Does recursive search.- Parameters:
project- project to search inmoduleID- module id- Returns:
- found module
-
isAttachedProjectRoot
Check if given element is a root of some module.- Parameters:
element- element- Returns:
- true if given element is root for module.
-
isAttachedProjectRoot
public static boolean isAttachedProjectRoot(@CheckForNull Element element, com.nomagic.ci.persistence.IAttachedProject project) Check if given element is a root of given module.- Parameters:
element- elementproject- module- Returns:
- true if given element is root for module
-
isElementInAttachedProject
Check if given element belongs to some module- Parameters:
element- element- Returns:
- true if element belongs to some module
-
getAllAttachedProjects
public static Collection<com.nomagic.ci.persistence.IAttachedProject> getAllAttachedProjects(Project project) Return all modules in a given project- Parameters:
project- project- Returns:
- all modules in the Project
-
getAllProjects
Return all modules and primary project in a given project- Parameters:
project- project- Returns:
- all modules in the Project, collection is not modifiable
-
getRemoteID
Extract remote project id from a given uri.- Parameters:
uri- uri- Returns:
- remote if or null
-
getRemoteID
Return remote id for a given project- Parameters:
project- project- Returns:
- remote id
-
versionToInt
Deprecated.Utility method to convert string representation of version into int- Parameters:
version- version- Returns:
- version as int
-
versionToLong
Utility method to convert string representation of version into long- Parameters:
version- version- Returns:
- version as long
-
versionToString
Utility method to convert int representation of version into string- Parameters:
version- version- Returns:
- version as string
-
getResourceID
Gets simplified resource id for given project. For remote project it returns project id, for local filename.- Parameters:
project- project descriptor- Returns:
- filename or project id.
-
getResourceID
Gets simplified resource id for given project descriptor. For remote project it returns project id, for local filename.- Parameters:
pd- project descriptor- Returns:
- filename or project id.
-
getResourceID
Gets simplified resource id for given project location URI. For remote project it returns project id, for local filename.- Parameters:
uri- project location.- Returns:
- filename or project id.
-
getAttachedProjects
public static Collection<com.nomagic.ci.persistence.IAttachedProject> getAttachedProjects(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly to a given project. Primary attached project is ignored.- Parameters:
project- project- Returns:
- collection of attached projects
-
getAllAttachedProjects
public static Collection<com.nomagic.ci.persistence.IAttachedProject> getAllAttachedProjects(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly or indirectly to a given project. Primary attached project is ignored.- Parameters:
project- project- Returns:
- collection of attached projects
-
getAllAttachedProjectsIncludingPrimary
public static Collection<com.nomagic.ci.persistence.IProject> getAllAttachedProjectsIncludingPrimary(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly or indirectly to a given project including primary project.- Parameters:
project- project- Returns:
- collection of attached projects
-
getAllAttachedProjects
public static Collection<com.nomagic.ci.persistence.IAttachedProject> getAllAttachedProjects(Collection<com.nomagic.ci.persistence.IAttachedProject> projects) Returns projects those are attached directly or indirectly to a given project. Primary attached project is ignored.- Parameters:
projects- project projects- Returns:
- collection of attached projects
-
getAttachedProjectsIncludingPrimary
public static Collection<com.nomagic.ci.persistence.IProject> getAttachedProjectsIncludingPrimary(com.nomagic.ci.persistence.IProject project) Returns projects those are attached directly to a given project.Primary attached project can be included also.- Parameters:
project- project- Returns:
- collection of attached projects
-
getAutoLoadKind
public static AutoLoadKind getAutoLoadKind(com.nomagic.ci.persistence.IProject owner, com.nomagic.ci.persistence.IProject project) Return load kind of given module in a given project- Parameters:
owner- projectproject- module- Returns:
- load kind
-
getAutoLoadKind
@Deprecated public static AutoLoadKind getAutoLoadKind(com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration attachment) Deprecated.use public static AutoLoadKind getAutoLoadKind( AbstractProjectAttachmentConfiguration attachment )Return load kind of module from given attachment- Parameters:
attachment- attachment- Returns:
- load kind
-
getAutoLoadKind
public static AutoLoadKind getAutoLoadKind(com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfiguration attachment) Return load kind of module from given attachment- Parameters:
attachment- attachment- Returns:
- load kind
-
getAttachingProject
@CheckForNull public static com.nomagic.ci.persistence.IProject getAttachingProject(com.nomagic.ci.persistence.IProject project) Return first project where given project is attached. Primary project has always priority.- Parameters:
project- given project- Returns:
- first project where given module is attached.
-
getAttachingProjects
public static Collection<com.nomagic.ci.persistence.IProject> getAttachingProjects(com.nomagic.ci.persistence.IProject project) Return all projects where given project is attached.- Parameters:
project- given project.- Returns:
- all projects where given module is attached.
-
getOwner
@CheckForNull @Deprecated public static com.nomagic.ci.persistence.IProject getOwner(com.nomagic.ci.persistence.IProject project) Deprecated. -
getOwners
@Deprecated public static Collection<com.nomagic.ci.persistence.IProject> getOwners(com.nomagic.ci.persistence.IProject project) Deprecated. -
getEMFURI
Convert java net URI to emf uri- Parameters:
uri- net uri- Returns:
- emf uri
-
getAttachment
@CheckForNull public static com.nomagic.ci.persistence.spi.decomposition.AbstractProjectAttachmentConfiguration getAttachment(com.nomagic.ci.persistence.IProject parent, com.nomagic.ci.persistence.IProject child) Return configuration which is used to attach one project to another- Parameters:
parent- project which uses another project (directly)child- used directly project- Returns:
- found
ProjectAttachmentConfiguration(for local and teamwork projects) orEsiProjectAttachmentConfiguration(for Teamwork Cloud projects) or null if such not found.
-
getURI
Convert EMF uri to java.net.URI- Parameters:
emfUFI- emf uri- Returns:
- java net uri
-
getVersion
@CheckForNull public static com.nomagic.ci.persistence.versioning.IVersionDescriptor getVersion(com.nomagic.ci.persistence.IProject project) Return version of given project.- Parameters:
project- project- Returns:
- version or null if project has no version
-
isFromTeamworkServer
public static boolean isFromTeamworkServer()Check if given project is from teamwork server.- Returns:
- true if project is from server
-
isFromEsiServer
public static boolean isFromEsiServer(@CheckForNull com.nomagic.ci.persistence.IProject project) Check if given project is from ESI.- Parameters:
project- project- Returns:
- true if project is from ESI
-
isRemote
public static boolean isRemote(@CheckForNull com.nomagic.ci.persistence.IProject project) Check if given project is remote - from teamwork server or ESI.- Parameters:
project- project- Returns:
- true if project is from server
-
isFromStandardProfile
Checks, if the given element is a part of the Standard Profile- Parameters:
element- element to check- Returns:
- true, if the given element is a part of the Standard Profile
-
getProject
@CheckForNull public static Project getProject(@CheckForNull com.nomagic.ci.persistence.IProject iProject) Returns MagicDraw project for primary or attached project.- Parameters:
iProject- primary or attached project- Returns:
Project
-
getMountPoint
@Deprecated @CheckForNull public static com.nomagic.ci.persistence.mounting.IMountPoint getMountPoint(Collection<com.nomagic.ci.persistence.mounting.IMountPoint> points, Package element) Deprecated.com.nomagic.ci.persistence.mounting.IMountPoint is not exposed into Open APIFind mount point in a given collection which mounts a given package.- Parameters:
points- mount pointselement- package- Returns:
- found mount point
-
encodeTeamworkRemoteId
Encodes Teamwork remote ID- Parameters:
remoteId- the raw (not encoded) remote ID- Returns:
- encoded ID
-
decodeTeamworkRemoteId
Decodes Teamwork remote ID- Parameters:
remoteId- the encoded remote ID- Returns:
- decoded (raw) remote ID
-
isESIUri
public static boolean isESIUri(org.eclipse.emf.common.util.URI uri) Checks if givenURIis ESI projectURI- Parameters:
uri- theURIto check- Returns:
trueif givenURIis ESI,falseotherwise
-
isESIUri
Checks if givenURIis ESI projectURI- Parameters:
uri- theURIto check- Returns:
trueif givenURIis ESI,falseotherwise
-
isElementProxy
Checks if given element is proxy or orphan proxy.- Parameters:
element- the element to check- Returns:
trueif given element is proxy or orphan proxy, otherwise -false
-
getESIRemoteId
Gets ESI remote ID- Parameters:
uri- theURIto get remote ID for- Returns:
- the remote ID
-
getESIRemoteId
Gets ESI remote ID for given project- Parameters:
project- the project- Returns:
- the remote ID
-
getRemoteId
@CheckReturnValue @CheckForNull public static String getRemoteId(org.eclipse.emf.common.util.URI uri) Retrieves project remote id from given uri.- Parameters:
uri- remote project uri to check.- Returns:
- remote project id from project uri.
-
getMountPoints
public static Collection<com.nomagic.ci.persistence.mounting.IMountPoint> getMountPoints(com.nomagic.ci.persistence.IProject project) Gets all mount points in given project. Returns empty set if there are no mount points- Parameters:
project- project- Returns:
- non-
nullset of allmount points
-
getMountPointsFor
public static Set<com.nomagic.ci.persistence.mounting.IMountPoint> getMountPointsFor(com.nomagic.ci.persistence.IProject owner, com.nomagic.ci.persistence.IProject attachedProject) Gets mount points for given project, i.e. returns all mount points that are mounted share points of given project. Returns empty set if there are no mount points to return.- Parameters:
owner- ownerattachedProject- the project to get mount points for- Returns:
- non-
nullset ofmount pointsfor specific project
-
getAllMountPoints
@Deprecated public static Set<com.nomagic.ci.persistence.mounting.IMountPoint> getAllMountPoints(com.nomagic.ci.persistence.IPrimaryProject project) Deprecated.IMountPoint is not exposed into Open APIReturn all mount points existing in given primary project (direct and not direct).- Parameters:
project- project- Returns:
- all mount points from given project and from all attached
-
getProject
@CheckForNull public static com.nomagic.ci.persistence.IProject getProject(@CheckForNull org.eclipse.emf.ecore.EObject object) Return project in which object resists.- Parameters:
object- object- Returns:
- found project or null
-
getProject
@CheckForNull public static com.nomagic.ci.persistence.IProject getProject(@CheckForNull org.eclipse.emf.ecore.resource.Resource resource) Return project for a resource.- Parameters:
resource- resource- Returns:
- found project or null
-
compareVersions
public static int compareVersions(@CheckForNull com.nomagic.ci.persistence.versioning.IVersionDescriptor versionDescriptor1, @CheckForNull com.nomagic.ci.persistence.versioning.IVersionDescriptor versionDescriptor2) Compare given versions descriptors. The null descriptor is larger than not null.- Parameters:
versionDescriptor1- first version descriptor (can be null).versionDescriptor2- second version descriptor (can be null).- Returns:
- the value 0 if versions are equal; a value less than 0 if first version is less then second; and a value greater than 0 if first version is greater then second.
-
compareVersionNumber
public static int compareVersionNumber(@CheckForNull String versionNumber1, @CheckForNull String versionNumber2) Compare given version numbers.- Parameters:
versionNumber1- first version number.versionNumber2- second version number.- Returns:
- the value 0 if versions are equal; a value less than 0 if first version is less then second; and a value greater than 0 if first version is greater then second.
-
getAttachedProject
@CheckForNull public static com.nomagic.ci.persistence.IAttachedProject getAttachedProject(com.nomagic.ci.persistence.IProject project, org.eclipse.emf.common.util.URI uri) Look for direct or not direct attached project in a primary project of a given project.- Parameters:
project- projecturi- uri- Returns:
- found module
-
getElementFor
Return element for a given base element. Returned element can be passed into other utility methods as EObject if needed.- Parameters:
element- base element- Returns:
- model element
-
isMountedPackage
Check if given package is a mounted(or is a shared root from some module)- Parameters:
pck- package- Returns:
- true if package is mounted
-
isModuleRoot
protected static boolean isModuleRoot(com.nomagic.ci.persistence.IAttachedProject iProject, Element element) -
getInternalVersion
Get internal version of project- Parameters:
project- project- Returns:
- version
-
getCompatibleVersion
@CheckForNull public static String getCompatibleVersion(com.nomagic.ci.persistence.IProject project) Get compatible version of the project- Parameters:
project- project- Returns:
- compatible version
-
isStandardSystemProfile
public static boolean isStandardSystemProfile(com.nomagic.ci.persistence.IProject project) Check if given project is a standard system profile- Parameters:
project- project- Returns:
- true if given project is a standard system profile
-
isStandardSystemProfile
@Deprecated public static boolean isStandardSystemProfile(com.nomagic.ci.persistence.DecompositionDescriptor project) Deprecated.DecompositionDescriptor is not exposed into Open APICheck if given project is a standard system profile- Parameters:
project- project- Returns:
- true if given project is a standard system profile
-
isLoaded
public static boolean isLoaded(com.nomagic.ci.persistence.IProject project) Checks if given project loaded.- Parameters:
project- project- Returns:
- true if given project is loaded
-
isLoadedOrLoading
public static boolean isLoadedOrLoading(com.nomagic.ci.persistence.IProject project) -
isModule
Deprecated.DecompositionDescriptor is not exposed into Open APIReturns true if given project has shared points.- Parameters:
r- project descriptor to evaluate- Returns:
- true if given project descriptor represents a module.
-
isFromStandardProfile
public static boolean isFromStandardProfile(@CheckForNull org.eclipse.emf.ecore.EObject element) Checks if element comes from standard profile- Parameters:
element- element to be checked- Returns:
- true if element comes from standard profile.
-
getModifiedElements
Get modified elements.- Parameters:
project- project to get elements of.- Returns:
- modified elements.
-
getExporterDescription
@CheckForNull public static XmiExporterDescription getExporterDescription(com.nomagic.ci.persistence.IProject project) Provide information about project version and required resources/plugins for that project.- Parameters:
project- project- Returns:
- description of project
-
getSaveID
Gets current save/commit id for given project. The value of the Save ID is a randomly generated unique UUID.- Parameters:
project- project- Returns:
- save id
-
addToCacheLoaded
protected static void addToCacheLoaded(com.nomagic.ci.persistence.IProject project, XmiExporterDescription xmiExporterDescription) Adds to cache just loaded modules/projects- Parameters:
project- project/modulexmiExporterDescription- project/module descriptor
-
addToCache
protected static void addToCache(com.nomagic.ci.persistence.IProject project, @CheckForNull XmiExporterDescription xmiExporterDescription) -
isModuleUsageNew
public static boolean isModuleUsageNew(com.nomagic.ci.persistence.IProject attachedProject) Check if attached project usage from primary project is new (not yet committed to server). This method does not support checking if the usage is new for Teamwork Server Project therefore it always returnsfalsein that case.- Parameters:
attachedProject- theIProjectof attached project- Returns:
trueif the provided project is attached project and it is a Teamwork Cloud Project and if the usage from primary project to attached project exists and if it is new (as defined above). Returnfalseotherwise
-
getVisibleURI
Creates uri that can be shown in UI components- Parameters:
uri- project location uri- Returns:
- visible uri
-
getVisibleURI
Creates uri that can be shown in UI components- Parameters:
uri- project location uri- Returns:
- visible uri
-
isProjectNameValid
Checks if given project name is valid. Checks if either the given project name is reserved or has invalid characters- Parameters:
projectName- the project name to check- Returns:
trueif project name is valid,falseotherwise
-