Showing posts with label PostgreSql. Show all posts
Showing posts with label PostgreSql. Show all posts

Tuesday, October 30, 2012

Entando in production: how to prepare a server, how to deploy your Entando based application

Today I suggest you to read the new Entando  guide, "Entando in production: how to prepare a server, how to deploy your Entando based application".
You will find all the necessary instructions to configure an Ubuntu server, install Tomcat, Java, Postgresql and of course Entando
Happy reading

Friday, December 23, 2011

Install Entando on Netbeans

Hi to all,
yes again here speaking about  Entando, after installing it with maven (First step with Entando ), now we go to install Entando using NetBeans 7.01

  java, postgresql, tomcat, NetBeans 7.01 are all present on the PC.
  a postgresql user agile with password agile is configured
  1. Start Netbeans
  2. Create New Project
  3. Select Maven - Project From Archetype click Next
  4. Select Archetypes from Remote Repository
  5. Select Entando: Archetype For Generic Portal (the version number can be different)
  6. Click next and complete the form

yes we've just create a project based on Entando (whow very simple and fast).

Another few important steps
 1. create the db:
  1.1 in your project expand the build.xml file
  1.2 execute  PG-db-full-update this task create the db used by the project

 2. run the project
  2.1 click on run project select your webapp server I suggest tomcat 6.xx

  if all it's ok you'll see this page

  login as suggested in the web page and you see the administration console

Fine yes?
Simple poprtal with no plugin so next question is How can I insert a plugin in my project/portal?
first read the entando guide:
  How to add some Plugins to my own portal based on mavenized Entando  on GitHub

Read it?
Ok, go back to NetBeans
stop tomcat and open pom.xml file
insert the code you find in the entando guide and your pom.xml will look like this

pay attention to change the version (here we have 0.0.1-SNAPSHOT) to the last one, how? easy select 0.0.1-SNAPSHOT  and click ctrlspacebar and Netbeans will suggest you the last number version.
Save the pom.xml file, clean and build your project.

Now it's time to update the db to be compliant with the plugin inserted in the project, so expand the build.xml file and execute the task PG-db-restore-plugins

Run the projcet, login and you can see the plugin in the list.

et voilà, very simple and easy.

Now it's Christmas time so
Happy Christmas to all 


Friday, December 16, 2011

First step with Entando

The new version of Entando is out and as reported in the following post "Enter Maven and GitHub"   mMven and GitHub are used.

mmm ... Maven?
question: how do I install / use the new version of Entando?
answer: ?????

So I started studying a bit of Maven, read the blog posts, wikis, tested,...

So the result is I can install and deploy a portal based on Entando in a few minutes
  java, postgresql, tomcat are all present on the PC.
  a postgresql user agile with password agile is configured .
1. Install maven
2. open a terminal
3. create a directory for the project you want to create
3. cd into the directory you just created
4. type mvn archetype: generate-Dfilter = entando
5. answer the following questions:
5.1 Choose archetype:
1: remote -> org.entando.entando: entando-archetype-plugin-generic (Generic Archetype Plugin for Entando: an agile, modern and user-centric open source portal platform.)
2: remote -> org.entando.entando: entando-generic-portal-archetype (Archetype for Entando Generic Portal: an agile, modern and user-centric open source portal platform.)
Choose a number or apply filter (format: [groupId:] artifactId, contains case sensitive):
choose 2

Choose org.entando.entando: entando-portal-archetype-generic version:
2: 2.4.0
Choose a number: 2:
choose 1 [the list of version may differ we're now on version 4.0]
Define value for property 'groupId':: it.testentando
Define value for property 'artifactId':: testentando
Define value for property 'version': 1.0-SNAPSHOT: (accept default)
Define value for property 'package': it.testentando: (accept default)
displays the list of choices if you run press Y otherwise press N and repeat from step 5.1
That's all now we have a folder containing the created project (in this case testentando).
6.Populate the db
6.1 Configure the buildProperties.xml for your Operatin System
6.2 open a  terminal and type
cd testentando
ant  PG-db-full-update 
This step is not required , no postgres is require for the first run.

7. last step:
in the folder src/main/filters check the properties file to ensure that the configurations of Tomcat and the postgresql password is correct (in case you doesn't use agile/agile).

Now you're ready to start the portal.
  mvn clean jetty:run 


et voilà Entando is running

            The Entando wiki on GitHub
            Entando download

Wednesday, January 5, 2011

OpenBravo installation problem

In these days trying to install from source Openbravo found a lot of problems due to the fact that my version of ubuntu is 10.10 and therefore postgresql 8.3 was  no longer supported.
The error returned was due to the lack of library-postgresql contrib-8.3 no longer supported.
 Googling I found this link that allows  to do download the library and all its dependencies


Greetings and Happy New Year to all

Saturday, April 10, 2010

Intercept null value on a query

These last days working to create a Pentaho report with openERP data, I came across a serious problem:
if a query return a null value arithmetic operations are in error. The question was how to intercept the null value, surfing on Google I found this
SELECT IFNULL (1,0) this query return 1
SELECT IFNULL(null, 0) this query return 0
Fine my problem was solved NO!!  openERP use postgresql and postgresql doesn't support IFNULL
Again surfing on Google and I found COALESCE
The postgresql manual say:
The COALESCE function returns the first arguments of ITS THAT IS NOT NULL. Returned is null only if all arguments are null. Often it is used to substitute a default value for null values 

Finally my problem was solved my query now  is something like this
SELECT COALESCE(sum(aal.amount * -1) , 0) FROM account_analytic_line AS aal WHERE (aal.account_id=83) and aal.journal_id = 3


Sunday, February 28, 2010

Optimizing db performance

A couple of weeks ago my colleague Daniel asked me tips and info on optimizing db.

With the documentation I have, I found a certain number of techniques, some available on opensource DBMS and  other only on proprietary DBMS.
  • Indexing normaly when you query a table all the table data will be read (full table scan). Indexing data is like indexes in a book. So primary key is a special kind of index, it's the unique identifier for a row on the db. How to build indexes? the answer is not easy, but we must always remember that creating a db is not a project but an ongoing process.
    If for example I want to get all the sales ordered by date I will create an index on date_sales field with descending sort order.
    In this way retrieving last week's sales won't be slow.
  • Bitmap indexing this is a sepcial form of index (unfortunatly  not available on MySql) normaly used in columns with a low number of unique values gender, color, ...). The idea is to create for the distinct number of the values in the column, a bit projection is created. This enable faster access to the indexed values.
  • Partitioning introduced in MySql 5.1 it's the capibility  to slice a table into multiple physical pieces. For example a large table containing sales data can be partioned by year so that queries for a given year will be performed only on the portion of the data for the requested year.
  • ...
 This is only a starting point, in future I will investigate Change Data Capture
techniques, use of products such as Kettle, Mondrian, ...
Good eveningRinaldo