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 brucedechant)

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)

AddMoveResourceAPI.patch (22.8 KB ) - added by christinebao 15 years ago.
AddMoveResourceAPI.2.patch (24.1 KB ) - added by christinebao 15 years ago.
MapAgentTest.patch (3.7 KB ) - added by christinebao 15 years ago.

Download all attachments as: .zip

Change History (10)

by christinebao, 15 years ago

Attachment: AddMoveResourceAPI.patch added

comment:1 by christinebao, 15 years ago

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.

comment:2 by ksgeograf, 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 christinebao, 15 years ago

Attachment: AddMoveResourceAPI.2.patch added

comment:4 by tomfukushima, 15 years ago

Owner: changed from Tom Fukushima to brucedechant

by christinebao, 15 years ago

Attachment: MapAgentTest.patch added

comment:5 by brucedechant, 15 years ago

Description: modified (diff)

comment:6 by brucedechant, 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

comment:7 by brucedechant, 15 years ago

Resolution: fixed
Status: newclosed

Submitted to trunk r4196

Note: See TracTickets for help on using tickets.