↓ Skip to main content

Atg

ATG Module Diagram Generator

·302 words·2 mins
I have found local clone of this repo while cleaning up the disk. The source was originally residing in private repo on Bitbucket which I moved to GitHub: https://github.com/miroadamy/atgdiagram What it does # Groovy scripts: https://github.com/miroadamy/atgdiagram/blob/master/src/listATGModules.groovy https://github.com/miroadamy/atgdiagram/blob/master/src/ATGModule.groovy that scan local ATG installation, discover modules and generate the PlantUML file representing it, for example - https://github.com/miroadamy/atgdiagram/blob/master/uml/test2.uml Using ATG_ROOT from environment variable $ATG_ROOT: /opt/ATG/ATG10.0.2 Using /opt/ATG/ATG10.0.2 installation Dependants of module TWeStore.eStore => [DCS.Search.Query, B2CCommerce, DAF.Search.Query, DAF.Search.Base, DCS.Search.common, DPS.Search.Index, DAF.Search.common, DAS-UI, DCS.Search.Index, DPS, DCS, DCS.Search.CustomCatalogs, DCS.Search.CustomCatalogs.Query, DCS.Search.CustomCatalogs.Index, DAF.Search.Routing, DCS.Search.CustomCatalogs.common, DAF.Search.Index, DSS, DCS.CustomCatalogs, DAS] @startuml Object TWeStore_eStore Object DCS Object B2CCommerce Object DCS_Search_CustomCatalogs Object DAF_Search_Routing Object DCS_CustomCatalogs Object DPS Object DCS_Search_CustomCatalogs_Query Object DAF_Search_Base Object DCS_Search_CustomCatalogs_Index Object DSS Object DAS_UI Object DCS_Search_Query Object DCS_Search_CustomCatalogs_common Object DAS Object DCS_Search_Index Object DAF_Search_Query Object DCS_Search_common Object DPS_Search_Index Object DAF_Search_Index Object DAF_Search_common TWeStore_eStore <|-- DCS TWeStore_eStore <|-- DCS_CustomCatalogs TWeStore_eStore <|-- B2CCommerce TWeStore_eStore <|-- DCS_Search_CustomCatalogs TWeStore_eStore <|-- DAF_Search_Routing DCS <|-- DPS DCS <|-- DSS B2CCommerce <|-- DCS DCS_Search_CustomCatalogs <|-- DCS_Search_CustomCatalogs_Index DCS_Search_CustomCatalogs <|-- DCS_Search_CustomCatalogs_Query DAF_Search_Routing <|-- DAS_UI DAF_Search_Routing <|-- DAF_Search_Base DCS_CustomCatalogs <|-- DCS DPS <|-- DAS DCS_Search_CustomCatalogs_Query <|-- DCS_Search_Query DCS_Search_CustomCatalogs_Query <|-- DCS_Search_CustomCatalogs_common DAF_Search_Base <|-- DAS_UI DCS_Search_CustomCatalogs_Index <|-- DCS_Search_Index DCS_Search_CustomCatalogs_Index <|-- DCS_Search_CustomCatalogs_common DSS <|-- DPS DAS_UI <|-- DAS DCS_Search_Query <|-- DAF_Search_Query DCS_Search_Query <|-- DCS_Search_common DCS_Search_Query <|-- DCS DCS_Search_CustomCatalogs_common <|-- DCS_Search_common DCS_Search_CustomCatalogs_common <|-- DCS_CustomCatalogs DCS_Search_Index <|-- DPS_Search_Index DCS_Search_Index <|-- DCS_Search_common DCS_Search_Index <|-- DCS DAF_Search_Query <|-- DAF_Search_common DCS_Search_common <|-- DAF_Search_common DCS_Search_common <|-- DCS DPS_Search_Index <|-- DPS DPS_Search_Index <|-- DAF_Search_Index DAF_Search_Index <|-- DAS_UI DAF_Search_Index <|-- DAF_Search_Base DAF_Search_common <|-- DAS_UI DAF_Search_common <|-- DAF_Search_Base DAF_Search_common <|-- DAF_Search_Routing @enduml This UML file is the processed by PlantUML

Starting ACC (ATG Control Centre) on OS-X

·102 words·1 min
Copy the installation of ACC for respective version from a Linux VM: The startup script in bin/startClient will fail, because it cannot determine which Java to use to run the app. It is trying to determine Unix flavour, failing that defaults to Solaris and ends up with invalid settings. Fix # Set the variable JAVA_VM to path to executable command on your system.

Starting ACC in VM

