Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Loading NodeSet.xml from String or DOM
October 16, 2014
13:26, EET
Avatar
hbrackel
Member
Members
Forum Posts: 74
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

I have the content of a NodeSet.xml model available in memory as a String and would like to load the model into the addressSpace at runtime. I can’t figure out a way though how to call getAddressSpace().load(URI), or in other words, how to obtain a URI from an in memory String (or DOM) without going through a temporary file.

I’m wondering whether you are considering to overload the NodeManagerTable.load() method with a version accepting a String? (ultimately an overloaded ModelParserBase.parseFile())

Cheers,
Hans-Uwe

October 16, 2014
13:54, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 801
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, you are correct, there should be an overload that takes an InputStream, for example. We will add such methods in near future.

October 16, 2014
16:01, EET
Avatar
hbrackel
Member
Members
Forum Posts: 74
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

I created an overloaded ModelParseBase#parseFile(InputStream xmlStream) and it seems to work. But I noticed 2 other little things:
1) The SAX inputSource should perhaps be created on an an InputStream (also in the original method) rather than on an InputStreamReader (I got an exception otherwise as described here: http://stackoverflow.com/quest…..-in-prolog )
2) the ModelParser also tries to parse the extensions elements and throws exceptions, because it is missing enums for any elements underneath extensions. The model is still been loaded but it is not nice for the users if they see the stack traces in the console output. Even if the element shall be parsed for some reason, maybe the stack trace could be suppressed (the logger.error message would suffice)

Thanks,
Hans-Uwe

October 17, 2014
12:36, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 801
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

1) I added the overloads – and sent you an update by email
2) The extensions (generated by UaModeler) should be completely ignored by the parser and I don’t see any notifications for them. What do you see and what does your extensions element look like?

October 20, 2014
9:27, EET
Avatar
JamesXiao
New Member
Members
Forum Posts: 1
Member Since:
October 20, 2014
sp_UserOfflineSmall Offline

Hi Both
I’ve a related question but in the other direction:
Is it possible for me to save the current addressSpace to a noteset.xml?

Hopefully there is some API to do so from prosys, if not, any hint about how do fullfill that by myself in a quicker way?

Many thanks in advance

October 20, 2014
9:53, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 801
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Unfortunately, there is no means to generate the NodeSet from the address space at the moment. That is on the TODO list, but there is no exact decision on which version it will be available.

Regarding the above issue wit the Extensions causing problems. it has been fixed now internally.

October 24, 2014
16:28, EET
Avatar
hbrackel
Member
Members
Forum Posts: 74
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Hello James,

I’m using JAXB generated Java classes (plus manual changes) to serialize the nodes of one or more node managers. I find this more convenient than manipulating XML directly.

Cheers, Hans-Uwe

September 21, 2017
15:01, EET
Avatar
ibrahim
Member
Members
Forum Posts: 65
Member Since:
August 20, 2014
sp_UserOfflineSmall Offline

Hi Jouni,
i was looking for a way to generate nodeset.xml from adress space like james with the sdk. Now it’s 3 years ago since this question was asked. Is there now a possibbility to do this?

Ibrahim

September 21, 2017
18:17, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 801
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Ibrahim,

Indeed it’s been pending for a long while at low priority. But we are finally working on it and the functionality is coming to a future release. Unfortunately, though, I cannot yet give any more exact information on when and how exactly it will be available.

BR, Jouni

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 78

Currently Online:
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

pramanj: 86

hbrackel: 74

ibrahim: 65

kapsl: 57

gjevremovic: 49

TimK: 41

fred: 36

Fransua33: 35

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 652

Moderators: 10

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 685

Posts: 2953

Newest Members:

Ravish Roshan, Max Braun, Predixer, LorraineXu, FF, Jonas, HA198273465, RaeHoffman, susandaigle23, m.scaglioni

Moderators: Jouni Aro: 801, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 230, Heikki Tahvanainen: 270, Jukka Asikainen: 1

Administrators: admin: 0