Getting started from scratch using Spring MVC.

17 views
Skip to first unread message

Dave Brooks

unread,
Jul 30, 2016, 9:30:16 PM7/30/16
to Substance
I working on a Spring MVC (java) based web application and would love to introduce the Substance editor for browser based editing. My JavaScript experience in the npm environment is very limited. Can anyone tell me if it is even possible? 

Thanks
Dave

Dipanjan Mukherjee

unread,
Jul 31, 2016, 12:04:02 AM7/31/16
to Substance
Hey Dave,

When Spring MVC finally renders a page on your browser, it is sending HTML, CSS and Javascript. Substance works the same way if you are looking and rendering only the editor.

If you are looking to utilize the collaboration support that substance offers, you will have to run substance on your servers as well.

To start, create a plain javascript application based on one of the examples that substance offers, then look at your browser to see what files and html is getting served, and introduce them to your Spring application. Please note, this is overly simplified, and only to help you start.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Substance" group.
To unsubscribe from this group and stop receiving emails from it, send an email to substance_+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave Brooks

unread,
Aug 1, 2016, 9:26:54 AM8/1/16
to Substance
Thanks Dipanjan,

No, I'm not looking to use the collaboration support, just editor at least for now. I've reviewed the examples and see what needs to be in the html for the editor. What I'm not able to understand is where to put the supporting files in my web project. The examples just don't look like the web folder structure I'm familiar with. Should I just copy the entire substance download into my js folder?  or maybe just the the particular .js files I need to run the module I using? Also there are *.scss files with which I am unfamiliar. Is there any documentation that describes there usage?

Sorry, but getting started feels a bit difficult. This is out of my wheel house for now, but won't be for long. I just need a few boosts :) 

Thanks again
Dave

Dave Brooks

unread,
Aug 21, 2016, 6:45:30 PM8/21/16
to Substance
Ok, so I've finally gotten back to this project and running into a problem with scss files. There are a few examples that have css files, but they seem to not be the the most up to date. I'm trying to take the recent substance release examples and run it within my site. The problem appears to be that I do not have anything to convert scss to css within my deployment environment. I'm new to this entire concept and would like to find some simple getting started advice, following the examples just isn't providing enough information for me. Sorry, but I seem to need some step by step help. 

I've noticed the examples have a docker-compose.yml file in the directory so I cloned the project and attempted to run it on docker for mac with the following exception:

examples dave$ docker-compose up

Creating network "examples_default" with the default driver

Pulling example (node:5.6)...

5.6: Pulling from library/node

7268d8f794c4: Pull complete

a3ed95caeb02: Pull complete

d9a49bc2b1b0: Pull complete

b965864d2d45: Pull complete

47bed597ecf4: Pull complete

432750a489d5: Pull complete

ad86930c50cb: Pull complete

Digest: sha256:cedb4753fa2cdab779247e457378c6b4271483d643d9d078241622d42c162e6e

Status: Downloaded newer image for node:5.6

Creating examples_example_1

Attaching to examples_example_1

example_1  | npm info it worked if it ends with ok

example_1  | npm info using n...@3.6.0

example_1  | npm info using no...@v5.6.0

example_1  | npm info lifecycle substance...@1.0.0-beta.4~prestart: substance...@1.0.0-beta.4

example_1  | npm info lifecycle substance...@1.0.0-beta.4~start: substance...@1.0.0-beta.4

example_1  |

example_1  | > substance...@1.0.0-beta.4 start /src

example_1  | > node server.js

example_1  |

example_1  | module.js:341

example_1  |     throw err;

example_1  |     ^

example_1  |

example_1  | Error: Cannot find module 'express'

example_1  |     at Function.Module._resolveFilename (module.js:339:15)

example_1  |     at Function.Module._load (module.js:290:25)

example_1  |     at Module.require (module.js:367:17)

example_1  |     at require (internal/module.js:16:19)

example_1  |     at Object.<anonymous> (/src/server.js:4:15)

example_1  |     at Module._compile (module.js:413:34)

example_1  |     at Object.Module._extensions..js (module.js:422:10)

example_1  |     at Module.load (module.js:357:32)

example_1  |     at Function.Module._load (module.js:314:12)

example_1  |     at Function.Module.runMain (module.js:447:10)

example_1  |

example_1  | npm info lifecycle substance...@1.0.0-beta.4~start: Failed to exec start script

example_1  | npm ERR! Linux 4.4.17-moby

example_1  | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"

example_1  | npm ERR! node v5.6.0

example_1  | npm ERR! npm  v3.6.0

example_1  | npm ERR! code ELIFECYCLE

example_1  | npm ERR! substance...@1.0.0-beta.4 start: `node server.js`

example_1  | npm ERR! Exit status 1

example_1  | npm ERR!

example_1  | npm ERR! Failed at the substance...@1.0.0-beta.4 start script 'node server.js'.

example_1  | npm ERR! Make sure you have the latest version of node.js and npm installed.

example_1  | npm ERR! If you do, this is most likely a problem with the substance-examples package,

example_1  | npm ERR! not with npm itself.

example_1  | npm ERR! Tell the author that this fails on your system:

example_1  | npm ERR!     node server.js

example_1  | npm ERR! You can get information on how to open an issue for this project with:

example_1  | npm ERR!     npm bugs substance-examples

example_1  | npm ERR! Or if that isn't available, you can get their info via:

example_1  | npm ERR!     npm owner ls substance-examples

example_1  | npm ERR! There is likely additional logging output above.

example_1  | npm WARN Local package.json exists, but node_modules missing, did you mean to install?

example_1  |

example_1  | npm ERR! Please include the following file with any support request:

example_1  | npm ERR!     /src/npm-debug.log

examples_example_1 exited with code 1

npm-debut.log file is attached:

Please let me know if I am getting in over my head or there are better, more decisive ways to get started. I'm not a beginner in the html, js, css world, and want to use Substance if it can work in this world. If not, I will move on.

Thanks for any help you might have Dave



On Sunday, July 31, 2016 at 12:04:02 AM UTC-4, Dipanjan Mukherjee wrote:
npm-debug.log

Daniel

unread,
Aug 23, 2016, 6:40:50 AM8/23/16
to subst...@googlegroups.com
Hey, Dave!
Please follow repo’s instructions to run examples: https://github.com/substance/examples#install
SCSS files are kind of modular stylesheets. However it cannot be used directly by your browser, so it must be compiled to regular CSS first. To do it you can run dev server with npm start (it will compiled on each request) or bundle examples: https://github.com/substance/examples#bundling.
Reply all
Reply to author
Forward
0 new messages