·179 words·1 min
The ACC is installed in default location: ~/ATG/ACC11.1 This does not work OOTB. You must set 2 additional ENV properties cd ~/ATG/ACC11.0 export ACC_HOME=`pwd` export JAVA_VM=/usr/java/jdk1.7.0_51//bin/java bin/startClient & Starting from dyn/admin # The start in separate VM works OK. Start in server VM brings errors message very often complaining of malformed Help URL. The issue is documented here: http://stackoverflow.com/questions/20868244/how-to-fix-malformed-help-url-while-opening-acc-atg - for JBOSS.

How to get information about all ATG components

·795 words·4 mins
How to get information about all ATG Nucleus components # Dyn Admin has useful feature - Configuration reporter: http://localhost:8080/dyn/admin/atg/dynamo/admin/en/config-reporter-property-representation1.jhtml There are two variations of the report: Property representation report - PRR (shorter version) and Bean representation report (BRR). The PRR does not report properties that have default values, while BRR is reporting current values of all properties. Compare the sizes

ATG Repository structure visualizer

·311 words·2 mins
The groovy script does parse the XML files (scraped from dyn-admin, or output of the XML combine) and produces file in the syntax of Plant UML - http://plantuml.sourceforge.net if (args.size() == 0) { println "Usage: groovy extractItems.groovy XMLFILE-IN-GSA-FORMAT.xml" System.exit(1) } def gsaFile = new XmlSlurper().parseText(new File(args[0]).text) def desc = gsaFile.'item-descriptor' def processItemDescriptor(myDesc) { def info = [:] def tables = [] def props = [:] def descriptors = [:] for (table in myDesc.table) { String tableName = table.@name.text() tables += tableName // collect table's properties for (prop in table.property) { String name = "${prop.@name.text()}(${tableName})".replaceAll(/[ -]/, '_') props[name] = [:] if ("${prop.@'required'.text()}" != "") { props[name]['required'] = "${prop.@'required'.text()}" } if ("${prop.@'hidden'.text()}" != "") { props[name]['hidden'] = "${prop.@'hidden'.text()}" } if ("${prop.@'item-type'.text()}" != "") { props[name]['item-type'] = "${prop.@'item-type'.text()}" descriptors["${prop.@name.text()}"] = "${prop.@'item-type'.text().replaceAll(/[ -]/, '_')}" } } } info['tables'] = tables // scan for properties outside of tables for (prop in myDesc.property) { String name = "${prop.@name.text()}".replaceAll(/[ -]/, '_') props[name] = [:] if ("${prop.@'item-type'.text()}" != "") { props[name]['item-type'] = "${prop.@'item-type'.text()}" } } info['properties'] = props info['descriptors'] = descriptors return info } println "Got ${desc.size()} item-descriptors" println "@startuml" for (idesc in desc) { def info = processItemDescriptor(idesc) def name = "${idesc.@name.text().replaceAll(/[ -]/, '_')}" println "\nclass ${name} {" for (p in info.tables) println "\t"+p println ".." for (p in info.properties) println "\t"+p println "}" for (p in info.descriptors?.keySet()) println "\t ${name} *-- ${info.descriptors[p]} : ${p}" } println "@enduml" The generation (requires installed dot tools)

Recreate txt base graph generator

Graphviz # This time using brew ➜ DPS brew install graphviz ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/graphviz-2.38.0.mavericks.bottle.tar.gz ######################################################################## 100.0% ==> Pouring graphviz-2.38.0.mavericks.bottle.tar.gz 🍺 /usr/local/Cellar/graphviz/2.38.0: 469 files, 68M ➜ DPS dot -V dot - graphviz version 2.38.0 (20140413.2041) ➜ DPS Schema Spy # From http://sourceforge.net/projects/schemaspy/files/schemaspy/SchemaSpy%205.0.0/ To /opt/diagram Run: diagram java -jar ./schemaSpy_5.0.0.jar -cp .:/Users/miro/lib/jdbc/mysql-connector-java-5.1.26-bin.jar -t mysql -o library -host localhost -u training -db training_dev01 -p training

Better dynadmin

·135 words·1 min
Source of the fix is https://github.com/jc7447/BetterDynAdmin. This is to capture the installation process and provide backup in case the tool disappears. The pages generated by DynAdmin are actually not coming from a JSP or JHTML pages. The HTML you see is generated by hardcoded servlets. Each Nucleus component has assigned Admin servet, which is called when DynAdmin is trying to render the page. The improvent here are user scripts - running inside Firefox or Chrome, utilizing infrastructure provided by Greasemonkey extension (FF) or Tampermonkey (Chrome).

ATG + JBoss rant

