Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 90
Registered: ‎10-13-2015
Accepted Solution

Reload defined features after editing/creating of geometry in GMSC

[ Edited ]

Hi all,

 

I need to reload defined features after creating/editing of another feature. Example: I edit the feature simpleId 200 and after editing is done I need to reload features simpleId 300 and 400 (simpleId 200 is reloaded by default).

 

I have tried to write something like

  1. IG.captureGeometry().done(function () {IG.reloadFeatures(['200','300'])}) - without success
  2. Override IG.captureGeometry and put SC.reloadFeatures to the JS code, but I am not sure where to place the piece of code to reload feature and this does also not work - without any fault, but it doesn't reload features
			COPEdit.startEdit(result.layer, actions, IG.convertToArray(result.geometryid), null, IG.url('SmartClient/SaveGeometries').includeWorkflowContext({ includeId: true, postForm: false }).toString({ absolute: true }), true, copFeatureId)
				.done(function () {
					return SC.Map.closeWebBrowser();
				})
				.fail(function (message, exception) {
					SC.handleFail(new SC.Throwable(message));
				});
		})
		.done(function () {
			SC.reloadFeatures(['144','581']);
		})		
		.fail(function (jqXHR, textStatus, errorThrown) {
			var jsonResponse = {};
			try {
3. Place it somewhere in the JAVA code of Scripting object, but I was unable to find a place where to put the code.
 
Thanks for tips,
 
Jakub
Staff
Posts: 10
Registered: ‎02-10-2016

Re: Reload defined features after editing/creating of geometry in GMSC

Hi Jakub,

 

There is the possiblity to define feature dependencies, i.e. one feature depends on another and gets automaticly reloaded if the parent feature is reloaded. To define this you need to fill the column PARENT_ID in the table RPI_FEATURE. Simply set PARENT_ID of the features 300 and 400 to the ID of the feature 200. You can't to this with that GMSC administrator. You'll need to use plain SQL.

 

Best regards,

Gerd

Gerd Müller-Schramm
Developer
gerd.mueller-schramm@hexagongeospatial.com
Frequent Contributor
Posts: 90
Registered: ‎10-13-2015

Re: Reload defined features after editing/creating of geometry in GMSC

Hi Gerd,

 

thanks for your answer and sorry for the late reaction. I made a mistake in description ... your solution definitely works in the described case, but ...

 

I have few features (e.g. ID 500,600,700) and after editing of those features I need to refresh another sepcific feature (ID 1000). But in this case I would have to set more features to the PARENT_ID attribute to the row of feature ID 1000. 

 

With PARENT_ID attribute you are able to use it in case or relationship 1:N (one edited feature reloads more related-child features), but not in case N:1 (more edited features reload the same feature).

 

Don't you have another nice tip as the previous one for the case N:1? Smiley Happy

 

Thanks & regards,

Jakub

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: Reload defined features after editing/creating of geometry in GMSC

Hi Jakub,

 

probably not nice, but you can actually load the form again, reload the features and close the web browser in the custom script.

 

ciao,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Frequent Contributor
Posts: 90
Registered: ‎10-13-2015

Re: Reload defined features after editing/creating of geometry in GMSC

[ Edited ]

Hi Stefano, 

 

I have invested some time and modified the whole EditPlugin.class. I created the new custom class and overrided the endEdit() method in Java and created new editing scripting object. I don't want to publish the solution until I will discuss it with the development team. But actually it works. 

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: Reload defined features after editing/creating of geometry in GMSC

Hi Jakub,

 

that is definetely the best solution!

 

ciao,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Highlighted
Frequent Contributor
Posts: 90
Registered: ‎10-13-2015

Re: Reload defined features after editing/creating of geometry in GMSC

[ Edited ]

Hi all, 

 

I have finally found some time to prepare it for the community.

 

https://bitbucket.org/jhettler/hgdn_gmsc_java/overview

 

Hope this helps someone.

 

Cheers,

Jakub

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.