meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
android2012:qeta [2012/10/16 09:21]
aknutas
android2012:qeta [2012/10/17 14:20] (current)
aknutas [Development / Java]
Line 2: Line 2:
  
 **Question instructions:** Copy the sample question below and write your question. Then someone who reads this will hopefully reply with a good answer. **Question instructions:** Copy the sample question below and write your question. Then someone who reads this will hopefully reply with a good answer.
-\\ **Answer instructions:** Write your answer and then at the end of the answer add your signature by the insert signature button, which is at the rightmost button at the top. End result should look like this:  --- //[[antti.knutas@lut.fi|Antti Knutas]] 2012/10/16 08:39//+\\ **Answer instructions:** Write your answer and then at the end of the answer add your signature by the insert signature button, which is at the rightmost button at the top.
  
 == Sample Question (replace with your own topic and copy below) == == Sample Question (replace with your own topic and copy below) ==
Line 10: Line 10:
 ===== Development / Java ===== ===== Development / Java =====
  
-===== Requirements =====+\\ **Q:** How I can make custom web addresses? 
 +\\ **A:** See the Grails guide at section about [[http://grails.org/doc/2.1.0/guide/single.html#urlmappings|URL Mappings]]. 
 +===== The SCRUM Development Process =====
 == User stories == == User stories ==
 **Q:** What are user stories? **Q:** What are user stories?
-\\ **A:** Wikipedia: //"In software development and product management, a user story is one or more sentences in the everyday or business language of the end user or user of a system that captures what a user does or needs to do as part of his or her job function."// Or in other words, it is very much like a use case, except it reads more like fiction than technical documentation.  --- //[[antti.knutas@lut.fi|Antti Knutas]] 2012/10/16 09:20//+\\ **A:** Wikipedia: //"In software development and product management, a user story is one or more sentences in the everyday or business language of the end user or user of a system that captures what a user does or needs to do as part of his or her job function."// Or in other words, it is very much like a use case, except it reads more like fiction than technical documentation.
  
 ===== Environment ===== ===== Environment =====
 == Grails database == == Grails database ==
 **Q:** Can I get a persistant database for Grails that can also be edited with a visual editor?  **Q:** Can I get a persistant database for Grails that can also be edited with a visual editor? 
-\\ **A:** Yes, you can install for example MySQL on the development virtual machine and use it with GrailsFor installationtype //sudo apt-get install mysql-server// on the command lineThen see the [[http://napier.googlecode.com/files/Getting-Started-With-Grails.pdf|Grails guide]] around page twenty for instructions for using in Grails --- //[[antti.knutas@lut.fi|Antti Knutas]] 2012/10/16 09:18//+\\ **A:** Yes, you can use embedded h2browser. This can be activated by opening http://localhost:8080/workforecast/dbconsole/login.jsp (change the name of the application to correspond yours) and entering the connection url to the JDBC url and entering connect. There you should be able to see your persistent database tables on the left hand side menu. Click to table you want to see (it will create select query to the sql statement textbox) click Run to run it. You can then use the Edit button that is located below table contents. See the picture below. 
 +\\ {{::h2console_edit_table.png?direct&500|}} 
 + 
 +You might also need to change the ''dbCreate="update"'' from your ''DataSource.groovy''. If you also want to keep automatic version field from being inserted into all your domain classes (ie. tables) then you need the following code to be included in your domain class ''static mapping = { version false }'' 
 + 
 +If you have trouble getting your db to persist then change the name of the database from DataSource.groovy, run clean from groovy toolkit Project menu folder. Then change it back to devDB (or whatever you want to use in development environment). It should recompile your project and after this is should be persistent afterwards. If it does not try doing this for different name db first and/or doing couple of clean/build allIt seems that the h2 driver gets somehow stuck in some mode and wont change without clean up. 
 + 
 +== Grails databaseH2 problems == 
 +**Q:** My database does not reset each time or the database console is not available. 
 +\\ **A:** Check from your project preferences Grails section that your project is set to //dev// instead of //prod//. 
 + 
 +== Grails database, persistence == 
 +**Q:** How can I store the default H2 database to file, so that it won't reset with each server restart and redeployment? 
 +\\ **A:** Change the connection url from the conf/DataSource.groovy file according to the instructions in [[http://www.h2database.com/html/features.html#database_url]] . Example:  
 +<code> 
 +    development { 
 +        dataSource { 
 +            dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', '' 
 +            url = "jdbc:h2:file:~/myproject.h2db;MVCC=TRUE;LOCK_TIMEOUT=10000" 
 +        } 
 +    } 
 +</code> 
 + 
 +== Virtual Machines in Classroom 6216 == 
 +**Q:** My VM doesn't start and makes a permission errorWhat should I do? 
 +\\ **A:** Your VM has insufficient permissions to run after extraction from the ZIP fileRight-click the extracted directory, go to //properties//, then the //security tab// and grant the //full control// permission to //authenticated users//.