Class DocumentReference
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable,HasProjectId,HasRelativePath,ModelEntityReference,ModelObjectReference,ReferenceWithUpdatable<UpdatableDocument>,HasNameAndSpaceReference,HasPortalLink,Serializable
- Since:
- 3.9.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentReference(SpaceReference spaceReference, String name) DocumentReference(SpaceReference spaceReference, String name, String requestedRevision, String actualRevision) -
Method Summary
Modifier and TypeMethodDescriptioncreateLink(SharedContext context) Creates portal link.booleanstatic DocumentReferencefromModuleLocation(String projectId, String moduleLocation, String requestedRevision) static DocumentReferenceThe path is trimmed before parsing, so it can contain spaces at the start or end.
The path can be obtained usingtoPath(), but this method works in more user friendly way by filling some missing parts with defaults.static DocumentReferencefromRelativePath(String baseProjectId, String path) The path is trimmed before parsing, so it can contain spaces at the start or end.
The path can be obtained usingtoRelativePath(String), but this method works in more user friendly way by filling some missing parts with defaults.static DocumentReferencefromSpaceRelativePath(SpaceReference baseSpace, String path) The path is trimmed before parsing, so it can contain spaces at the start or end.
The path can be obtained usingtoSpaceRelativePath(SpaceReference), but this method works in more user friendly way by filling some missing parts with defaults.Deprecated.getFromRevision(ReadOnlyTransaction transaction, String requestedRevision) Returns the object from the specified revision.getWithRevision(String requestedRevision) Deprecated.inthashCode()name()It is shortcut forModelObjectReference.scope().Scope.projectId()scope()toPath()Returns type specific unique identification path of the object, for example for Work Items in project it is 'projectId/workItemId', theModelObjectReference.requestedRevision()andModelObjectReference.actualRevision()are ignored.toRelativePath(String baseProjectId) Returns unique relative path identifying the referenced document relative to the given project or global scope, theModelObjectReferenceBase.requestedRevision()andModelObjectReferenceBase.actualRevision()are ignored.
ThefromRelativePath(String, String)can be used to get the reference from the returned path.toSpaceRelativePath(SpaceReference baseSpace) Returns unique string identifying the referenced document relative to the given space, theModelObjectReferenceBase.requestedRevision()andModelObjectReferenceBase.actualRevision()are ignored.
ThefromSpaceRelativePath(SpaceReference, String)can be used to get the reference from the returned path.Methods inherited from class com.polarion.alm.shared.api.model.ModelObjectReferenceWithUpdatable
getUpdatableMethods inherited from class com.polarion.alm.shared.api.model.ModelObjectReferenceBase
actualRevision, get, getCurrent, getOriginal, requestedRevision, toString
-
Constructor Details
-
Method Details
-
fromPath
The path is trimmed before parsing, so it can contain spaces at the start or end.
The path can be obtained usingtoPath(), but this method works in more user friendly way by filling some missing parts with defaults. -
fromRelativePath
@NotNull public static DocumentReference fromRelativePath(@Nullable String baseProjectId, @NotNull String path) The path is trimmed before parsing, so it can contain spaces at the start or end.
The path can be obtained usingtoRelativePath(String), but this method works in more user friendly way by filling some missing parts with defaults. The baseProjectId used in both calls must be the same.- Parameters:
baseProjectId- - null means global scope- Since:
- 3.9.1
-
fromModuleLocation
public static DocumentReference fromModuleLocation(@NotNull String projectId, @NotNull String moduleLocation, @Nullable String requestedRevision) -
getCurrent
Deprecated.Description copied from interface:ModelObjectReferenceReturns the reference to current revision of the object, in other words reference without requested revision and actual revision. It is a shortcut for callingModelObjectReference.getWithRevision(String)with null.Note: The returned reference retains the current path (space and name) of the object. It does not correctly support objects (e.g. Documents) that were renamed or moved, because the path in the reference reflects the object's current location, not its location at any given revision. As a result, using this reference may fail to resolve the object if it has been renamed or moved.
- Specified by:
getCurrentin interfaceModelObjectReference- Overrides:
getCurrentin classModelObjectReferenceBase<Document,DocumentReference>
-
getWithRevision
Deprecated.Description copied from interface:ModelObjectReferenceReturns the reference to the same object, but with differentModelObjectReference.requestedRevision(), theModelObjectReference.actualRevision()of the returned reference is null.Note: The returned reference retains the current path (space and name) of the object. It does not correctly support objects (e.g. Documents) that were renamed or moved, because the path in the reference reflects the object's current location, not its location at the specified revision. As a result, using this reference may fail to resolve the object if it has been renamed or moved.
- Specified by:
getWithRevisionin interfaceModelObjectReference- Specified by:
getWithRevisionin classModelObjectReferenceBase<Document,DocumentReference> - Parameters:
requestedRevision- the revision to be set in the returned reference, or null for the current revision.- See Also:
-
spaceReference
- Specified by:
spaceReferencein interfaceHasNameAndSpaceReference
-
projectId
Description copied from interface:ModelObjectReferenceIt is shortcut forModelObjectReference.scope().Scope.projectId()- Specified by:
projectIdin interfaceHasProjectId- Specified by:
projectIdin interfaceModelObjectReference- Overrides:
projectIdin classModelObjectReferenceBase<Document,DocumentReference>
-
name
- Specified by:
namein interfaceHasNameAndSpaceReference
-
hashCode
public int hashCode()- Overrides:
hashCodein classModelObjectReferenceBase<Document,DocumentReference>
-
equals
- Overrides:
equalsin classModelObjectReferenceBase<Document,DocumentReference>
-
toPath
Description copied from interface:ModelObjectReferenceReturns type specific unique identification path of the object, for example for Work Items in project it is 'projectId/workItemId', theModelObjectReference.requestedRevision()andModelObjectReference.actualRevision()are ignored.- Specified by:
toPathin interfaceModelEntityReference- Specified by:
toPathin interfaceModelObjectReference- See Also:
-
toRelativePath
Returns unique relative path identifying the referenced document relative to the given project or global scope, theModelObjectReferenceBase.requestedRevision()andModelObjectReferenceBase.actualRevision()are ignored.
ThefromRelativePath(String, String)can be used to get the reference from the returned path. The baseProjectId used in both calls must be the same.- Specified by:
toRelativePathin interfaceHasRelativePath- Parameters:
baseProjectId- - null means global scope- Since:
- 3.9.1
-
scope
- Specified by:
scopein interfaceModelObjectReference
-
prototype
- Specified by:
prototypein interfaceModelObjectReference
-
ModelObjectReference.getCurrent()