Hannu Niemistö [Fri, 12 May 2017 10:58:22 +0000 (13:58 +0300)]
(refs #6878) validateOnly flag to ExpressionEvaluator and CommandSession
Added a new flag validateOnly to ExpressionEvaluator and CommandSession.
This prevents the execution of the expression. In command session,
variable types are however updated, so it is possible to run longer
command sequences and check their types. To use the flag, run the script
in CommandSession with static method validate.
jsimomaa [Fri, 12 May 2017 07:25:50 +0000 (10:25 +0300)]
Enhancements to modelled STS-tests
Some refactoring and streamlining for the modelled STS-tests:
* Possibility to ignore certain tests
* Streamlined JUnit execution of modelled tests
* Removed duplicate code related to modelled STS test searching
* Introduced Junit/Assert SCL-module for assertions in SCL tests
* Changed STSTestEditor to extend SCLModuleEditor2
Hannu Niemistö [Thu, 11 May 2017 19:54:24 +0000 (22:54 +0300)]
(refs #7214) Treat $ exactly like function application
Converts (f $ p) before type checking to (f p). This slightly changes
the semantics of the language for it is now possible to use $ with
functions like runProc, syncRead etc.
Tuukka Lehtonen [Thu, 11 May 2017 11:19:32 +0000 (14:19 +0300)]
Added mechanism to diagram IFlagType to prevent graph modifications
When diagram flags are loaded, some implementations trigger graph
modifications because the flag type may know the flag to have wrong
direction information based on analysis of the model. Printing diagrams
to PDF or SVG should not modify the database in any way, just trust what
is in there.
Jussi Koskela [Tue, 9 May 2017 13:12:17 +0000 (16:12 +0300)]
Improved logic in new head state creation.
Earlier any IOException during the reading of head state was interpreted
as empty DB. This might cause unwanted DB reset. It's better to identify
need for empty head state based on main state head directory.
Switched AcornDatabase.start logic back to using RandomAccessFile for
touching the db/lock file. Using RandomAccessFile instead of
FileSystemProvider.newFileChannel in Windows better prevents any other
process from removing the lock file. The newFileChannel version did not
prevent the user from initially running 'del lock' to remove the file -
although the file will be recreated quickly by the system.
Also AcornDatabase.start now re-throws ProCoreException if
opening/locking the lock-file fails with IOException to prevent the
system from attempting to start up without a proper database to work
with. Previously the system just logged the start-up problem and
continued.
* changes:
Use ListIndexRoots in migration
ListIndexRoots request
SingletonRead base class
GenericReadBase2 without the unused template parameter
Initial selection for diagram viewer should be the diagram itself
Support VP.Test in action browse context contribution
InstanceOf tester (VP.Test)
Tuukka Lehtonen [Fri, 5 May 2017 13:59:12 +0000 (16:59 +0300)]
Fixed bad bug related to AcornBackupProvider
AcornBackupProvider was invoking GraphClientImpl2.makeSnapshot with true
parameter which caused the invocation to write the main.state file when
backups were made which was totally unintentional. The main.state file
is now only written only when the database session is shut down, i.e.
not at all in ClusterManager.makeSnapshot.
Also includes robustness fixes for Acorn database directory locking by
using the Java NIO API for atomic existence testing and creation of the
lock file.
Tuukka Lehtonen [Fri, 5 May 2017 14:25:08 +0000 (17:25 +0300)]
Changed external reference flag texts to obey current name/label mode
Text shown in external reference type diagram flags now obeys the
currently selected Name/Label model that can be controlled using code in
class org.simantics.NameLabelUtil.
Previously the text shown in normal diagram external reference flags was
always preferring to show the Label property of diagrams and related
modules and if labels were not defined, the Name property would be used
instead.
Tuukka Lehtonen [Fri, 5 May 2017 10:41:01 +0000 (13:41 +0300)]
Fixed BrowseContext test code to work headlessly
Previous code invoked JFaceResources.getDefaultFontDescriptor which
eventually invoked Display.getCurrent which would assert out in a
headless test environment.
Tuukka Lehtonen [Thu, 4 May 2017 21:52:29 +0000 (00:52 +0300)]
Fixed bad logical bug from Acorn's MainState.load rollback
The major bug was the logical not in MainState.load rollback which
caused the database revisioning to be started from 0 when the database
was *not* empty. It should have been the other way around.
Also cleaned up the database head.state validation code by not using
exceptions for flow control in validating head.state files.
Fixed URI problems related to EnternalEntities during import
Introduced a new function, getTrueUri, that gives the escaped URI.
Used when finding external entities.
Previously, getUri was used, which made finding external entities
impossible, for all User Component's with a space in their name.
Added Simantics/PGraph SCL API for compiling shared ontologies TGs
Moved CompilePGraph action implementation to org.simantics.modeling and
made the code headless. UI problem reporting can be done using the
provided CompilePGraphs.UserAgent interface.
Removed IRequest references and usage from Document/All
An recent change (Revision 82ed7c74) to Document/All.scl added IRequest
usage and references. IRequest should not be used in Documents/All. 82ed7c74 broke SimupediaServer's Request.scl, since
Request.scl uses Document/All and also already had IRequest defined.
MainState will no longer destroy the entire database if the user removes
directories but forgets to remove the main.state file. The information
stored in main.state is now regarded as cached information only and if
it seems invalid or cannot be read, the same normal rollback logic will
be performed every time.
Another enhancement is that rollback will now automatically store the
revisions deleted by the rollback procedure in timestamped
<workspace>/db/recovery/yyyy-M-d_HH-mm-ss/ folders for later inspection
and debugging. Previously the code just deleted all the extra revisions.
Manually removing the recovery-folder is always a safe operation to
perform.
Also fixed a bug in databoard Files class readFile methods that take
a File as argument. Previously all the functions constructed a
BinaryFile using the default mode which is "rw". This unintentionally
made the readFile methods create an empty file if the file did not
exist. All such methods have been changed to use mode "r".
Hannu Niemistö [Mon, 24 Apr 2017 15:24:17 +0000 (18:24 +0300)]
(refs #6924) Support for record field access syntax.
Because the record field access syntax is harder to implement when the
old Variable access syntax is also supported, this feature is only
enabled (and Variable disabled), when the following module header is
used:
module {
fields
}
This change contains also refactoring and cleaning up of code
related to variable resolving and field handling.
Rudimentary Linux and MacOSX support for org.simantics.nativemem
Linux now supports current and peak RSS and OSX only supports peak RSS
information.
Moved org.simantics.nativemem + JNA into a separate feature
org.simantics.nativemem.feature from org.simantics.utils.feature to not
force the dependency onto all products.
Less memory use for TG import when NamespaceMigrationStep is involved
MigrationStateImpl.getProperty for root resource(s) keys now first
exports CURRENT_TG back to disk if the TG has already been loaded and
then imports it back using StreamingTransferableGraphImportProcess. This
avoids the need to keep the whole TransferableGraph1 in memory while
doing the import and also allows for the use of the leaner Streaming
import process.
Added alternatives taking RequestProcessor to WorkbenchSelectionUtils.
Fixed several places which were found to use a method from
WorkbenchSelectionUtils that could potentially try to initiate a new
read transaction through org.simantics.db.Session to pass the current
ReadGraph over to WorkbenchSelectionUtils instead. This fixes the very
same problem from OpenWithMenuContribution that was introduced in 6d3ad788 change I45cfa3940df8e1f4abe016b215843dc083227b2b.
Also, ComponentTypeViewerData.editValue now prevents committing new
entered value if the value does not pass input validation.