Opened 15 years ago

Last modified 15 years ago

#1076 closed defect

Move or rename resource should avoid breaking links — at Version 5

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.

Change History (8)

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)
Note: See TracTickets for help on using tickets.