Project

General

Profile

Actions

Task #923

closed

Add groovy scripts to product

Added by Patrik Stloukal over 6 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Patrik Stloukal
Category:
Scripts
Target version:
-
Start date:
01/19/2018
Due date:
% Done:

70%

Estimated time:
Owner:

Description

Add useful groovy scripts from project to product.

Actions #1

Updated by Patrik Stloukal over 6 years ago

after consulting i selected more scripts from projects, minor editing

Actions #2

Updated by Patrik Stloukal over 6 years ago

  • Status changed from New to In Progress

consultation with Ondra about usefulness of scripts,
work on scripts, translation, editing, testing

Actions #3

Updated by Patrik Stloukal over 6 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Patrik Stloukal to Ondřej Kopr
  • % Done changed from 0 to 90

I selected and modified 8 scripts from projects, please check it out and write feedback.

commit: https://github.com/bcvsolutions/CzechIdMng/commit/2367e307e924ad176eb37a0518aad11d3ff5b916

Actions #4

Updated by Ondřej Kopr about 6 years ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Ondřej Kopr to Patrik Stloukal
  • % Done changed from 90 to 70

I made feedback (in given commit you only remove some script):

  • getBooleanAsString
  • you compare some of type object and then return "1" or "0", what if this attribute will not be boolean?
  • last line missing,
  • getBooleanFromIntegerInString
  • you return null when values isn't equals to "1" or "0" but in description isn't this behavior described,
  • GetCataloguesForRole
  • is another code than in other scripts,
  • add null check for entity,
  • there is probably better solution: use as parameter ID not whole entity,
  • GetFormattedDate
  • same problem with code as above,
  • in description is write: "Converts Joda's DateTime to 'yyyy-MM-dd HH:mm:ss' string", but this isn't true,
  • parameter "patern" isn't in description,
  • add null check!,
  • GetStringAsLocalDate
  • same problem with code,
  • in doc is write: "Converts String to Local Date as 'dd.MM.yyyy'." this isn't true,
  • GetUserRoles
  • same problem with code,
  • add null check,
  • there is probably better solution: use as parameter ID not whole entity,
  • you find only valid roles, please update name, code and description for this script,
  • your return only distinct names add this behavior to description,
  • GetIdentityAccAccount
  • same problem with code,
  • add null check,
  • in doc is writes: "Returns AccAccount for provided identity and system." but this isn't true,
  • you return false when you didn't find account, describe this behavior to documentation and description,
  • name and code doesn't correspond with behavior, you return if is account in protection,
  • printValue
  • unless allowed class java.lang.System and org.apache.tomcat.util.log.SystemLogHandler,
  • do you checked the script? This isn't works,
  • org.slf4j.LoggerFactory.getLogger("Print Value script") and log.debug doesn't works :(, you must set something like eu.bcvsolutions..., you may check logback,
You create something like utils method for script, this method must be:

In some project will people use this scripts as default pattern for project specific scripts. Is possible, that this only code that administrators see (not developers), so code must be easy to understand. Add a piece of heart to creating these scripts.

Check my feedback and then return this task back to me.

Actions #5

Updated by Patrik Stloukal about 6 years ago

working on feedback issues

Actions #6

Updated by Patrik Stloukal about 6 years ago

i checked these scripts, re write description, add null check and tested

Actions #7

Updated by Marcel Poul about 6 years ago

What is the status now. Currently there are plenty of scripts on many projects. Please add more of them into CzechIdM.
e.g. String to Date, Empty login from HR, find owner by PersonalNumber and many other

Actions #10

Updated by Patrik Stloukal about 4 years ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF