[Dhis2-devs-core] dhis.conf

2015-11-11 Thread Lars Helge Øverland
Hi devs,

a new solution for dhis configuration is in place and the conf file should
now be called:

*dhis.conf*

The db related properties are now:

connection.dialect = org.hibernate.dialect.PostgreSQLDialect
connection.driver_class = org.postgresql.Driver
connection.url = jdbc:postgresql:dhis2demo
connection.username = dhis
connection.password = dhis
connection.schema = update


This means we have db agnostic configuration instead of the hibernate
proprietary setup. The existing hibernate.properties conf filename and
hiberate.connection.. properties will be supported for another year to give
people time to upgrade.


>From Java code you can now get general config from interface:

DhisConfigurationProvider


Would be good if you could test it by updating your conf file in your local
environment.

Lars





-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org 
-- 
Mailing list: https://launchpad.net/~dhis2-devs-core
Post to : dhis2-devs-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs-core
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs-core] dhis.conf

2015-11-11 Thread Lars Helge Øverland
I agree that structure is nice. However, the intention is to keep this as
simple as absolutely possibly. I think the average dhis self-taught sys
admin is a bit familiar with good old property files but not so much with
yaml or json, and the risk for people ending up with invalid config is
high. I can foresee a flurry of dev list emails going like this:

- "the system does not start"
- "if your config file valid yaml?"
- "yaml what?"
- "just read up here http://www.yaml.org/start.html;
- "no i don't need to invoice basketballs"
- "can you post your config file?"
- "yes"
- "no don't include your password, now you must reset it"
- "okay i set it to Pass123 now"
-- 
Mailing list: https://launchpad.net/~dhis2-devs-core
Post to : dhis2-devs-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs-core
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs-core] dhis.conf

2015-11-11 Thread Jason Pickering
Hi Lars,
Great idea, and I am sure it will be useful.

Just to be a bit difficult as I usually am however.

In some scripts (mostly Python) i have used YAML for these sorts of
configurations.  The advantage is it is pretty human readable, and yet
 more structured than plain text files, so it would be perhaps easier to
allow people to edit the configuration through the UI, or diagnose what is
wrong with the file. It would also allow for a more complex configuration
file, if it is ever needed.

This is what your config file would look like in YAML.

---
database:
  dialect: org.hibernate.dialect.PostgreSQLDialect
  driver_class: org.postgresql.Driver
  password: x
  schema: update
  url: "jdbc:postgresql:dhis2"
  username: dhis
encryptionKey: SomethingVerySecret
filestore:
  container: dhis2-filestore
  identity: dhis2-id
  location: eu-west-1
  provider: filesystem
  secret: 
ldap:
  manager.dn: "cn=JohnDoe,ou=Country,ou=Admin,dc=hisp,dc=org"
  password: 
  search.base: "dc=hisp,dc=org"
  search.filter: "(cn={0})"
  url: "ldaps://300.20.300.20:636"
systemID: www.datim.org

Not that much different really, and should be easily conveted into a Java
object, maybe with something like https://bitbucket.org/asomov/snakeyaml.

Regards,
Jason


On Wed, Nov 11, 2015 at 1:53 PM, Lars Helge Øverland 
wrote:

> A default full config file can be found here:
>
> https://github.com/dhis2/dhis2-utils/blob/master/resources/conf/dhis.conf
>
>
>
>
> --
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to : dhis2-devs-core@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Jason P. Pickering
email: jason.p.picker...@gmail.com
tel:+46764147049
-- 
Mailing list: https://launchpad.net/~dhis2-devs-core
Post to : dhis2-devs-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs-core
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs-core] dhis.conf

2015-11-11 Thread Lars Helge Øverland
A default full config file can be found here:

https://github.com/dhis2/dhis2-utils/blob/master/resources/conf/dhis.conf
-- 
Mailing list: https://launchpad.net/~dhis2-devs-core
Post to : dhis2-devs-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs-core
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs-core] dhis.conf

2015-11-11 Thread Bob Jolliffe
For similar (tangentially related) configuration, I have used json.
See below.  Either yaml or json (or even dreaded xml), I agree with
Jason that a bit of structure can be beneficial.  Yaml syntax is maybe
the most forgiving for user editing by hand.

{
"dhis2Systems" : {
"hmis" : {
"type" : "dhis2",
"name": "hmis",
"baseUrl": "http://hmis:8080/hmis;,
"user": "synch",
"password": "x"
},
"hietest" : {
"type" : "dhis2",
"name": "hietest",
"baseUrl": "http://dhis:8080/hietest;,
"user": "synch",
"password": "x"
},
"datawarehouse" : {
"type" : "dhis2",
"name": "datawarehouse",
"baseUrl": "http://dhis:8084/datawarehouse;,
"user": "synch",
"password": "x"
},
"healthfinance" : {
"type" : "dhis2",
"name": "healthfinance",
"baseUrl": "http://dhis:8083/healthfinance;,
"user": "synch",
"password": "x"
},
"idsr" : {
"type" : "dhis2",
"name": "idsr",
"baseUrl": "http://idsr:8082/idsr;,
"user": "synch",
"password": "x"
},
"rbc" : {
"type" : "dhis2",
"name": "rbc",
"baseUrl": "http://dhis:8081/rbc;,
"user": "synch",
"password": "x"
}},
"otherSystems" : {
"resourceMapper": {
"type" : "resourceMapper",
"name": "facilityRegistry",
"baseUrl": "http://facilities.moh.gov.rw/collections/424/fred_api/v1;,
"user": "rwsy...@gmail.com",
"password": "x"
}},
"roles" : {
"orgunitMaster" : "hmis",
"orgunitSlaves" : [ "idsr", "hietest","healthfinance","rbc","datawarehouse" ]
},
"datasetShare" : {
"epi" : {
"datasets": [ "VAC_RETURNS", "MIDWIFE_RETURNS" ],
"orgunitGroup": "epi",
"source": "tracker",
"destination": "dhims"
}
},
"pdo_dsns" : {
"hmis" : "pgsql:host=pgserver port=5432 dbname=hmis user= password=x"
}
}


