martes, 16 de octubre de 2012

CA Clarity development I (concepts)


Concepts and differences:

Portlets


Provide information in real time for CA Clarity PPM users, most suitable when your query data contains only one or two dimensions(metrics); from different objects

-Grid portlet. based in data from a dataprovider such as Object, System, Clarity Query (NSQL).  

Real only when dataprovider is a Clarity Query (NSQL).

If your grid contains virtual columns, the source data for those columns must be defined in the query that supplies data to the grid.



 --A hierarchical grid portlet can be used to show the structure of data that has more than one level. A parent row can have multiple child rows, and the data that shows in the parent row can be an aggregate of the child data.




Lookups


Static List
Dynamic Query. NSQL is supported in Query.


Hidden key * : Lookup Code /Lookup Enum (type to use in database)
* Important to decide which type use before Save.

After choose hiddenkey
ID (enter once+unique): *
* will assigned to previously chosen field in hiddenkey

LOOKUP_CODE is character type on the database,(if chose "enum", it will contains same number)
LOOK_ENUM is numeric type on the database, use when values are numbers,(if chosen "code", it will contains 0)



"Object" not required for a Dynamic query
Parent Window tab
"Hidden Key" is associated to the field in the first SELECT sentence, (value will be stored in the destination attribute and database)
"Display Attribute":(Output field) will display the content of this field in the attribute, after lookup selection.


Notes:
Lookup configuration is reset. After changes in Query, configuration for Display Attribute and Browse window has to be reconfigured. (Avoid surprises with config documentation)

Attribute Lookup(string)  and Hidden Key. Hidden key will pass the complete result to attribute but it is limited to 30chars, so a bigger string will give error "Error:Value is too large" (verified in v13.1)

Attribute "Data Type" takes its value when it is associated to a lookup for first time, so it will take the type of lookup output (Parent Window )

Be careful!!! because if you change the lookup output field and it has a different type then the attribute will display an error on the web. Furthermore the "Data type" of a lookup attribute is read only the first association to a lookup, so you need to create a new attribute with the correct "Data type".

How to pass parameters to the query:

  • from attribute mapping


Put  @WHERE:PARAM:USER_DEF:INTEGER:xxxx@ in the WHERE clause
Create an attribute and associate with previous lookup, press Save
Now, attribute showsin the bottom the section "Lookup Parameter Mappings"
Select an attribute to map to parameter; from the list of attributes available for this object.


*INTEGER or any other Data type.

  • from the web address (Xpath)
@where:param:xml:integer:/data/xxxx/@value@

xxxx=field in the address such as id, projectid, object_id, etc...
value=returns the value after symbol "="

i.e /niku/nu#action:projmgr.projectProperties&id=1234567&classCode=project
@where:param:xml:integer:/data/id/@value@
returns 1234567


Note: be careful with this pameters because the query could not work as expected with other views containg the lookup, since views can have different fields in the web address.


NSQL. 


-Comments:
-- line comment
/* */  multiline comment
Must be after the first SQL Sentence, ie
 SELECT   
 -- ver. 1.2 Diciembre2012
  @SELECT:resources.id:prid@,




-Read only queries
-UPDATE, INSERT, and DELETE operations cannot be performed in NSQL.
-not recommend using NSQL for reporting or for stored procedures
- Data types: STRING, INTEGER, FLOAT, IMPLIED, FLOAT,DATE, MONEY (in SELECT)

-Dimension Properties Column
@SELECT:DIM:USER_DEF:IMPLIED:::
:
:

New lookup
In "Source" select "Dynamic Query", Submit/Save
In "Query" tab, "Query" text box, enter NSQL query, Save
In "Browse Window" click on the "Preview" button
(a window popup with the query results will be showed).




CA Clarity technical Administration

CA Clarity Administration stuff


Common network ports: 
Clarity app
http 80, 1024, ..
https 8043

Reporting(BO) 
http 8080

Clarity NSA
http 8090
https 8093

Configuration from NSA
BO config: Servers, Properties, reporting
DB config: Servers, Properties, Database
Java app config: Servers, Properties, Application
Logs: Servers, Logs


Version Upgrade
Check  "Data Model Changes" in "CAClarityPPM_ChangeImpactandUpgrade_Guide_ENU.pdf" file in order to be aware of changes in tables.


Queries and  Oracle databases
SQLTools
DBVisualizer

XOG compatibility

Clarity v.12.1 SP1
i.e. XOG 10.50.0.125
Clarity v.13
i.e. XOG 14.0.0.162

Testing XOG from Clarity web
 v12.

……/niku/app?action=xog.client
 v13.
……/niku/nu#action:xog.client

Server info
 ../niku/monitor.jsp
i.e info:

DB_LOGIN=1 LOGIN_SUCCESS=1 LOGIN_TIME_MS=19 NJS_HEARTBEAT_S=52 PE_HEARTBEAT_S=289 LAST_TIMESLICE_S=24 IS_TS_ROLLOVER_DATE=0

../niku/BOServerStatus.jsp

Info about Servers Status, General metrics, Queue metrics