·472 words·3 mins
Symptoms # restarting after kill -9 of CSC instance does not succeed. The server never starts, the WAR files are not deployed properly, socket 8080 is open but nobody answers (not even with wget on localhost). The exception: # "main" prio=10 tid=0x0000000051a39000 nid=0x30fb in Object.wait() [0x00002b5df9d6c000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000007e36ae9d0> (a atg.service.lockmanager.ClientLockEntry) at atg.service.lockmanager.ClientLockEntry.acquireWriteLock(ClientLockEntry.java:399) - locked <0x00000007e36ae9d0> (a atg.service.lockmanager.ClientLockEntry) at atg.service.lockmanager.ClientLockManager.acquireWriteLock(ClientLockManager.java:1137) at atg.repository.search.indexing.ConfigStatePersister.acquireLock(ConfigStatePersister.java:1844) at atg.repository.search.indexing.ConfigStatePersister$IndexingReadLockedTransactionAction.doWithTransaction(ConfigStatePersister.java:2083) at atg.repository.search.indexing.ConfigStatePersister.releaseAllConfigurations(ConfigStatePersister.java:1545) at atg.repository.search.indexing.ConfigStatePersister.performAction(ConfigStatePersister.java:1775) at atg.nucleus.Nucleus.performPostStartupActions(Nucleus.java:4336) at atg.nucleus.Nucleus.performPostStartupActions(Nucleus.java:4323) at atg.nucleus.Nucleus.<init>(Nucleus.java:954) at atg.nucleus.Nucleus.<init>(Nucleus.java:717) at atg.nucleus.Nucleus.startNucleusCheckLicense(Nucleus.java:4144) at atg.nucleus.servlet.NucleusServlet.initBigEarNucleus(NucleusServlet.java:1234) at atg.nucleus.servlet.NucleusServlet.init(NucleusServlet.java:443) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) - locked <0x0000000781734f48> (a org.apache.catalina.core.StandardWrapper) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950) - locked <0x0000000781734f48> (a org.apache.catalina.core.StandardWrapper) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4417) - locked <0x0000000781733e18> (a org.apache.catalina.core.StandardContext) at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:321) at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145) at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) - locked <0x0000000780878058> (a org.jboss.web.tomcat.service.deployers.TomcatDeployment) at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) - locked <0x0000000780878038> (a org.jboss.web.deployers.WebModule) at org.jboss.web.deployers.WebModule.start(WebModule.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) at $Proxy38.start(Unknown Source) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37) at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556) at org.jboss.system.ServiceController.doChange(ServiceController.java:688) at org.jboss.system.ServiceController.start(ServiceController.java:460) at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163) at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99) at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46) at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1225) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699) at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70) at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53) at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543) at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308) at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256) at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461) at org.jboss.Main.boot(Main.java:221) at org.jboss.Main$1.run(Main.java:556) at java.lang.Thread.run(Thread.java:662) What is going on: # In the run of deployment, JBoss is starting context, hands over control to NucleusServlet init. Nucleus is trying to get write access lock and hangs there forever, while WAR deployment and all subsequent deployment never completes.

Finding out the class in ATG installation

·845 words·4 mins
Java approach # Use the real time search with this JAR - https://jarscan.com/ ➜ scripts git:(authoring) ✗ java -jar ~/bin/jarscan.jar ========================= JarScan written by Geoff Yaworski gyaworski@hotmail.com Version 2.0 ========================= Usage: java -jar jarscan.jar [-help | /?] [-dir directory name] [-zip] [-showProgress] <-files | -class | -package> <search string 1> [search string 2] [search string n] Help: -help or /? Displays this message. -dir The directory to start searching from default is "." -zip Also search Zip files -showProgress Show a running count of files read in -files or -class Search for a file or Java class contained in some library. i.e. HttpServlet -package Search for a Java package contained in some library. i.e. javax.servlet.http search string The file or package to search for. i.e. see examples above example

ATG Groovy TDD

·63 words·1 min
Got it working. It is a bit rough around the edges, but functional. The two components http://localhost:8080/dyn/admin/nucleus/thinkwrap/twatg/script/GroovyDemoScript/ http://localhost:8080/dyn/admin/nucleus/thinkwrap/twatg/script/GroovyScriptRunner/ The are not started via Initial, but that is not a problem. The script tested: class ThatsGroovyDude implements com.thinkwrap.twatg.script.RunnableScript { atg.nucleus.Nucleus nuc = atg.nucleus.Nucleus.getGlobalNucleus(); public String run() { String s = ""; nuc.configPathNames.each { s += "${it}\n" } return "Hello World!\n\n" + s; } }