Giter VIP home page Giter VIP logo

isis-script's People

Contributors

mwhesse avatar tjuerge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mwhesse jifffffy

isis-script's Issues

outline view doesn't show child nodes for actions (though it does for properties)

I added a property:

@Property(optionality=OPTIONAL)
property Integer count {
    choices {
        #[1,2,3]
    }
}

and its "choices" node appears in the outline view, but the same is not true for the children of the "updateName" action:

@Action(domainEvent = UpdateNameDomainEvent)
action SimpleObject updateName {
    @Parameter(maxLength = 40)
    @ParameterLayout(named = "New name")
    parameter String newName {
        default {
            ...
        }
    }
    body {
        ...
    }
    validate {
                    ...
    }
    event UpdateNameDomainEvent
}

see:

image

compilation errors

I have replaced the example SimpleObject class with the example in the readme, and the code generates fine - looks good.

However, when trying to run, I get the following:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project strategybuilder-dom: Compilation failure: Compilation failure:
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[21,36] package domainapp.dom.modules.simple does not exist
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[22,36] package domainapp.dom.modules.simple does not exist
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[38,17] cannot find symbol
[ERROR] symbol:   class SimpleObject
[ERROR] location: class domainapp.dom.app.homepage.HomePageViewModel
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[46,5] cannot find symbol
[ERROR] symbol:   class SimpleObjects
[ERROR] location: class domainapp.dom.app.homepage.HomePageViewModel
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[21,36] package domainapp.dom.modules.simple does not exist
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[22,36] package domainapp.dom.modules.simple does not exist
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[38,17] cannot find symbol
[ERROR] symbol:   class SimpleObject
[ERROR] location: class domainapp.dom.app.homepage.HomePageViewModel
[ERROR] /home/anton/Documents/software/isis/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java:[46,5] cannot find symbol
[ERROR] symbol:   class SimpleObjects
[ERROR] location: class domainapp.dom.app.homepage.HomePageViewModel
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :strategybuilder-dom

Do I need to add the path to the generated source in the pom? If yes, where/how should I do that? I have tried adding:

 <build>
     <resources>
                    <resource>
                        <directory>target/generated-sources/isis/</directory>
                    </resource>
                </resources>

but this did not help.

Thanks

Automatically create a domain event hierarchy

If you look at the isis-app-todoapp or the isis-module-security addons, say, you'll see that I create a hierarchy of events... for the member, for the class, for the module. This is so that any subscribers on these events can choose the scope/granularity. (A subscriber at the module level could in essence veto all that module's functionality from the UI).

Perhaps the DSL could automatically generate this event hierarchy?

The generated compareTo should use varargs version rather than CSV.

rather than:

@Override
 public int compareTo(final SimpleObject other) {
    return org.apache.isis.applib.util.ObjectContracts.compare(this, other, "name,count");
 }

should be:

@Override
public int compareTo(final SimpleObject other) {
  return org.apache.isis.applib.util.ObjectContracts.compare(this, other, "name","count");
}

no viable alternative at input 'repository'

Hi

I'm trying the example given in the readme, and there seems to be an issue with the respository keyword.

In Ecliipse I am getting: "no viable alternative at input 'repository'".

I'm not sure if this is related, but I also see:

eclipse.buildId=4.5.0.I20150603-2000
java.version=1.8.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

org.apache.log4j
Error
Sun Jul 19 00:31:06 CEST 2015
org.eclipse.xtext.xbase.jvmmodel.JvmModelAssociator  - Error calling inferrer