Flush Caches
Flushing caches

v13
../niku/nu#action:security.caches
v12
../niku/nu?action=security.caches



System Locks

v13
../niku/nu#action:security.locks
v12
../niku/app?action=security.locks



 See Server Security Logs
.../niku/nu#action:security.logs

Log filenames and messages:


 bg-ca.log 

Contains info about errors in scheduled reports and Jobs


i.e
....
ERROR 2013-05-24 18:30:03,137 [Dispatch pool-4-thread-2 : bg@serverappxxx.domain.com (tenant=clarity)] niku.njs (clarity:username:9333263__C1AA4D20-121B-43DE-B006-74E7A3366435:schedule_job_Autoschedule Project) Error executing job: 5041627
com.niku.union.utility.MessageKeyException: PRJ-SE04: Could not execute autoschedule job (5041647): Unparseable date: "21/05/2013"
    at com.niku.projmgr.autoschedule.jobs.AutoschedulerJob.scheduledEventFired(AutoschedulerJob.java:91)
    at com.niku.njs.Dispatcher$BGTask.run(Dispatcher.java:292)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
   

nsa-system.log
...
Wrapper Started as Daemon
Clarity 13.1.0.0248 initializing...
GMS: address=appservernamexxx-xxxxx, cluster=CLRTY-SA, physical address=x.x.x.x:ppppp
Clarity 13.1.0.0248 ready.
INFO: Server startup in 52214 ms
TERM trapped.  Shutting down.
Wrapper Stopped
....
nsa-ca.log
niku.union (none:none:none:none) Clarity 13.1.0.0248 initializing...
..
niku.union (none:none:none:none) Initializing: tower...
niku.union (none:none:none:none) Initializing: monitor...
niku.union (none:none:none:none) Initializing: nsa...
niku.union (none:none:none:none) Initializing: wmd-init...
niku.union (none:none:none:none) Clarity 13.1.0.0248 ready.
...
config.TenantConfigurationManager (none:none:none:none) Properties/Database: id: clarity
...
niku.union (none:none:none:none) Destroying: tower...

admin.log
 ...
[echo] CA Clarity Accelerator: Program Management Office installation was successful and is complete.
[echo] Check the install.log for errors that might not have been handled.
[echo] Package Installation Successful - 08-April-2013 21:00:01
...
[exec] Content Pack csp version 13.0.1.0102 has been deployed
[exec] DBTools Log - Mon Apr 08 22:28:02 CEST 2013
[echo] Clarity Solution Pack installation was successful and is complete.
[echo] Check the install.log for errors that might not have been handled.
...
(admin)     Following object(s) are invalid:

app-ca.log (application errors)
...
ERROR yyyy-mm-dd hh:mm:ss,mmm [http-bio-14001-exec-xxx] grid.EditListRowServiceImpl (clarity:username:sesionid:GetListContextByRow) Fatal error getting row metadata for project [projectid]
ERROR yyyy-mm-dd hh:mm:ss,mmm [http-bio-14001-exec-xxx] out.service (clarity:username:sesionid:GetListContextByRow) A RuntimeException encountered in Service. Converting to OSFApplicationException.
java.lang.RuntimeException: org.json.JSONException: JSONObject["column"] not found.

WARN  yyyy-mm-dd hh:mm:ss,mmm [http-bio-14001-exec-xxx] web.WebSession (clarity:username:xxxxxxxx__SESSION_ID:odf.filter) A request has been denied as a potential CSRF attack. Request Information-
USER_ID=xxxxxxx
SESSION_ID=xxxxxxxxx
CLIENT_IP_ADDRESS=x.x.x.x
XFF_ADDRESSES=null

app-access-yyyy-mm-dd.log
(from Apache Tomcat)

serverip|[dd/mm/yyyy:hh:mm:ss +0200]|GET /address/file HTTP/1.1|aaa|bbb|cc|token

session id token: i.e. userdid__xxxxaxxe:xxxbaexxxax:-xxxxxxxxxxxxxxxxx
Userid is before the double underscore (__).
Finally, you can locate that user by selecting into the cmn_sessions table.


IP address of requestor
DateTime of the completed request
URL request
HTTP Status Code
Bytes sent back to the client (excluding the header)
Elapsed time of the request (in ms, can be subtracted from the DateTime to get the request startTime)
Clarity sessionId cookie (a distinct way to group requests, can be tied back to the sessions tables in Clarity to find the user)

- no results return to client for this field
aaa=code that the server sends back to the client
2xx= Successful
200= OK
3xx= Redirection
4xx= Error caused by the client
5xx= Error caused by the server

bbb= size of the object returned to the client, not including the response headers.

x.x.x.x|[dd/MM/yyyy:hh:mm:ss +0200]|GET /niku/ui/uitk/gwt/com.ca.clarity.Gantt/Dxxxxxxxxxxxxxxxxxxxx.cache.html HTTP/1.1|200|325759|1803|-
x.x.x.x|[dd/MM/yyyy:hh:mm:ss +0200]|GET /niku/wsdl HTTP/1.0|200|321|1|-

Debug Mode

v12.
https://servername.com/niku/app?action=xxxxxxxxxx&debug=1
XML output


XML Open Gateway (XOG)
web service interface that you can use to:
  *Import data
  *Export data
  *Move configuration data from one system to another
to read data from or write data to CA Clarity using XML and web services
GEL tags that can be used with XML for more advanced custom integration tasks
CA Clarity web services use XML messages that follow the SOAP standard.


jueves, 4 de octubre de 2012

CA Clarity / Openworkbench / Ms Project

Clarity and Opera
Browser compatibility

***Clarity PPM12/13
Web working on Firefox3/10/Opera




Firefox and Clarity
Firefox Toolbox for Clarity     

Firefox portable 3.6.28
+Addons (specific versions for FF3)
chickenfoot107.xpi
colorfultabs-4.6.5-fx+sm.xpi
web_developer-1.2.2-fx+sm.xpi
tabrenamizer-0.9.6-fx.xpi   (*)


tabrenamizer: rules for tab names

(*) Note: web addresses change between Clarity v12 and 13.
It is a pity that "tabrenamizer" doesn't support wildcards  :(


Chickenfoot Scripting for Clarity


Use CF foot methods and Javascript to automate tasks


Web differences between v12/v13
First line v12, second line v13

Web addresses
../niku/app?action=projmgr   (v12)
../niku/nu#action:projmgr (v13)
Elements
 button= "Class"="sectionBarBtn"
 button= "Class" ="ppm_button"



Default script folder:
C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles\104679cl.default\chickenfoot
FirefoxPortableLegacy36\Data\profile\chickenfoot



--------------
Project Professional 2010 v14.0.6+CA Clarity PPM Microsoft Project interface

C:\Users\myuser\AppData\Local\Temp
~DF32E99829250D82AE.TMP

files related to Clarity/MSproject

When project is Saved to Clarity the mpp file is uploaded and stored in Clarity server
(PRDOCUMENT table  as BLOB information)

 Plugin for Ms Project files and folders

C:\Program Files (x86)\CA\Clarity\CA Clarity PPM MSPInterface
C:\Program Files (x86)\CA\Clarity\CA Clarity PPM Schedule Connect
file .VSTO
(Visual Studio Tools for Office) Visual Studio add-in (project templates)

MSPAdd2K.mpp
C:\Program Files (x86)\CA\Clarity\CA Clarity PPM MSPInterface\data

to know which  version of Schedule connect is installed:
 java -cp "C:\Program Files (x86)\CA\Clarity\CA Clarity PPM Schedule Connect\lib\version.jar" com.niku.tools.VersionNumber

i.e output : Niku 13.0.1 Build 0102
                  Niku 12.1.2 Build 1260



HKEY_CURRENT_USER\Software\Niku\Schedulers\MPPLookup
info about last open projects and local path with mpp file

HKEY_CURRENT_USER\Software\Niku\Schedulers
database connection data (host, login, port...






-------
Openworkbench Advanced

***Openworkbench 1.1.6
Requires Java version 1.5 or later

***Openworkbench 2.0
Requires Java 1.7?
-------------



 SCHEDLINK

This software is an  interface between web browser and OpenWorkbench, so if our web browser cannot open project in OWB, you have to associate  MIME type to SCHEDLINK. 






SchedLink.exe" sched.nikusl  (by default Silent mode)
SchedLink.exe" /s /d  (setup with output)

Old path
"C:\Program Files\Clarity\Schedule Connect\bin\SchedLink.exe" sched.nikusl /d

New path
"C:\Program Files (x86)\CA\Clarity\CA Clarity PPM Schedule Connect\bin\SchedLink.exe" sched.nikusl /d

/s (setup in silent mode)
it just associate  NIKUSL object to Schedlink (Internet  Explorer)
(Registry: HKCR\MIME\Database\Content Type\application/nikuscheduler\Extension=.nikusl)

/d show output log to c:\SchedLink.log


 Openworkbench/MSP conection file (sched.nikusl)


A project is associated to a specific Scheduler by attribute "Scheduler Format"(Eng) or "Formato del programador" (Spa) (ID: prformat)


Available from UI, Schedule, Tracking




Depending of scheduler associated to a project, downloaded sched/sched.nikusl file will have one of following values:

sched = npWorkbench
sched = msp



Example of MSP (sched.nikusl) received from Clarity.
file = Projname
repo = NIKU
app = null
session = 7594029__D65BAB9D-5B2D-48DC-B282-9CC65AE806D5
projectId = 6037252
driver = HTTP
url = https://myserver.myclarity.es/niku
sslLoginURL = null
sslHandling = SSL_FULL
userName = username
readWrite = false
sched = msp

Example of OWB file received from Clarity.

file = conection_test
repo = NIKU
app = null
session = 35022901__-b554f40:124971fe3a2:-78d61258623780532
projectId = 5203045
driver = HTTP
url = http://my.clarityserver.company.com:8080/niku
sslLoginURL = null
sslHandling = SSL_NONE
userName = username
readWrite = true
sched = npWorkbench