Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
curry-packages
spicey
Commits
5dee0b73
Commit
5dee0b73
authored
Jan 14, 2018
by
Michael Hanus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loadpath added
parent
11f1622a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
27 deletions
+20
-27
README.md
README.md
+9
-13
docs/manual.tex
docs/manual.tex
+2
-7
src/Spicey/SpiceUp.curry
src/Spicey/SpiceUp.curry
+9
-7
No files found.
README.md
View file @
5dee0b73
...
...
@@ -4,17 +4,13 @@ The Spicey Web Application Framework
To generate an application, follow the steps below.
1.
Create a Curry program containing a constant of type
`Database.ERD.ERD`
(the module
`Database.ERD`
is part of the package
`cdbi`
)
which describes your entity-relationship model
(see the file "examples/BlogERD.curry" as an example).
2.
Since the imported module
`Database.ERD`
is part of the package
`cdbi`
,
this package must be installed, e.g., by the command
2.
Execute
`spiceup`
and supply the name of the Curry ERD program, e.g.,
cypm add --dependency cdbi
3.
Execute
`spiceup`
and supply the name of the Curry ERD program, e.g.,
cypm exec spiceup .../BlogERD.curry
spiceup .../BlogERD.curry
This generates the complete source code of the initial application
(see the generated file README.txt for some explanations).
...
...
@@ -22,7 +18,7 @@ To generate an application, follow the steps below.
You can also provide a file name for the SQLite3 database in which
all data is stored, e.g.,
cypm exec
spiceup --db BlogData.db .../Blog.erdterm
spiceup --db BlogData.db .../Blog.erdterm
If the parameter "--db ..." is not provided, then the name of database
file is "
<ERD>
.db" where
<ERD>
is the name of the specified ER model.
...
...
@@ -34,17 +30,17 @@ To generate an application, follow the steps below.
This path could also be set in the definition of the constant
`sqliteDBFile`
in the generated Curry program
`Model/<ERD>.curry`
.
4
.
Change into the generated directory containing all sources as a
3
.
Change into the generated directory containing all sources as a
Curry package, e.g., by
`cd Blog`
.
5
.
Install all required packages by
`make install`
.
4
.
Install all required packages by
`make install`
.
6
.
Compile the generated programs by
`make compile`
.
5
.
Compile the generated programs by
`make compile`
.
7
.
Configure the Makefile (variable WEBSERVERDIR) and execute
6
.
Configure the Makefile (variable WEBSERVERDIR) and execute
`make deploy`
to deploy the web application.
8
.
After the successful compilation, the application is executable
7
.
After the successful compilation, the application is executable
in a web browser by loading
`<URL of web dir>/spicey.cgi`
.
Note that the database is generated with the
`cdbi`
package.
...
...
docs/manual.tex
View file @
5dee0b73
...
...
@@ -55,21 +55,16 @@ This is an ER model for university lectures as
presented in the paper
\cite
{
BrasselHanusMueller08PADL
}
.
\end{description}
%
Since the imported module
\code
{
Database.ERD
}
is part of the package
\code
{
cdbi
}
, you have to install this package first, e.g., by the command
\begin{curry}
> cypm add --dependency cdbi
\end{curry}
Then you can generate the sources of your web application
by the command
\pindex
{
spiceup
}
\begin{curry}
>
cypm exec
spiceup MyERD.curry
> spiceup MyERD.curry
\end{curry}
with the ERD program as a parameter.
You can also provide a file name for the SQLite3 database used
by the application generated by Spicey, e.g.,
\begin{curry}
>
cypm exec
spiceup --db MyData.db MyERD.curry
> spiceup --db MyData.db MyERD.curry
\end{curry}
If the parameter
\ccode
{
--db DBFILE
}
is not provided,
then
\code
{
DBDFILE
}
is set to the default name
\ccode
{$
ERD
$
.db
}
...
...
src/Spicey/SpiceUp.curry
View file @
5dee0b73
...
...
@@ -2,21 +2,21 @@
module Spicey.SpiceUp where
import Database.ERD (ERD, readERDTermFile)
import Database.ERD.Goodies (erdName, storeERDFromProgram)
import Database.ERD (
ERD, readERDTermFile
)
import Database.ERD.Goodies (
erdName, storeERDFromProgram
)
import Directory
import Distribution
import FilePath ((</>))
import List (isSuffixOf, last)
import System (system, getArgs, exitWith)
import FilePath (
(</>)
)
import List (
isSuffixOf, last
)
import System (
setEnviron,
system, getArgs, exitWith
)
import Spicey.PackageConfig (packagePath, packageVersion)
import Spicey.PackageConfig (
packagePath, packageVersion
, packageLoadPath
)
import Spicey.Scaffolding
systemBanner :: String
systemBanner =
let bannerText = "Spicey Web Framework (Version " ++ packageVersion ++
" of
08
/01/18)"
" of
14
/01/18)"
bannerLine = take (length bannerText) (repeat '-')
in bannerLine ++ "\n" ++ bannerText ++ "\n" ++ bannerLine
...
...
@@ -173,6 +173,8 @@ main = do
_ -> putStrLn ("Wrong arguments!\n") >> spiceupHelp 1
where
createStructureWith orgfile dbfile = do
-- set CURRYPATH in order to compile ERD model (which requires Database.ERD)
unless (null packageLoadPath) $ setEnviron "CURRYPATH" packageLoadPath
-- The directory containing the project generator:
let resourcedir = packagePath </> "resource_files"
exfile <- doesFileExist orgfile
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment