Improved shared library structure dump to take more types into account Added support for: * L0.SCLScript * GF.File This also removes dumping of the .pgraph file from the shared library exporter because the contents of the generated .pgraph file have never been complete, nor stable enough to actually give out any information on what has changed and how. The system gives no diffs out on what most usually changes, i.e. SCL modules, scripts, SVG files and other similar textual data. gitlab #452 Change-Id: Id35b8b6d339398ba89aca3e10aff7aeb4c610242
Fix graph.tg hardcoded in CompilePGraphs code Ontology cannot be compiled if it depends on a tg that has another name than graph.tg. Fixed this by searching for all .tg files instead of those called graph.tg. gitlab #422 Change-Id: I52fb91f31b0ae052097fdedd36efa56e314adec5
Support reading TG files with shared and non-shared value contexts This is part of the fix for a nasty corner case in TransferableGraphFileReader.readTG's deserialization of referable value data types. This regression was caused by commit bf495713dbc9dec325f3929889466fa6cd58b541 over 1.5 years ago. The removal of idContext.clear() was done without proper understanding of the real issue. The real issue is that TG's are currently written in two ways by different codes: with shared and with non-shared value contexts. Serializing TransferableGraph1 structures using the default Binding will use shared context for serializing the values Variant array. Thus all TG files produced by the graph compiler use a shared value context which eans this class must be used with sharedValueContext set to true. As an example, <code>true</code> must be used if the corresponding TG file is written e.g. like this: DataContainers.writeFile(location new DataContainer(format, version, metadata, new Variant(TransferableGraph1.BINDING, tg))); On the other hand, any TG files serialized using more optimized methods like ModelTransferableGraphSource do not use a shared value context when writing the file. This means those files cannot be read safely using standard {@link Binding} at all, and when using this class, sharedValueContext must be set to false to prevent the import from corrupting datatype values because the referable parts of datatypes may get bound to the wrong existing types if the data is read using shared context. After this change clients should use readTG(File | InputStream, boolean) methods instead of readTG to always specify the context sharing setting explicitly according to how the TG's in question were written. gitlab #409 Change-Id: Ic18fd1442987d4e740f729729b81cd3133f5d269
Remove duplicate InputChannel inner classes gitlab #73 Change-Id: I5ef3948f8b3437345536bd7e121cb3443d8fe26f
Finalizing improve startup time for fresh or rollback'd session Finally fixed the long-sought InputStream reading bug from TransferableGraphFileReader.InputChannel.read(ByteBuffer). The ByteFileReader implementation expected the provided ReadableByteChannel to always provide a full buffer of data unless EOF was encountered and the InputChannel.read implementation was not taking care of that. Also added simpler utilities for reading TG's from files/InputStreams directly using static TransferableGraphFileReader.read(File/InputStream) methods. PlatformUtil.readTG can now finally use TransferableGraphFileReader for maximal performance. refs #7835 Change-Id: I170986bf271a409f9205fad808ae029becc1d3a4
Fixed various bugs in TG readers Added primary install-location based relative path resolution to database baselining logic. Secondary relative baseline resolution logic still uses working directory. refs #7825 Change-Id: I154528e674e6d478ea4bdb1de4d38c38d5097fdf
Added graph.tg hash caching to FixExportedOntology Moved generic database baselining code to DatabaseBaselines from SimanticsPlatform and added new utility functions to DataContainers and cleaned up existing methods therein using resource-try statements. Also note org.simantics.graph.refactoring.TransferableGraphHasher that can be used for adding hash values to graph.tg files. refs #7806 Change-Id: I7f54cfb0db68a8a5602fc2a8d9651cb305a8136d
Fixed platform startup ontology update hash checking to work There was a typo in the Extensions class constant that identified cached hash value in the DataContainer metadata map compared to the maven graph builder plug-in. refs #7806 Change-Id: I21e99108adfa2b1e9307127ffd4be7127f852812
Escape/unescape names of the externals when converting to/from URIs refs #7812 Change-Id: I491a0d57a076c73785e120c3632d48c6258ea1ab
Platform startup performance improvements 1. DB baselining can now be enabled with ontology update checking due to caching of TG hash values in the DataContainer.metadata map field with key "cached.hashCode". This diminishes the time taken by ontology merge need checking to very little time compared to the old system where all graph.tg files were loaded completely into heap memory to simply check whether they need to be merged or not. 2. BaselineCreator application can be used to construct a baseline with a built product in any OS supported by Simantics. To get the benefit from these changes, you'll also need to use the version 0.0.9 of the graph-builder-maven-plugin. refs #7806 Change-Id: I7fadaf43f3c96d3b989a73e0f1ae6e6fa83e09ce
Include cached hash code in TransferableGraph1 extensions map The cached hashcode is calculated before inserting the cached hash value in the TransferableGraph1.extensions TreeMap. Reading and inspection must be done with this in mind. This cached value is used to optimize platform startup by removing the need to calculate the TransferableGraph1 structure hashcode at runtime which can be quite expensive because the standard databoard Bindings are slow compared to optimal methods. Of course an optimized binding could be used to speed the calculation up dramatically but it still can't beat caching the final (immutable) hashCode value. refs #7806 Change-Id: I9d4fc6549cba567f95b19f80bd15c1ccfbbedf07
Improve PrettyPrintTG performance refs #7383 Change-Id: I4c372679d1049d87a0c8c06ec18228ab826e1510