* 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.
Tuukka Lehtonen [Fri, 31 Mar 2017 13:14:02 +0000 (16:14 +0300)]
Replaced use of deprecated BinaryFunction et al with BiFunction et al
Also added missing logic to GraphExplorerComposite.SelectionElement to
discover Resource from Variable when WorkbenchSelectionElement is asked
for AnyResource. This is part of the fix for #7116.
Fixed breakage from ContextualHelp F1 keystroke handler which was
introduced in the original SVN commit r32734 (#6446).
Tuukka Lehtonen [Fri, 31 Mar 2017 09:05:47 +0000 (12:05 +0300)]
Reversioned org.jdom2 from 2.0.6 to 2.0.6.b0001
This ensures that people loading the target platform will
receive the correct version of the plug-in. Currently developers
still have old cached versions of the old bundle with version
2.0.6 that the system unwantedly keeps loading while P2 should
be loading the correct file on the web. The only way to prevent
this is to bump the version qualifier stamp to force downloads.
Antti Villberg [Wed, 8 Mar 2017 14:50:59 +0000 (16:50 +0200)]
Import/export changes. A load.
May cause some problems. Exports create Internals instead of blanks if
possible. FixExportedOntology treatment now produces tgs that are
compatible with Graph Compiler. Import creates L0.ExternalEntity
instances for unresolved external references (thus making it fail safe).
Note that addBuiltin("http://Projects") was removed from class
CoreInitialization because its existence resulted in a non-functioning
URI space because:
* http://Projects was added as a "built-in resource" when the database
is first initialized which means that
ReadGraph.getResource("http://Projects") would succeed even when the
resource was not yet properly imported from the project ontology
* When the project ontology is imported, a new resource is created to
represent http://Projects instead of using the existing uninitialized
"built-in resource". The L0.ExternalEntity changes made to the standard
transferable graph import in this patch caused the code to find the
built-in resource for "http://Projects" and think that it has to be a
resource that's already properly initialized. This led to the TG import
not initializing the resource at all. Previously there was a bug here as
well but it was hidden by the fact that the system would import the
actual/new "http://Projects" resource from the ontology anyway. This
effectively left the uninitialized built-in resource just hanging in the
database as trash.
Tuukka Lehtonen [Tue, 28 Mar 2017 15:02:18 +0000 (18:02 +0300)]
Added base diagram profile style for showing terminal names on diagrams
Previously there has been an implementation for showing terminal names
in the symbol editor (SymbolTerminalNameStyle). This implementation is
for showing symbol instance terminal names on modelling diagrams
containing symbol instances. The names are positioned outside the
current symbol's bounding box.
ConnectionPointNameStyle also employs the new TextNode automatic text
flipping feature added in #7112.
Jussi Koskela [Mon, 20 Mar 2017 13:04:31 +0000 (15:04 +0200)]
Not possible to open declaration of SCL module from relative path (F3)
Resolve absolute path of SCL module when user presses F3 on
import/include that uses relative path. Refactored absolute path
resolving to static utility function.
Jussi Koskela [Fri, 10 Mar 2017 07:38:28 +0000 (09:38 +0200)]
Hardening of DB index integrity
Mark index dirty as early as possible on write operations (and sync to
disk). Clean index dirtiness indicator as last step when deleting the
index. Cache dirty statuses to write dirty files only once.
Tuukka Lehtonen [Mon, 20 Mar 2017 06:56:08 +0000 (08:56 +0200)]
Removed useless class org.simantics.utils.thread.Executors2.
Also removed the optional org.eclipse.swt dependency introduced to
org.simantics.utils.thread by Executors2. org.simantics.utils.thread.swt
already contains SWTThread which is where this dependency should be
kept.