Pascal is probably the better person for this question. I don’t use ERRest at all.On Dec 8, 2015, at 11:11 AM, jazzsalsa < email@hidden> wrote: Hi Ramsey,
It is working now! I started with a ERRest template (without maven) and fixed the build path settings by using local Wonder libraries.
Thanks for the pointers :)
Now I want to change the output format of the REST service. Using Pascal's tutorial [1] I get this JSON output:
[{"id":1,"type":"BlogEntry","content":"Some text","creationDate":"2015-12-08T09:11:43Z","lastModified":"2015-12-08T09:11:43Z","title":"First post","author":{"id":1,"type":"Author","email":" email@hidden","firstName":"Pascal","lastName":"Robert"}},{"id":2,"type":"BlogEntry","content":"This is the second blog post","creationDate":"2015-12-08T14:02:54Z","lastModified":"2015-12-08T14:02:54Z","title":"Second post","author":{"id":2,"type":"Author","email":" jazz@email","firstName":"Jazz","lastName":"Salsa"}},{"id":3,"type":"BlogEntry","content":"This is the third blog post","creationDate":"2015-12-08T14:23:42Z","lastModified":"2015-12-08T14:23:42Z","title":"Third post","author":{"id":3,"type":"Author","email":" jazz2@email","firstName":"Jazz","lastName":"Salsas"}},{"id":4,"type":"BlogEntry","content":"This is the third blog post","creationDate":"2015-12-08T14:41:00Z","lastModified":"2015-12-08T14:41:00Z","title":"Third post","author":{"id":4,"type":"Author","email":" jazz3@email","firstName":"Jazzxxxz","lastName":"Salsas"}}]
Now my question: can I get this JSON output format (all data in one object called 'data'):
{"data":[{"id":1,"name":"My Site #1","vhost":"mysite1.example.org"},{"id":2,"name":"My Site #1","vhost" :"mysite1.example.org"},{"id":3,"name":"My Site #1","vhost":"mysite1.example.org"},{"id":4,"name":"My Site #1","vhost":"mysite1.example.org"}],"total":4}
I am watching ERRest In depth [2] from Pascal at WOWODC 2012 but cannot find how to do it. Do you use ERXRouteController.format() for this?
Thanks in advance,
Bart
On Tue, 2015-12-01 at 17:35 +0100, jazzsalsa wrote: Next question (postgresql works now when using traditional framework.
The migration does not work. I created BlogModel0 in src/main/java there is no Sources folder with maven):
In the Sources folder, open the your.app.model.migrations package, a class named BlogModel0 should be there. Delete everything in that file EXCEPT the first line (which should be package your.app.model.migrations) and paste the code that was generated by Entity Modeler. Save the file.
One last step: migrations are disabled by default. To enable them, you need to uncomment two properties in the Properties file that is located in the Resources folder. Open that file (double-click on it).
Remove the pound char in front of those two properties: #er.migration.migrateAtStartup=true #er.migration.createTablesIfNecessary=true
After removing the pound char, the two properties should look like this: er.migration.migrateAtStartup=true er.migration.createTablesIfNecessary=true
Are there any ideas why it does create the tables in the H2 database? It seems it cannot find BlogModel0. Does this needs to be place in a certain folder?
It would help me a lot if someone has a working maven based Example of ERRest. This way I can learn the structure of the project.
Many thanks, Bart
On Mon, 2015-11-30 at 10:35 -0700, Ramsey Gurley wrote: Try with
-DarchetypeVersion=2.2-SNAPSHOT
In fact, do this:
Install m2e in eclipse if you haven’t already
Go to eclipse preferences, Maven->Archetypes, click “Add Remote Catalog...” button and add
/snapshots/content/archetype-catalog.xml
Description: WORemote
Then you can File->New->Other, Maven->Maven Project, Next, Next, select Catalog: WORemote & check on 'Include snapshot archetypes'
Then you can see your options you won’t need to remember lots of command line args.
Also, I’ve found this really helpful in ubuntu :)
That might even work on OS X… maybe.
On Nov 30, 2015, at 10:14 AM, jazzsalsa < email@hidden> wrote:
Hi Ramsey, Henrique,
Thanks for fixing how hard is was to work with Maven. Much easier now, but not quite there yet.
I followed this page and looked at the email thread on the list around
This works (step 4): mvn archetype:generate -DarchetypeArtifactId=erxapplication-archetype -DarchetypeGroupId=org.objectstyle.woproject.maven2 -DarchetypeVersion=2.1
But this not (step 6): mvn clean package [ERROR] Failed to execute goal on project app: Could not resolve dependencies for project com:app:woapplication:1.0-SNAPSHOT: The following artifacts could not be resolved: wonder.core:ERExtensions:jar:wo54:5.0.0-SNAPSHOT, wonder.core:WOOgnl:jar:wo54:5.0.0-SNAPSHOT, wonder.core:ERPrototypes:jar:5.0.0-SNAPSHOT: Failure to find comm repository, resolution will not be reattempted until the update interval of wocommunity.snapshots has elapsed or updates are forced ->
What do I do with (in pom.xml):
<wonder.classifier>wo54</wonder.classifier>
Is this the correct value?
Thanks in advance, Bart
|