java.lang.NullPointerException
    at org.vaulttec.isis.script.jvmmodel.IsisJvmModelInferrer._infer(IsisJvmModelInferrer.java:81)
    at org.vaulttec.isis.script.jvmmodel.IsisJvmModelInferrer.infer(IsisJvmModelInferrer.java:577)
    at org.eclipse.xtext.xbase.jvmmodel.JvmModelAssociator.installDerivedState(JvmModelAssociator.java:382)
    at org.eclipse.xtext.resource.DerivedStateAwareResource.installDerivedState(DerivedStateAwareResource.java:240)
    at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getContents(BatchLinkableResource.java:148)
    at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareBatchTypeResolver.getEntryPoints(LogicalContainerAwareBatchTypeResolver.java:44)
    at org.eclipse.xtext.xbase.typesystem.internal.DefaultBatchTypeResolver.getTypeResolver(DefaultBatchTypeResolver.java:63)
    at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver$1.get(CachingBatchTypeResolver.java:49)
    at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver$1.get(CachingBatchTypeResolver.java:1)
    at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:77)
    at org.eclipse.xtext.xbase.typesystem.internal.CachingBatchTypeResolver.doResolveTypes(CachingBatchTypeResolver.java:46)
    at org.eclipse.xtext.xbase.typesystem.internal.AbstractBatchTypeResolver.resolveTypes(AbstractBatchTypeResolver.java:69)
    at org.eclipse.xtext.xbase.resource.BatchLinkingService.resolveBatched(BatchLinkingService.java:71)
    at org.eclipse.xtext.xbase.resource.BatchLinkableResource.resolveLazyCrossReferences(BatchLinkableResource.java:165)
    at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:528)
    at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.postParse(XtextDocumentReconcileStrategy.java:174)
    at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.doReconcile(XtextDocumentReconcileStrategy.java:152)
    at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(XtextDocumentReconcileStrategy.java:66)
    at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.doRun(XtextReconciler.java:445)
    at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.access$3(XtextReconciler.java:425)
    at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$DocumentListener$1.exec(XtextReconciler.java:136)
    at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$DocumentListener$1.exec(XtextReconciler.java:1)
    at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:121)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:428)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.process(XtextDocument.java:337)
    at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$DocumentListener.performNecessaryUpdates(XtextReconciler.java:133)
    at org.eclipse.xtext.ui.editor.model.XtextDocument.updateContentBeforeRead(XtextDocument.java:249)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.internalReadOnly(XtextDocument.java:518)
    at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:492)
    at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:133)
    at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler$2.run(HighlightingReconciler.java:320)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Error trying to use eclipse plugin

Hi

This looks like a really excellent plugin. I was just thinking that it would be interesting to do a sculptor cartridge for Apache Isis, then found this.

Anyway, when trying to run it, I am not getting eclipe recognize the .isis extension, and get the below error:

eclipse.buildId=4.5.0.I20150603-2000
java.version=1.7.0_79
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -data file:/home/anton/workspaces/tradeworks-modeling/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

org.vaulttec.isis.script.ui
Error
Sat Jul 18 00:18:32 CEST 2015
FrameworkEvent ERROR

org.osgi.framework.BundleException: Could not resolve module: org.vaulttec.isis.script.ui [1821]
Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"

at org.eclipse.osgi.container.Module.start(Module.java:434)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

eclipse.buildId=4.5.0.I20150603-2000
java.version=1.7.0_79
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -data file:/home/anton/workspacesmodeling/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

Suggestion to give isis-script a snappier name...

We chose "Isis" as the name of the framework because the original authors lived (still live) in Oxfordshire, and the River Thames is called Isis when it flows through Oxford.

So, in thinking about the name of a language for Isis, I hit upon a bad pun that "source" is a "source programming language" but also the "source of a river". The source of the River Thames is officially a place called Thames_Head, which isn't much of a name, but it's very close to a village called Kemble, which is (I think) a great name.

https://en.wikipedia.org/wiki/Thames_Head

Thoughts?

Further features for IDE

Many years ago I wrote some Eclipse plugins of my own for the Naked Objects framework (precursor to Apache Isis). None of that code is salvageable, but perhaps some of the ideas I implemented could be brought into isis-script.

Screenshot below:
no-ide

Is the 'event' keyword necessary?

At first I was confused as to its purpose, but then I figured out you must be using it to generate the event class? But couldn't you infer this class just from the annotation, eg @action(domainEvent=UpdateNameDomainEvent) ?

Add support for mixins

Mixins were introduced in 1.10.0 (10-nov-2015), so I think that's after the time when you did most of the work on this repo.

In terms of a keyword, I was thinking that another name for them could be "behaviour" (or "behavior", I suppose, for the US).

Generated fields for injected services should have default visibility...

... so that unit tests can easily mock them out.

Currently I'm having to use reflection:

public class SimpleObjectsTest {

    @Mock
    DomainObjectContainer mockContainer;
    SimpleObjects simpleObjects;

    @Before
    public void setUp() throws Exception {
        simpleObjects = new SimpleObjects();
        
        //simpleObjects.container = mockContainer;
        Field field = simpleObjects.getClass().getField("container");
        field.set(simpleObjects, mockContainer);
    }

Update to Xtext 2.11

Version 2.11 of Xtext / Xtend is released (bug list).

Starting with version 2.11 Xtext requires Java 8 as execution environment. The minimal supported target platform is Eclipse Luna.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.