Monday, October 26, 2015

Semantica Pro - remote-config (.xml) and Preferences (.conf)

Hey Fam,

I'm still learning more about this nice tool "Semantica". Today, I'm learning a lot more on its configurations which is very helpful if you're developing plug-ins for Semantica.

I'll highlight two files today: 1) remote-config.xml, 2) Preferences.conf.

remote-config.xml

CAUTION: Semantica might delete this file and its subfolders when it starts up because the application settings are looking for another set of configuration files. All of these files in the "C:/Users/[username]/Semantica/RemoteConfiguration" will be deleted. Hence, it might be wise to keep a copy somewhere within Semantica or where these files can be recovered when accidents occur.

When setting up Semantica initially, there is a way to point to a default configuration file that helps configure Semantica's display and functionality access for the user. These typically go into the "remote-config.xml" file. This file, along with its subfolders, are usually stored in the path "C:/Users/[username]/Semantica/RemoteConfiguration". Here's a quick screenshot, but I'm highlighting here its importance to remove the default Sources (data sources that Semantica connects to retrieve data). Later, we can add data sources that are in respects to our project(s).


When Semantica loads (i.e. starts up to display to user), this application looks for these configurations. An option is presented to the user if this configuration file is not found. The option asks whether to continue using Semantica without one (configuration file) or with one (which will need to be added/updated).


To avoid this dialog and know the back-end settings which trigger this dialog upon loading of application, we must update the application's vmptions which will update the "Preferences.conf" file.

Semantica Professional.vmoptions

This is one of the core files in loading the application (similar to Eclipse IDE's eclipse.ini file).
Within this application is where I set the path to my remote-config file. This will overwrite the path stated in the Preferences.conf file automatically upon application start-up.



Preferences.conf

Semantica will overwrite this file every time the application is loaded with its latest settings (of preferences).



Updating path to remote-config

I'm going to update my value for RemotePreferences.URL to
"file\:///C\:/Users/gordonr/Semantica/RemoteConfiguration/remote-config.xml" and add in my remote-config.xml along with its subfolders. Next, I'll restart my Semantica and expect no dialog to display.

Unfortunately, I still got the error and then when I clicked on "Update" I received this error message:


I guess, the only way to update this path to the remote-config.xml is when we are actually in the application. So, let's just enter the application, select on the menu's File > Preferences > General > scroll down general settings pane to "Remote Configuration Settings" > update path to "remote-config.xml". Copy the "remote-config.xml" and its subfolders back into the RemoteConfiguration folder. Restart Semantica.

Sigh. We still get the RemoteConfiguration folder emptied by Semantica and I have no reason or understanding of why. So, we'll just copy the "remote-config.xml" and its subfolder into a new folder. This will be in "C:/Users/[username]/Semantica/configuration". Yep, keep it simple. Next, go into the file "Semantica Professional.vmptions" under Semantica Professional app directory and update the path to our new configuration folder. Now, let's restart Semantica and see what happens.

Interesting, the vmoptions folder didn't update this Preferences.conf file which also means this application didn't update it's URL for the remote configuration settings. And I'm really feeling like I'm wasting a lot of time here. Some things seem complex for no reason. I'll try updating the preferences from within the File > Preferences again.



This time, see the Remote Configuration file is stated as invalid. Update the path to where the remote-config.xml is located. Then, click on "Update" button.






Notice a dialog displays asking for user to confirm overwriting of config file. Overwrite. Next, see a dialog stating the config will take effect after restart of application. Let's go ahead and restart the application. No need to save changes (i.e. select "No" when asked to save changes because we didn't make any network, entity, or oncology changes).

When Semantica restarts, we see confirmation messages regarding the updates to remote configurations.


Select OK when asked regarding these updates. Now when we go into the Import Manager view, we'll see some very general data sources that actually don't do anything.


Also, notice in the "Preferences.conf" file that the updates are also applied. Strangely, I experimented with the vmoptions file and didn't see any auto-updates in there related to the restart or config of Semantica. I'm doubting my understanding of this file's usage (i.e. vmoptions). And I can't believe I have to set my config path within Semantica's general settings.

I feel unsuccessful today, but I learned a lot. I hope you did, too.




No comments:

Post a Comment