Opened 15 years ago
Closed 15 years ago
#1076 closed defect (fixed)
Move or rename resource should avoid breaking links
Reported by: | christinebao | Owned by: | brucedechant |
---|---|---|---|
Priority: | medium | Milestone: | 2.2 |
Component: | Resource Service | Version: | 2.0.2 |
Severity: | major | Keywords: | |
Cc: | External ID: |
Description (last modified by )
Currently if you move or rename a resource, the other resources referencing to it are not updated and can't find the new location of the resource, thus they will not work anymore. For example, if you move or rename a FeatureSource, the LayerDefinitions which reference to this FeatureSource are not updated to use the new FeatureSource URL, and thus fail to work properly. RFC 74 overloads the ResourceService API MoveResource by adding a new parameter "bool cascade" to indicate whether to update the referencing resources or not. The old API will continue to exist along with the new API to keep backwards compatibility.
Please refer to RFC http://trac.osgeo.org/mapguide/wiki/MapGuideRfc74 for detail.
Attachments (3)
Change History (10)
by , 15 years ago
Attachment: | AddMoveResourceAPI.patch added |
---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
A minor performance improvement:
Change /ApplicationRepositoryManager.cpp line 491 to:
Ptr<MgStringCollection> referencingIds = NULL;
The referencingIds is assigned in line 495, and if not cascading, it is not accessed.
To clarify this, line 518 could be changed to: if(cascade && referencingIds != NULL && referencingIds->GetCount() != 0)
by , 15 years ago
Attachment: | AddMoveResourceAPI.2.patch added |
---|
comment:3 by , 15 years ago
Thanks for the comment. https://trac.osgeo.org/mapguide/attachment/ticket/1076/AddMoveResourceAPI.2.patch is updated.
comment:4 by , 15 years ago
Owner: | changed from | to
---|
by , 15 years ago
Attachment: | MapAgentTest.patch added |
---|
comment:5 by , 15 years ago
Description: | modified (diff) |
---|
comment:6 by , 15 years ago
I had to change the AddMoveResourceAPI.2.patch file because you hard coded some of your development paths.
ie: (The following I did not update and left the original source as is)
ResourcesPath = E:\Workspace\MgDev\OS\Web\src\mapagent\Resources TempPath = c:\windows\Temp
Attach patch https://trac.osgeo.org/mapguide/attachment/ticket/1076/AddMoveResourceAPI.patch.
This patch adds a new API: void MoveResource(MgResourceIdentifier* sourceResource, MgResourceIdentifier* destResource, bool overwrite, bool cascade). The last parameter “cascade” indicate whether the referencing resources should be updated or not.