On 11 November 2015 at 13:41, Jason Pickering
 wrote:
> Hi Lars,
> Great idea, and I am sure it will be useful.
>
> Just to be a bit difficult as I usually am however.
>
> In some scripts (mostly Python) i have used YAML for these sorts of
> configurations.  The advantage is it is pretty human readable, and yet  more
> structured than plain text files, so it would be perhaps easier to allow
> people to edit the configuration through the UI, or diagnose what is wrong
> with the file. It would also allow for a more complex configuration file, if
> it is ever needed.
>
> This is what your config file would look like in YAML.
>
> ---
> database:
>   dialect: org.hibernate.dialect.PostgreSQLDialect
>   driver_class: org.postgresql.Driver
>   password: x
>   schema: update
>   url: "jdbc:postgresql:dhis2"
>   username: dhis
> encryptionKey: SomethingVerySecret
> filestore:
>   container: dhis2-filestore
>   identity: dhis2-id
>   location: eu-west-1
>   provider: filesystem
>   secret: 
> ldap:
>   manager.dn: "cn=JohnDoe,ou=Country,ou=Admin,dc=hisp,dc=org"
>   password: 
>   search.base: "dc=hisp,dc=org"
>   search.filter: "(cn={0})"
>   url: "ldaps://300.20.300.20:636"
> systemID: www.datim.org
>
> Not that much different really, and should be easily conveted into a Java
> object, maybe with something like https://bitbucket.org/asomov/snakeyaml.
>
> Regards,
> Jason
>
>
> On Wed, Nov 11, 2015 at 1:53 PM, Lars Helge Øverland 
> wrote:
>>
>> A default full config file can be found here:
>>
>> https://github.com/dhis2/dhis2-utils/blob/master/resources/conf/dhis.conf
>>
>>
>>
>>
>> --
>> Mailing list: https://launchpad.net/~dhis2-devs-core
>> Post to : dhis2-devs-core@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs-core
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>
>
> --
> Jason P. Pickering
> email: jason.p.picker...@gmail.com
> tel:+46764147049
>
> --
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to : dhis2-devs-core@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help   : https://help.launchpad.net/ListHelp
>

-- 
Mailing list: https://launchpad.net/~dhis2-devs-core
Post to : dhis2-devs-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs-core
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs-core] Update to like/ilike

2015-11-11 Thread Morten Olav Hansen
Hi everyone

I just pushed some code that enables the new in-memory filter engine, in
that I have also added a few new operators, and updated a few old ones.

The new operators are documented here
http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s07.html

Please note that we now also have proper support for like and ilike, so you
might need to update your apps to use :ilike: instead of :like: if you
expect non case sensitive.

Please let me know if you see any issues.

--
Morten
-- 
Mailing list: https://launchpad.net/~dhis2-devs-core
Post to : dhis2-devs-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs-core
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs-core] dhis.conf

2015-11-11 Thread Jason Pickering
Hi Lars,
Yes, I see your point, and maybe even YAML is too much. Having two leading
spaces could be too much to task.

Anyway, I thought I would at least suggest it, but if a plain old
properties file works, then lets not over-engineer it for the moment. I can
just possibly envision a situation where you would like to specify a lot
more in the properties file than just the database connection. But  that is
not the immediate concern of course.

Regards,
Jason


On Thu, Nov 12, 2015 at 2:23 AM, Morten Olav Hansen 
wrote:

> What about at least using a standard extension like .properties?
>
> --
> Morten
>
> On Wed, Nov 11, 2015 at 11:28 PM, Lars Helge Øverland  > wrote:
>
>> I agree that structure is nice. However, the intention is to keep this as
>> simple as absolutely possibly. I think the average dhis self-taught sys
>> admin is a bit familiar with good old property files but not so much with
>> yaml or json, and the risk for people ending up with invalid config is
>> high. I can foresee a flurry of dev list emails going like this:
>>
>> - "the system does not start"
>> - "if your config file valid yaml?"
>> - "yaml what?"
>> - "just read up here http://www.yaml.org/start.html;
>> - "no i don't need to invoice basketballs"
>> - "can you post your config file?"
>> - "yes"
>> - "no don't include your password, now you must reset it"
>> - "okay i set it to Pass123 now"
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> Mailing list: https://launchpad.net/~dhis2-devs-core
>> Post to : dhis2-devs-core@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs-core
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> --
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to : dhis2-devs-core@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Jason P. Pickering
email: jason.p.picker...@gmail.com
tel:+46764147049
-- 
Mailing list: https://launchpad.net/~dhis2-devs-core
Post to : dhis2-devs-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs-core
More help   : https://help.launchpad.net/ListHelp