Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grails3 #11

Open
wants to merge 54 commits into
base: consoherozh
Choose a base branch
from
Open

Grails3 #11

wants to merge 54 commits into from

Conversation

artlog
Copy link

@artlog artlog commented Sep 27, 2022

Upgrade to grails3

- for dev purposes on my local system
- created a new project from scratch and copied source within
- adapted import with new packages names ( codehaus not used in naming anymore )
- incrementaly added dependencies
  - BuildConfig.groovy does not exists anymore it is in build.gradle
  - tried to get newer versions of libraries
  - addded gpars library dependency ( can't find how it was done before )
- replaced @Validateable annoation by implements since it is no more an annotation
- changed some dos formatted files to unix ( fromdos )

- WARNING : moved AsynchronousMessageAspect since not found where aspectj dependency was

- did compile with grails 3.3.14
   - sdk use grails 3.3.14
   - grails compile

- moved back changes from new project into grails3 branch
- compiles and start but broken ( web-app content to rebuild )
- update dependencies for runtime start
- in esb routes changes property.xxx to exchangeProperty.xxx
- reset template ( to fix )
- removed sitemesh.xml, org.codehaus.groovy.grails.web.sitemesh.GrailsHTMLPageParser obsolete (to fix )
- move config into application.grooxy ( not in application.yml yet )
  - todo move log4j in logback.groovy
- settings.gradle : change back to smarthome-application
- project documentation specific to ConsoHerozh in french.
- user documentation within documentation directory
  - account registration in french
- fix typo in view
- screenshots and initial french documentation
- add in french device chart for linky documentation
- update README with link to faq
- name or pseudo of user is not used for login, only mail.
where is it is used in facts ?
- still login will fail, but page is fully displayed and assets loaded.

- update with hibernate-core:5.1.16.Final
- update within springsecurity
- readd aspectj and AsynchronousMessageAspect

- to rework fully : external properties removed
  - grails.config.localtions are not supported anymore in grails 3
    should align with spring boot
- now it is possible to login

- changed some j_xxx to xx
  - see spring-projects/spring-security#3010
  for naming changes.
- see sample/smarthome-config.yml for external config
- DataConnectApi factorize enedes.env url with getEnedisUrl
- hack through profil.gsp to pass user.id since user gets a string instead of a User
  - to check did not spot why this is lost.
  - reactivate User usage if origin of problem found
- use ajax-tag before reworking <g:remoteLink> usage
- move BootStrap.groovy within application package

- BUG : user can't be modified, saving does silently nothing
- GORM 6.1.x Flush Mode Now COMMIT by Default
  - force AUTO ( does not persist without ).
- replace any @transactional annotation to be grails.gorm.transactions.Transactional
- move java sources within src/main/groovy ( and wihtout java directory ).
- upgrade spring security core to 3.3.1 ( correct version to match grails 3.3.x ).

- now manual counters are correctly stored.
- TODO : study how to manualy flush sessions and remove hibernate.flush.mode=AUTO
- force hibernate.flush.mode COMMIT that actually forces a hibernate Session flush at jdbc commit
  - wonder why not passing through HibernateGormStaticApi.createHQL query that does this.
- deviceType Linky , ajout Installation.
- remove some old unused code comment
- fix Exception outdated text 'lims.cluster.serverId'
- User transient springSecurityService was null , fixing it
- new bean UserPasswordEncoderListener capture any insert/update event
  and automatically encode passord.
- resources within groovy directory are not placed in build anymore
- should place them within a dedicated src/main/resoruces directory
- upgrade activiti to 5.23.0
  - resources.groovy :
    - in processEngineConfiguration(SpringProcessEngineConfiguration) {
      add databaseSchemaUpdate = true for activiti upgrade
    - in build.gradle use groovy-all version of gradle
      - contains jsr223 script engine
        required to avoid "Can't find scripting engine for 'groovy'"
- fix workflow route camel syntax
  - correct incomplete fix when changeing property to exchangeProperty
    ( was done in 5a8d732 )
    - use ' and ${} with exchangeProperty
    - fix typo echangeProperty to exchangeProperty

- application.groovy changes :
 - reactivead grail.cache.enabled
 - hibernate.flush.mode = COMMIT in one place
 - dbCreate = none ; first database-migration plugin tests
 - System.properties['smarthome.datasource.url'] : not hardcoded even in dev.

- application name is now consoherozh ( settings.gradle rootProject.name )

- reinddented application.groovy to prepare for change to application.yml
- resources.groovy ( unix format )
- updated .ignore
  - build result is in build, not in target anymore.
- within a profile it is possible to select a Chauffage type
  but there is not visible way to create one, added.
- Fix create of a user from an administrator
  - consometers#6
  - create applicationKey on server side on the fly in UserService
- When slecting device and deviceType some icons are missing
  - linky & manual counter icon ( to improve )

- Creating a House within USer profile
  - display profile without error if house is missing
  - Workaround a stackoverflow infinite recursion when saving a profile with a house.

- cleanup some unused imports
- whenever there were any roles , UserRole.removeAll(user) was done
  but any create was silently failing and other edited fields of user
  where not recorded either
- rewrite it to detect what was added and what was removed.
  - special care when there is only one role, user.roles is then a String
    and not an array.
- minifyJs causes problems, deactivate it ( just like in previous prod )
- versions in gradles.properties
  - use hibernateVersion 5.1.17 Final
- tries ehcachce with js-107 but grails 3.3. is still too old
  - use latest ehcache
  - set ehcache-core as exception since it is subset of ehcache potentialy older
    and conflicting
- set spring-boot-starter-tomcat as provided to not get embedded jars
   - remark : ship war.original version.
- reactivate dbCreate = "update" to update databse with this new version.
- device is created twice within same action
  - removeIndex does create device
  - getIndices recreate another device

- quick fix
  - flushing device at creation

WARNING there is a clear problem of gorm/hibernate/jdbc
        session/transactions synchronization.
- log a warning mutliple devices with same type name but continue
  - select last one, assuming it is the most recent.
- don't create a device at removeindex call if none was matching
…rk cdn

- move consoherozh javascript and stylesheet to consoherozh sub folder
- create a consoherozh-app.js/css to handle asset-pipeline inclusion

- update chartjs to 3.x ( 3.3.1 since problems with 3.7.1 ).
  - update components.js related code to migrate
    https://www.chartjs.org/docs/latest/getting-started/v3-migration.html

- embed javascript previously provided by content delivery network
  - packery 2.1.2
  - draggability 3.0.0
  - bootstrap-5.1.3

- todo
  - check bootstrap-components.js usage
   - const bootstrapStyleTag does access cdn content
  - ionicons : how to not rely on cdn ?
- chartjs 3.4.1 is the last published working version with our code
  - test with chartjs 3.5.1, 3.6.2  and 3.7.1 displays an empty chart.
- backend provision, no web/GUI api

- standbyPowerUsage
  minimal power consumption over a period
  intends to compute power wasted by devices in standby mode
  parameters :
   'device.id' mandatory id of device
   'start' mandatory string formatted dd/MM/yyyy HH:mm
   'period' reference period in seconds, default to 1 day ( 24*36000 s)
   'end' optional string formatted dd/MM/yyyy HH:mm
      if not set default to start + period as days

- sample to get a minimal day power over 3 month range :
http://localhost:8080/device/standbyPowerUsage?device.id=351866&start=20/02/2021%2000:00&end=20/04/2021%2000:00&period=82400
…ead of 'kWh' consometers#7

- replace 'L' by 'kWh' in electricity counter
- rename standbyPower to IdlePower
- add a controller buildIdlePowerForMonth to build missing idle entries for a month
  - add all entries for first day of month to last day ( disregard day of month )
- persist within DeviceValueDay and DEviceValueMonth with 'idle' name
- limit period detection to 30 days, if above it is considered to be 30 days
- add a GoogleDataTable entry for month and year view for idle ( actualy in red ).

- todo : use another way to compute period
  - null / 'baseinst' ratio (values for these names)
   could help since null is related to 1 hour.
- fix use dayOffset naming instead of dayOfMonth since starts from 0.
- move user/charts.js navigation binding code into components.js
  - rewrite it without jQuery
- create a _linkyDashboardChart.gsp to replace linky/linkyChart
  - where javascript is embedded
- add toChartJsCurve into GoogleChart to provide a JSON content

broken , to fix :
- month and year period should have right x names
- provide datatable support
- graph fully blank if no data for period.

Todo : move into a dedicated javascript .gsp <script> embedded code.
- use chartjs 3.4.1
  - 3.5.1 fails sliently to displays manual counters, keep 3.4.1
  - embed chartjs directly in app asset don't rely on cdn.
- group consoherozh javascripts
  - create a consoherozh-app.js to include directory
  - move scripts to consohezozh/ directory like what was done for user/
- move javascript code of _linkyDashboard.gsp into linky.js
  - keep only glue with chart
- manual counter for electricity should be proposed onyl if linky is not working
  - don't call javascript for a non existing component
  - querySelectorLast had no counter-manual to operate on.
- warning buggy, to be completed
- allows to change chart content withotu reloading full page

- todo/fix
  - labels for month/year ( currently days ).
  - next/prec day/month increase/decrease day/month.
  - idle data from server
  - table with datas
- fix: use relative url, was hardcoded for local dev
- prev/next date update
  - captured from command and retrofitted into form
- labels hour/day/month delegated to chartjs code
- date in 24 hours
  - was displaying hour and hour + 12 on same column
- add idle curve
	- backend : select by label non-Date values
- frontend, if idle curve is provided, use it, else build it
- duplicates graphs, hide those not used
- set units to right value
- move navigation chart form initialization within linky.js
- reset values to emplty list when no data
- compute idle value from DeviceValue with name null
  - this value should be correct power obtained from enedis
    independent of interval, for one hour.

- temporary add a checkbox that will trigger persitent computation of idle
  for the period.
  - this checkbox uncheck at each resuest and works only for day and month
    - for year it should be done on each month one by one.
- When checkbox is actived perido will be rebuild at next request
 - automatically deactivated at each request
- grails dataBingin with checkbox field javascript workaround
 - from client to server, set value
 - from server to client, set checked
- last day of month was missing
- fix title and tooltips
- realign
- on monthly graph bar represent daily consumption
- on yearly graph bar represent monthly consumption
- replace Wh with kWh for non daily periods.
- clicking on bar in year will display month graph
- clicking on bar in month will display day graph
- fix initial view
- change computation in buildIdPowerForMonth
  - use a sum over DeviceValueDay, not a min over DeviceValue for month
  - if days are missing expand value to whole month.
…le of columns

- set label to middle of columns ( offset: true and don't realign data ).
- change day label to include day of week (ddd)
- for month only, gather max value and display it.
…ometers#9

- mark notificationAccount config property as dirty
  - this then will trigger an update
- when refresh token is refused, actualy set expired to 'true'
  - an exception was thrown that did rollback on exception
@artlog
Copy link
Author

artlog commented Sep 27, 2022

For Issue #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant