diff --git a/docs/Core-Development-Guide.adoc b/docs/Core-Development-Guide.adoc new file mode 100644 index 0000000000..763e98ea3f --- /dev/null +++ b/docs/Core-Development-Guide.adoc @@ -0,0 +1,115 @@ +[[Core-Development-Guide]] +=== Windup Core Development Guide + +This guide is for developers who plan to contribute source code updates +or core rule add-ons to the Windup 2.0 project. + +==== Overview + +* xref:What-is-Windup[What is Windup]? +* xref:Features-of-Windup-2.0[Features of Windup 2.0] +* xref:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable] + +==== Get Started + +Before you begin to contribute to Windup, take a quick tour to see how to use it. + +* xref:Install-and-Configure-Maven[Install and Configure Maven] +* xref:Dev-Get-the-Windup-Source-Code[Get the Windup Source Code] +* xref:Dev-Build-Windup-from-Source[Build Windup from Source] +* xref:Dev-Execute-Windup-Built-from-Source[Execute Windup Built from Source] +* xref:Review-the-Report[Review the Report] + +==== Developer Contributing Information + +* xref:Dev-Development-Guidelines-and-Conventions[Developer Guidelines and Conventions] +* xref:Dev-Submit-Code-Updates-to-the-Windup-Project[Submit Code Updates to the Windup Project] + +==== Understand the Windup Architecture and Structure + +* xref:Windup-Processing-Overview[Windup Processing Overview] +* xref:Windup-Architectural-Components[Windup Architectural Components] +* xref:Dev-Windup-Project-Structure[Windup Project Structure] + +==== Rules and Rulesets + +* xref:Windup-Processing-Overview.adoc[Windup Processing Overview] +* xref:Rules-Rule-Execution-Lifecycle[Rules Execution Lifecyle] +* xref:Rules-Rule-Story-Points[Rule Story Points] +* xref:Rules-Difference-Between-XML-based-and-Java-based-Rules[Difference Between XML-based and Java-based Rules] + +==== Create and Test Java Rule Add-ons + +* xref:Rules-Java-based-Rule-Structure[Java-based Rule Structure] +* xref:Rules-Basic-Rule-Execution-Flow-Patterns[Basic Rule Execution Flow Patterns] +* xref:Rules-Create-a-Basic-Java-based-Rule-Add-on[Create a Basic Java-based Rule Add-on] +* xref:Rules-Create-an-Advanced-Ruleset[Create an Advanced Ruleset] + +==== Create and Test XML Rules + +* xref:Rules-Create-a-Basic-XML-Rule[Create a Basic XML Rule] + +* xref:Rules-Test-a-Basic-XML-Rule-in-Windup[Test an XML Rule in Windup] + +==== Debugging and Troubleshooting + +* xref:Dev-Debugging-and-Profiling[Debugging and Profiling] +* xref:Dev-Troubleshooting[Troubleshooting] + +==== Developer topics + +* xref:Dev-Windup-Bootstrap[Bootstrap] +* xref:Dev-Classloading-Notes[Classloading Notes] +* xref:Dev-Connect-to-the-Graph-via-Rexster[Connect to the Graph via Rexster] +* xref:Dev-Decompiling[Decompiling] +* xref:Dev-Dependencies[Dependencies] +* xref:Dev-Frames-Extensions[Frames Extensions] +* xref:Dev-Internal-API-Features[Internal API Features] +* xref:Dev-Logging[Logging] +* xref:Dev-Variables-Stack[Variables Stack] +* xref:Dev-Port-WindRide-Functionality-to-Windup[Port WindRide Functionality to Windup] +* xref:Dev-Git-Rebasing[Git Rebasing] +* xref:Dev-Releasing-Windup[Releasing Windup] + +==== Rules topics + +* xref:Rules-Available-Rules-Utilities[Available Utilities] +* xref:Dev-Concepts-and-Philosophy[Concepts and Philosophy] +* xref:Rules-Creating-Rule-Operations[Creating Rules Operations] +* xref:Rules-Rulesets[Rulesets] +** xref:Ruleset-Java-Basic-Ruleset[Java Basic Ruleset] +** xref:Ruleset-Java-Classifications-and-Inline-Hints[Ruleset Java Classifications and Inline Hints] +** xref:Ruleset-Java-EE-Apps[Java EE Apps Ruleset] +** xref:Ruleset-Java-EE-Servers[Java EE Servers Ruleset] +** xref:Ruleset-Reporting[Reporting Ruleset] +* xref:Ruleset-XML[XML Ruleset] +* xref:Rules-Windup-Models[Windup Models] +* xref:Rules-Create-Java-Queries[Create Java Queries] +* xref:Rules-Rules-Metadata[Rules Metadata] +* xref:Rules-Rules-Operations[Rules Operations] +** xref:Rules-Ops-Reporting-Classification[Rules Ops: Reporting: Classification] +** xref:Rules-Ops-Reporting-Hint[Rules Ops: Reporting: Hint] +** xref:Rules-Ops-Reporting-TypeReference[Rules Ops: Reporting: TypeReference] +** xref:Rules-Ops-Xml-XsltTrasformation[Rules Ops: XML: XSLT Transformation] +* xref:Rules-Java-based-Rule-Structure[Java-Based Rule Structure] + +==== Wiki and Product Documentation + +* xref:About-the-Windup-Wiki[About the Windup Wiki] +* xref:Dev-Add-Images-to-the-Windup-Wiki[Add Images to the Windup Wiki] +* xref:Dev-Create-Windup-JavaDoc[Create Windup JavaDoc] +* xref:Dev-Windup-Documentation-Process[Windup Documentation Process] + +==== Additional Resources + +* xref:Review-the-Windup-Quickstarts[Review the Windup Quickstarts] +* xref:Get-Involved[Get Involved] - We need your feedback! +* xref:Known-Issues[Known Issues] +* xref:Report-Issues-with-Windup[Report Issues with Windup] + +==== Appendix + +* xref:Glossary[Glossary of Terms] +* xref:Dev-Windup-Project-Information[Windup Project Information] - Github +repository, IRC, Mailing lists, ... + diff --git a/docs/Core-Development-Guide.asciidoc b/docs/Core-Development-Guide.asciidoc deleted file mode 100644 index 4a23ca1197..0000000000 --- a/docs/Core-Development-Guide.asciidoc +++ /dev/null @@ -1,97 +0,0 @@ -[[Core-Development-Guide]] -=== Windup Core Development Guide - -This guide is for developers who plan to contribute source code updates -or core rule add-ons to the Windup 2.0 project. - -==== Overview - -* link:What-is-Windup[What is Windup]? -* link:Features-of-Windup-2.0[Features of Windup 2.0] -* link:Get-Involved[Get Involved] - We need your feedback! -* link:Dev-Windup-Project-Information[Windup Project Information] - Github -repository, IRC, Mailing lists, ... -* link:Report-Issues-with-Windup[Report Issues with Windup] -* link:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable] - -==== Get Started -* link:Install-and-Configure-Maven[Install and Configure Maven] -* link:Dev-Get-the-Windup-Source-Code[Get the Windup Source Code] -* link:Dev-Build-Windup-from-Source[Build Windup from Source] -* link:Dev-Execute-Windup-Built-from-Source[Execute Windup Built from Source] -* link:Review-the-Report[Review the Report] - -==== Developer Contributing Information - -* link:Dev-Development-Guidelines-and-Conventions[Developer Guidelines and Conventions] -* link:Dev-Submit-Code-Updates-to-the-Windup-Project[Submit Code Updates to the Windup Project] - -==== Understand the Windup Architecture and Structure - -* link:Windup-Processing-Overview[Windup Processing Overview] -* link:Windup-Architectural-Components[Windup Architectural Components] -* link:Dev-Windup-Project-Structure[Windup Project Structure] - -==== Rules and Rulesets - -* link:Rules-Rule-Execution-Lifecycle[Rules Execution Lifecyle] -* link:Rules-Rule-Story-Points[Rule Story Points] - - -==== Debugging and Troubleshooting - -* link:Dev-Debugging-and-Profiling[Debugging and Profiling] -* link:Dev-Troubleshooting[Troubleshooting] - -==== Developer topics - -* link:Dev-Windup-Bootstrap[Bootstrap] -* link:Dev-Classloading-Notes[Classloading Notes] -* link:Dev-Connect-to-the-Graph-via-Rexster[Connect to the Graph via Rexster] -* link:Dev-Decompiling[Decompiling] -* link:Dev-Dependencies[Dependencies] -* link:Dev-Frames-Extensions[Frames Extensions] -* link:Dev-Internal-API-Features[Internal API Features] -* link:Dev-Logging[Logging] -* link:Dev-Variables-Stack[Variables Stack] -* link:Dev-Port-WindRide-Functionality-to-Windup[Port WindRide Functionality to Windup] -* link:Dev-Git-Rebasing[Git Rebasing] -* link:Dev-Releasing-Windup[Releasing Windup] - -==== Rules topics - -* link:Rules-Available-Rules-Utilities[Available Utilities] -* link:Dev-Concepts-and-Philosophy[Concepts and Philosophy] -* link:Rules-Creating-Rule-Operations[Creating Rules Operations] -* link:Rules-Rulesets[Rulesets] -** link:Ruleset-Java-Basic-Ruleset[Java Basic Ruleset] -** link:Ruleset-Java-Classifications-and-Inline-Hints[Ruleset Java Classifications and Inline Hints] -** link:Ruleset-Java-EE-Apps[Java EE Apps Ruleset] -** link:Ruleset-Java-EE-Servers[Java EE Servers Ruleset] -** link:Ruleset-Reporting[Reporting Ruleset] -* link:Ruleset-XML[XML Ruleset] -* link:Rules-Windup-Models[Windup Models] -* link:Rules-Create-Java-Queries[Create Java Queries] -* link:Rules-Rules-Metadata[Rules Metadata] -* link:Rules-Rules-Operations[Rules Operations] -** link:Rules-Ops-Reporting-Classification[Rules Ops: Reporting: Classification] -** link:Rules-Ops-Reporting-Hint[Rules Ops: Reporting: Hint] -** link:Rules-Ops-Reporting-TypeReference[Rules Ops: Reporting: TypeReference] -** link:Rules-Ops-Xml-XsltTrasformation[Rules Ops: XML: XSLT Transformation] -* link:Rules-Java-based-Rule-Structure[Java-Based Rule Structure] - -==== Wiki and Product Documentation - -* link:About-the-Windup-Wiki[About the Windup Wiki] -* link:Dev-Add-Images-to-the-Windup-Wiki[Add Images to the Windup Wiki] -* link:Dev-Create-Windup-JavaDoc[Create Windup JavaDoc] -* link:Dev-Windup-Documentation-Process[Windup Documentation Process] - -==== Additional Resources - -* link:Review-the-Windup-Quickstarts[Review the Windup Quickstarts] -* link:Known-Issues[Known Issues] -* link:Glossary[Glossary] - -* link:Glossary[Glossary of Terms] - diff --git a/docs/Dev-Add-Images-to-the-Windup-Wiki.adoc b/docs/Dev-Add-Images-to-the-Windup-Wiki.adoc index 9b74c08e45..bbe55ba9ab 100644 --- a/docs/Dev-Add-Images-to-the-Windup-Wiki.adoc +++ b/docs/Dev-Add-Images-to-the-Windup-Wiki.adoc @@ -1,6 +1,8 @@ [[Dev-Add-Images-to-the-Windup-Wiki]] === Add Images to the Windup Wiki +:imagesdir: images + * Fork https://github.com/windup/windup/wiki * Clone the Windup Wiki into a `windup.wiki/` directory using the SSH clone URL: @@ -32,15 +34,19 @@ git push origin HEAD:master -* Test the new image in a page on your own Wiki. +* Test the new image in a page on your own Wiki. Don't forget to add the `:imagesdir: images` directive to the beginning of the page to point to the images directory. - image:images/IMAGE_NAME.png[New Image] + image:IMAGE_NAME.png[New Image] + For example: + -image:images/windup-logo-large.png[Windup Logo] +:imagesdir: images + +==== My Image + +image:/windup-logo-large.png[Windup Logo] * If it works, push the image to the upstream repository diff --git a/docs/Dev-Customer-Portal-Tags.adoc b/docs/Dev-Customer-Portal-Tags.adoc new file mode 100644 index 0000000000..4448f78341 --- /dev/null +++ b/docs/Dev-Customer-Portal-Tags.adoc @@ -0,0 +1,57 @@ +=== Customer Portal Tags + +_This is a work in progress, so please feel free to update this page with new tag suggestions!_ + +==== Tags Needed For Most Articles + +The following is a list and description of tags that currently exist on the Customer Portal that we should use when writing Windup migration articles for the Customer Portal. + +windup:: All Windup articles should use this tag so we can quickly find all the Windup articles. + +migration:: All Windup articles should use this tag so a search includes the articles. + +jboss-eap:: Migration material for JBoss EAP platforms. + +weblogic:: Migration material related to WebLogic. + +websphere:: Migration material related to WebLogic. + +java:: Java related issues + +==== Additional Tags That are Available + +api:: +archive:: +authentication:: +classloading:: +configuration:: +database:: +deployment:: +ejb:: +jboss_cache:: +jboss_clustering:: +jboss_security:: +jboss_remoting:: +jboss_transactions:: +jbossweb:: +jca:: +jms:: +jndi:: +jpa:: +jsf:: +ldap:: +load_balancing:: +mbean:: +messaging:: +webservices:: +ws-security:: Web Service security + + +==== Questions + +. What other tags do we need? +. Do we need version specific tags? For example, 'jboss-eap-5', 'jboss-eap-6', 'websphere-8', 'weblogic-10'. +.. If so, do we go into point releases like 'jboss-eap-6.2', 'websphere-8.5' or 'weblogic-12cR2'? +.. Would it be better just to add a bunch of release numbers like '6', '6.1', '6.2', '8', etc. and use them with a product tag to create more flexibility? + + diff --git a/docs/Dev-How-to-Write-a-Rule-Test.adoc b/docs/Dev-How-to-Write-a-Rule-Test.adoc new file mode 100644 index 0000000000..38b388919b --- /dev/null +++ b/docs/Dev-How-to-Write-a-Rule-Test.adoc @@ -0,0 +1,205 @@ +[[Dev-How-to-Write-a-Rule-Test]] +=== How to Write a Rule Test + +.DRAFT + +Generally, you can test a rule in one of the following ways. + +. Call `perform()` on the given `GraphContext`, +. Execute Windup using `WindupExecutor`. + +Examples of both are below. + +==== Follow These Steps to Create a Test + +. Create an Arquillian test with a `@Deployment` method. ++ +[source,java] +---- +@RunWith(Arquillian.class) +public class MyTest extends AbstractTestCase +{ + @Deployment + @Dependencies({ + }) + public static ForgeArchive getDeployment() { + return ShrinkWrap.create(ForgeArchive.class) + ...; + } +} +---- +. Add all the Windup add-ons needed for the rule. +* Failure to add all necessary dependencies will lead to WARNINGs from Furnace. +* Transitive dependencies declared by the add-on POM file are loaded automatically, so you should be safe adding the add-ons you use in your code. +* Remember to add the dependencies to the `pom.xml` file, otherwise Furnace will throw +a misleading error "Could not find a version for `org.foo:bar`". ++ +[source,java] +---- +@Dependencies({ + @AddonDependency(name = "org.jboss.windup.graph:windup-graph"), + ... +}) +... + ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class) + ... + .addAsAddonDependencies( + AddonDependencyEntry.create("org.jboss.windup.graph:windup-graph"), + ... + ); +---- +. Add the test classes to the archive. ++ +This can be tricky because failure to add all test classes can lead to cryptic errors from JBoss Modules, which does not tell you which class was not found. To avoid problems, here are few tips: + +* Do not use ShrinkWrap's `.addPackage(...)`. That can lead to duplicated classes since test classes sometimes use the same package name as the tested classes. Also, during refactoring, classes move around but the packages stay the same. It is preferable to add specific classes using the `addClasses(...)` method. + +Duplicated classes cause problems like same class being treated as different (e.g. when using `class.getAnnotation()`). +* Do not reuse helper classes between tests. A test should be totally independent. If you use e.g. some rules from implementation, even just when you really need any class, and that is moved, your test starts failing. Also, do not use other test's classes. We recommend to create a package for your test and have everything in it. +* Test isolated features instead of few big test aiming many features at once. ++ +[source,java] +---- +ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class) + ... + .addBeansXML() + .addClasses(FooModel.class, TestRuleProvider) + //.addPackage(MyRuleTest.class.getPackage()) + .addAsResource(new File("src/test/resources/reports")) + .addAsAddonDependencies( + AddonDependencyEntry.create("org.jboss.windup.graph:windup-graph"), + ... + ); +---- +. `@Inject GraphContext` + +For rules testing, we will have a special harness in the future. + +==== Test Examples + +[source,java] +---- +@RunWith(Arquillian.class) +public class MapInPropertiesTest +{ + @Deployment + @Dependencies({ + @AddonDependency(name = "org.jboss.windup.graph:windup-graph"), + @AddonDependency(name = "org.jboss.windup.utils:utils"), + @AddonDependency(name = "org.jboss.forge.furnace.container:cdi") + }) + public static ForgeArchive getDeployment() + { + ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class) + .addBeansXML() + .addPackage("org.jboss.windup.graph.typedgraph.mapinprops") + .addAsAddonDependencies( + AddonDependencyEntry.create("org.jboss.windup.graph:windup-graph"), + AddonDependencyEntry.create("org.jboss.windup.utils:utils"), + AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi") + ); + return archive; + } + + @Inject private GraphContext context; + + @Test public void testMapHandling() throws Exception { + .... + } +} +---- + +A test which builds it's own runtime environment: + +[source,java] +---- +@RunWith(Arquillian.class) +public class FreeMarkerIterationOperationTest extends AbstractTestCase +{ + @Deployment + @Dependencies({ + @AddonDependency(name = "org.jboss.windup.config:windup-config"), + @AddonDependency(name = "org.jboss.windup.graph:windup-graph"), + @AddonDependency(name = "org.jboss.windup.reporting:windup-reporting"), + @AddonDependency(name = "org.jboss.forge.furnace.container:cdi") + }) + public static ForgeArchive getDeployment() + { + ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class) + .addBeansXML() + .addClass(AbstractTestCase.class) + .addClass(FreeMarkerOperationRuleProvider.class) + .addAsResource(new File("src/test/resources/reports")) + .addAsAddonDependencies( + AddonDependencyEntry.create("org.jboss.windup.config:windup-config"), + AddonDependencyEntry.create("org.jboss.windup.graph:windup-graph"), + AddonDependencyEntry.create("org.jboss.windup.reporting:windup-reporting"), + AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi") + ); + return archive; + } + + @Inject + private GraphContext context; + @Inject + private FreeMarkerOperationRuleProvider provider; + + private Path tempFolder; + + @Test + public void testApplicationReportFreemarker() throws Exception + { + GraphRewrite event = new GraphRewrite(context); + DefaultEvaluationContext evaluationContext = createEvalContext(event); + fillData(context); + + Configuration configuration = provider.getConfiguration(context); + + RuleSubset.evaluate(configuration).perform(event, evaluationContext); + + Path outputFile = tempFolder.resolve(provider.getOutputFilename()); + String results = FileUtils.readFileToString(outputFile.toFile()); + Assert.assertEquals("Test freemarker report", results); + } + + private void fillData(final GraphContext context) throws Exception + { + WindupConfigurationModel cfgModel = context.getFramed().addVertex(null, WindupConfigurationModel.class); + ... + + ApplicationReportModel appReportModel = context.getFramed().addVertex(null, ApplicationReportModel.class); + ... + } + + private DefaultEvaluationContext createEvalContext(GraphRewrite event) + { + final Variables varStack = Variables.instance(event); + final DefaultEvaluationContext evaluationContext = new DefaultEvaluationContext(); + final DefaultParameterValueStore values = new DefaultParameterValueStore(); + evaluationContext.put(ParameterValueStore.class, values); + event.getRewriteContext().put(Variables.class, varStack); + return evaluationContext; + } +} +---- + +TO_DO: TBD: + +[source,java] +---- +Query.find(FileModel.class).piped( new QueryGremlinCriterion() { + @Override + public void query( GraphRewrite event, GremlinPipeline pipeline ) { + pipeline... + } +}) +---- + +Test a subset of Rules + +See +https://github.com/lincolnthree/windup/tree/WINDUP-133/rules/app/java/src/test/java/org/jboss/windup/rules/java +(TBD) + +==== What is the Module (add-on) _DEFAULT_? What does it's classloader see? + +That is the module of the current Forge Test Case. It is created on-the-fly for the purpose of a test. \ No newline at end of file diff --git a/docs/Dev-Jenkins-Setup.adoc b/docs/Dev-Jenkins-Setup.adoc new file mode 100644 index 0000000000..a7ea1fc001 --- /dev/null +++ b/docs/Dev-Jenkins-Setup.adoc @@ -0,0 +1,63 @@ +[[Dev-Jenkins-Setup]] +=== Jenkins Setup + +Windup team has a Jenkins instance on OpenStack. + +This is the description of how to set it up. + +==== Requirements + +* Instance size: c3.mxlarge or bigger +* System: RHEL 7 GA Guest + +==== Procedure To Set It Up + +. Get a RHN account. Your organization should give you one. +. Add your keys to OpenStack +. Login to the machine - user is `cloud-user` +. `sudo su -` +. `subscription-manager register --auto-attach` +. `subscription-manager repos` - pick some repo(s) to use. ++ +---- +subscription-manager repos --enable=rhel-7-server-htb-rpms +subscription-manager repos --enable=rhel-7-server-optional-rpms +subscription-manager repos --enable=rhel-7-server-rpms/7Server +subscription-manager repos --enable=rhel-7-server-rt-beta-rpms +subscription-manager repos --enable=rhel-7-server-rt-htb-rpms +subscription-manager repos --enable=rhel-7-server-rt-rpms +subscription-manager repos --enable=rhel-ha-for-rhel-7-server-eus-rpms +subscription-manager repos --enable=rhel-ha-for-rhel-7-server-htb-rpms +subscription-manager repos --enable=rhel-ha-for-rhel-7-server-rpms +subscription-manager repos --enable=rhel-lb-for-rhel-7-server-htb-rpms +subscription-manager repos --enable=rhel-rs-for-rhel-7-server-eus-rpms +subscription-manager repos --enable=rhel-rs-for-rhel-7-server-htb-rpms +subscription-manager repos --enable=rhel-rs-for-rhel-7-server-rpms +subscription-manager repos --enable=rhel-sap-for-rhel-7-server-rpms + +yum install -y java-1.7.0-openjdk java-1.7.0-openjdk-devel +yum install -y wget git unzip mc lsof + +subscription-manager repos \ +--enable rhel-server-7-ose-beta-rpms \ +--enable jb-eap-6.3-for-rhel-7-server-source-rpms \ +--enable jb-eap-6-for-rhel-7-server-source-rpms \ +--enable jb-ews-2-for-rhel-7-server-rpms + +yum update -y + +wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo +rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key +yum install -y jenkins +---- + +. `service jenkins start` # or stop or restart +. Install Maven 3.2.5 ++ +---- +wget http://apache.miloslavbrada.cz/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.zip +unzip -q apache-maven-3.3.1-bin.zip +mkdir /sw +mv apache-maven-3.3.1 /sw/maven-3.3.1 +ln -s /sw/maven-3.3.1/bin/mvn /usr/bin/mvn +---- \ No newline at end of file diff --git a/docs/Dev-Release-Checklist.adoc b/docs/Dev-Release-Checklist.adoc new file mode 100644 index 0000000000..1dde3dfe3a --- /dev/null +++ b/docs/Dev-Release-Checklist.adoc @@ -0,0 +1,15 @@ +[[Dev-Release-Checklist]] +=== Windup Release Checklist + +* Build & upload artifacts +* Update `...` in: + * windup-rulesets + * windup-quickstats (each pom.xml separatedly) + * windup-distribution +* Build & upload the distribution zip +* Javadoc to windup/windup, branch gh-pages +* HTML single-page docs to windup/windup, branch gh-pages +* Announce to mailing lists (windup-users@lists.jboss.org, jboss-migration@redhat.com) +* Mark the version as released in Jira +* Push the unresolved issues to the next version +* Roll out the barrels & celebrate \ No newline at end of file diff --git a/docs/Dev-Rule-Documentation-Tracker.adoc b/docs/Dev-Rule-Documentation-Tracker.adoc new file mode 100644 index 0000000000..035ac7b50c --- /dev/null +++ b/docs/Dev-Rule-Documentation-Tracker.adoc @@ -0,0 +1,5 @@ +=== Rule Documentation Tracker + +The content for this page has been moved to Google Docs: https://docs.google.com/spreadsheets/d/19xaibv1xZr1L3ss256A9ak08oqg-zFxuvzlmOHiMtHw/edit#gid=1133431410 + +The list of available Kbase articles is located here: https://access.redhat.com/search/browse/articles#?&col=portal_articles&language=All&portal_language=en&portal_tag=windup \ No newline at end of file diff --git a/docs/Dev-Rule-Metadata-and-API-Discrepancies.adoc b/docs/Dev-Rule-Metadata-and-API-Discrepancies.adoc new file mode 100644 index 0000000000..18c76b3032 --- /dev/null +++ b/docs/Dev-Rule-Metadata-and-API-Discrepancies.adoc @@ -0,0 +1,52 @@ +[[Dev-Rule-Metadata-and-API-Discrepancies]] +=== Rule Metadata and API Discrepancies + +.DRAFT + +These are notes about technical debt, which will probably never be removed. + +==== API + + public void perform(GraphRewrite event, EvaluationContext evCtx) + +Why do we need both event and evaluation context? I think we don't, they could be merged. +What is an "event"? The name doesn't fit. + + GraphContext#setOptions() + +What is this? Is it really related to graph? + + +==== Metadata + + Object cat = event.getRewriteContext().get(RuleMetadata.CATEGORY); + +What does it do in `RewriteContext`? That should be bound to `Rule(Provider)`, not a context. +More, this metadata needs the executor to run, wheares other like `getExecuteAfter()` don't. + +Data stored to `RewriteContext` e.g. in `enhanceMetadatadata()` go to rules, not to `RuleProvider`s. +This leads to every rule having a `contextMap` where identical values are referenced. + +They are under: + + context.map[WindupRuleMetadata].providersToRules[?RuleProvider][?].contextMap + [CATEGORY] = "java,security" + [RULE_PROVIDER] = ... + [ORIGIN] = ... + +Why does `enhanceMetadata(Context rewriteCtx)` get a `rewrite.Context`? Why not some `RuleProvider`-related object? + +==== GraphRewrite event + +The event object is actually not an event. It does not bear any aspects of any event. It is a context. As such, it would be practical to have it injected by CDI, from appropriate scope - in this case, application scope. + +[source,java] +------------------ +@Override +public void beforeExecution(GraphRewrite event) +{ + LOG.info("Registered " + ArchiveIdentificationGraphChangedListener.class.getSimpleName() + + "- Archives will be identified automatically."); + event.getGraphContext().getGraph().addListener(new ArchiveIdentificationGraphChangedListener(event)); +} +------------------ diff --git a/docs/Dev-Team-Meeting.adoc b/docs/Dev-Team-Meeting.adoc new file mode 100644 index 0000000000..7453cf6c03 --- /dev/null +++ b/docs/Dev-Team-Meeting.adoc @@ -0,0 +1,25 @@ +[Dev-Team-Meeting] +=== Team Meeting + +==== When and Where? +Wednesday at #windup @ Freenode.org + +Eventually with a videochat session. + +==== IRC bot meeting commands + +---- +#startmeeting +(16:03:01) jbott: Useful Commands: #action #agreed #help #info #idea #link #topic. +#chair lincolnthree ozizka jsightler mbriskar +#topic Agenda +#addtopic Status Reports +#addtopic Priorities + +#nexttopic +#info ... +#action +#idea + +#endmeeting +---- \ No newline at end of file diff --git a/docs/Dev-Test-Logging.adoc b/docs/Dev-Test-Logging.adoc new file mode 100644 index 0000000000..5089654bd8 --- /dev/null +++ b/docs/Dev-Test-Logging.adoc @@ -0,0 +1,66 @@ +[[Dev-Test-Logging]] +=== Test Logging + +This section describes how to configure different logging utilities to control logging during unit and integration test execution. It also describes how to limit or increase the logging levels. + +==== JUL (java.util.logging) + +. Find your JRE using the command for your operating system. ++ +-------- +For Linux: + Command: $ readlink -f `which java` + Example result: `/usr/lib/jvm/java-7-openjdk-amd64/jre`. +For Windows: C:> echo %JAVA_HOME%. + Example result: C:\Program Files\Java\jre7\ +-------- +. Add the following to the `JAVA_HOME/lib/logging.properties` file: ++ +-------- +# Valid levels are SEVERE, WARNING, INFO, FINE, FINER, FINEST, CONFIG + +# To enable windup debug logging +org.jboss.windup.level = FINEST + +org.jboss.forge.level = WARNING +# To prevent AddonLoader's "missing dependencies: ..." +org.jboss.forge.furnace.impl.addons.level = OFF + +org.jboss.weld.level = WARNING +org.jboss.weld.event.level = SEVERE +org.jboss.weld.interceptor.util.InterceptionTypeRegistry.level = SEVERE + +#com.thinkaurelius.titan.diskstorage.level = SEVERE +com.thinkaurelius.titan.level = SEVERE +-------- + +==== Slf4j (Weld, ...) + +-------- +-Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR +-Dorg.slf4j.simpleLogger.log.org.jboss.weld.event.ExtensionObserverMethodImpl=ERROR +-------- + +For details, see http://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html. + +Add the following system properties to the http://maven.apache.org/surefire/maven-surefire-plugin/examples/system-properties.html[Maven Surefire] configuration: + +[source,xml] +-------- + + + org.apache.maven.plugins + maven-surefire-plugin + 2.17 + + + ${testExcludeString} + + + ERROR + ERROR + + -Xms512m -Xmx2048m -XX:MaxPermSize=512m + + +-------- diff --git a/docs/Dev-Windup-Configuration.adoc b/docs/Dev-Windup-Configuration.adoc new file mode 100644 index 0000000000..3ebc37db58 --- /dev/null +++ b/docs/Dev-Windup-Configuration.adoc @@ -0,0 +1,68 @@ +[[Dev-Windup-Configuration]] +=== Windup Configuration + +This section describes the how Windup processes configuration arguments. Windup configuration handles of the following types of arguments. + +* Forge related arguments +* Windup Core arguments +* Windup Rules arguments + +== Forge related arguments + +Forge related arguments are those that process add-ons and affect Forge execution mode. + +* --install +* --remove +* --list +* --addonDir +* --immutableAddonDir +* --batchMode +* --evaluate +* --debug +* --version + +These arguments are handled in the Windup `Bootstrap` class. + +TO_DO: Link (to some Forge page?) + +== Windup Core arguments + +The following are Windup core arguments: + +* `--input` - `InputPathOption` +* `--output` - `OutputPathOption` +* `--offline` - `OfflineModeOption` +* `--userRules` - `UserRulesDirectoryOption` +* `--userIgnoreFiles` - `UserIgnoreFilesOption` + +==== Getting the arguments value +You can either get a specific option + +------- +WindupConfiguration.getOptionValue(OfflineModeOption.NAME) +------- + +or iterate over all options: + +------- +WindupConfiguration.getWindupConfigurationOptions() +------- + +== Custom Arguments for Rules + +Additional arguments are made available to Windup rules using a special API. For more information about Windup rules arguments, see xref:Rules-Rule-Configuration[Rule Configuration]. + +Each option is an implementation of http://windup.github.io/windup/docs/javadoc/latest/org/jboss/windup/config/WindupConfigurationOption.html[WindupConfigurationOption]. + +Examples: + +* `org.jboss.windup.rules.apps.java.config.ScanPackagesOption` +* `org.jboss.windup.rules.apps.java.config.ExcludePackagesOption` +* `org.jboss.windup.rules.apps.java.config.SourceModeOption` + +===== Processing Argument Sequence + +When the user runs ./windup, the `Bootstrap` class intercepts the Forge arguments and processes them. The other arguments are passed to Windup, which processes them and then distributes them to the right place. During rule execution, the Windup rule arguments are accessed and evaluated. + + + diff --git a/docs/Dev-Windup-Web.adoc b/docs/Dev-Windup-Web.adoc new file mode 100644 index 0000000000..f8cf1025c7 --- /dev/null +++ b/docs/Dev-Windup-Web.adoc @@ -0,0 +1,17 @@ +[Dev-Windup-Web] +=== Windup Web + +.DRAFT + +Hosted by Red Hat / JBoss.org + +Source code is currently at https://github.com/windup/windup.jboss.org + +==== How to get access + +While hosted by Red Hat, the procedure is to send your ssh public key; After adding, you can log in the user `windup` to `filemgmt.jboss.org` and access `www_htdocs/windup`. (eng-ops) + +---- +sftp windup@filemgmt.jboss.org +cd www_htdocs/windup +---- \ No newline at end of file diff --git a/docs/Execute-Windup.adoc b/docs/Execute-Windup.adoc index 6a34468c67..56f201ea72 100644 --- a/docs/Execute-Windup.adoc +++ b/docs/Execute-Windup.adoc @@ -58,22 +58,24 @@ JBoss Windup, version [ 2.0.0-VERSION ] - JBoss, by Red Hat, Inc. [ http://windu . The command to run Windup is `windup-migrate-app`. -. The following is a list of the most commonly used command line arguments. +. This command can take arbitrary options processed by different addons. The list of options in the core Windup distribution can be found in http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/config/ConfigurationOption.html[Javadoc]. Most commonly used command line arguments are: + --input *INPUT_ARCHIVE_OR_FOLDER*:: This is the fully qualified application archive or source path. + ---source-mode true (optional):: This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is `false`. -+ --output *OUTPUT_REPORT_DIRECTORY*:: The fully qualified path to the folder that will contain the the report information produced by Windup. + NOTE: If the *OUTPUT_REPORT_DIRECTORY* directory exists and you do not specify the `--overwrite` argument, you are prompted to overwrite the contents. If you respond "y", it is deleted and recreated by Windup, so be careful not to specify an output directory that contains important information! + --overwrite (optional):: Specify this optional argument only if you are certain you want to force Windup to delete the existing *OUTPUT_REPORT_DIRECTORY*. The default value is `false`. + +--userRulesDirectory:: Points to a directory to load XML rules from. (Search pattern: *.windup.groovy and *.windup.xml) ++ --packages *PACKAGE_1*, *PACKAGE_2*, *PACKAGE_N* (optional):: This is a comma-delimited list of the packages to be evaluated by Windup. + --excludePackages *PACKAGE_1*, *PACKAGE_2*, *PACKAGE_N* (optional):: This is a comma-delimited list of the packages to be excluded by Windup. ++ +--source-mode true (optional):: This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is `false`. . To evaluate an application archive, use the following syntax: + diff --git a/docs/Extend-Windup-Rules.adoc b/docs/Extend-Windup-Rules.adoc new file mode 100644 index 0000000000..dfffdbf001 --- /dev/null +++ b/docs/Extend-Windup-Rules.adoc @@ -0,0 +1,6 @@ +[[Extend-Windup-Rules]] +=== Extend Windup Rules + +.DRAFT + +This page is under construction. Check back later! \ No newline at end of file diff --git a/docs/Home.adoc b/docs/Home.adoc new file mode 100644 index 0000000000..d74a69a777 --- /dev/null +++ b/docs/Home.adoc @@ -0,0 +1,47 @@ += Welcome to Windup, JBoss Migration tool + +_NOTE: The Windup 2.x is still under development. If you +want to contribute or participate in developer discussions, join us on +the irc.freenode.net #windup channel or subscribe to the https://lists.jboss.org/mailman/listinfo/windup-dev[windup-dev +mailing list]._ + +// include::News.asciidoc[] + +== About Windup + +Windup 2.0 is a tool used to simplify Java application migrations. It is the +sequel to the original Windup 0.7.x, which has moved to the +https://github.com/windup/windup-legacy[windup-legacy] GitHub repository. + +* xref:What-is-Windup[What is Windup?] (also, Windup 2.0 vs. Windup 0.7.x) +* xref:https://repository.jboss.org/nexus/service/local/artifact/maven/redirect?r=releases&g=org.jboss.windup&a=windup-distribution&v=LATEST&e=zip&c=offline[Download Latest Windup Release] +* xref:Features-of-Windup-2.0[Features of Windup 2.0] +* xref:Get-Involved[Get Involved] - We need your feedback! +* xref:Known-Issues[Known Issues] - Review the known issues to find out how to work around problems. +* xref:Report-Issues-with-Windup[Report Issues] - If you run into any problems executing Windup or understanding the instructions, please report it so we can make it better. (https://issues.jboss.org/browse/WINDUP[Quick link to Jira]) + +== Windup Guides + +Windup documentation is organized into guides that target specific +audiences. + +* xref:./User-Guide[Windup User Guide] is for engineers, consultants, or others who plan to use +Windup to migrate applications or other components. For a single page HTML version, see the xref:http://windup.github.io/windup/docs/latest/html/WindupUserGuide.html[Windup User Guide]. +* xref:./Rules-Development-Guide[Windup Rules Development Guide] provides details for developers, consultants, and others who plan to create custom rule add-ons for the Windup 2.0 project. For a single page HTML version, see the xref:http://windup.github.io/windup/docs/latest/html/WindupRulesDevelopmentGuide.html[Windup Rules Development Guide]. +* xref:./Core-Development-Guide[Windup Core Development Guide] provides information for developers who plan to contribute source code updates or core rule add-ons to the Windup 2.0 project. For a single page HTML version, see the xref:http://windup.github.io/windup/docs/latest/html/WindupCoreDevelopmentGuide.html[Windup Core Development Guide]. +* xref:./Migration-Planning-Guide[Migration Planning Guide] is for developers, Project Managers, or IT managers who must +interpret the Windup reports and develop a project plan. + +== Additional Resources + +* Windup documentation (generated from the Wiki documentation at the link above): +** http://windup.github.io/windup/docs/latest/html/WindupUserGuide.html[Windup User Guide] +** http://windup.github.io/windup/docs/latest/html/WindupRulesDevelopmentGuide.html[Windup Rules Development Guide] +** http://windup.github.io/windup/docs/latest/html/WindupCoreDevelopmentGuide.html[Windup Core Development Guide] +* Windup Javadoc: xref:http://windup.github.io/windup/docs/latest/javadoc[Windup JavaDoc] +* Windup Forums: https://community.jboss.org/en/windup +* Windup Issue Tracker: https://issues.jboss.org/browse/WINDUP +* Windup Users Mailing List: windup-users@lists.jboss.org +* Windup Developers Mailing List: windup-dev@lists.jboss.org +* Windup Commits Mailing List: windup-commits@lists.jboss.org +* Windup on Twitter: https://twitter.com/jbosswindup[@JBossWindup], https://twitter.com/search?q=%23windup%20OR%20%23jboss%20AND%20%23migration&src=typd[#windup OR #jboss AND #migration] diff --git a/docs/Migration-Planning-Guide.adoc b/docs/Migration-Planning-Guide.adoc new file mode 100644 index 0000000000..0f18cf94d3 --- /dev/null +++ b/docs/Migration-Planning-Guide.adoc @@ -0,0 +1,10 @@ +[[Migration-Planning-Guide]] +=== Migration Planning Guide + +.DRAFT + +This guide is for developers, Project Managers, or IT managers who must +interpret the Windup reports and develop a migration project plan. + +* xref:Migration-Planning-Process[Migration Planning Process] +* xref:Review-the-Report[Review the Report] diff --git a/docs/Migration-Planning-Guide.asciidoc b/docs/Migration-Planning-Guide.asciidoc deleted file mode 100644 index c3125eec15..0000000000 --- a/docs/Migration-Planning-Guide.asciidoc +++ /dev/null @@ -1,6 +0,0 @@ -[[migration-planning-guide]] -Migration Planning Guide -~~~~~~~~~~~~~~~~~~~~~~~~ - -This guide is for developers, Project Managers, or IT managers who must -interpret the Windup reports and develop a migration project plan. \ No newline at end of file diff --git a/docs/Migration-Planning-Process.adoc b/docs/Migration-Planning-Process.adoc new file mode 100644 index 0000000000..856f068f83 --- /dev/null +++ b/docs/Migration-Planning-Process.adoc @@ -0,0 +1,44 @@ +[[Migration-Planning-Process]] +=== Migration Planning Process + + +Before you attempt to migrate your application to JBoss Enterprise Application Platform 6, it helps to have an understanding of the process. + +Become familiar with Java Enterprise Edition 6:: + +JBoss Enterprise Application Platform 6 is a fast, lightweight, powerful implementation of the Java Enterprise Edition 6 specification, so understanding Java EE 6 is a great place to start. If you are not familiar with Java EE 6, review the http://www.oracle.com/technetwork/java/javaee/tech/index.html[Java Enterprise Edition 6 documentation] and the http://docs.oracle.com/javaee/6/tutorial/doc/[Java EE 6 tutorial]. + +Familiarize yourself with Red Hat JBoss Enterprise Application Platform 6:: + +Documentation for JBoss EAP 6 is located on the Red Hat Customer Portal at https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/. The _Getting Started Guide provides a quick introduction to the product. The other guides provide detailed information on how to install, configure, and develop applications for Jboess EAP. + +Identify the current hardware and operating systems:: + +This includes the operating systems and versions, number of processors, memory capacity, disk usage and capacity. + +Examine the existing application server and platform:: + +Examine the existing application server and platform, including the operating systems, JVMs, databases, and web servers, and determine the equivalent capabilities in JBoss Enterprise Application Platform 6. The supported JBoss configurations can be found on the Customer Portal at https://access.redhat.com/support/configurations/jboss/. + +Examine and understand the existing application:: + +Thoroughly examine the existing application. Be totally familiar with its architecture, functions, features and components. Inventory the technologies used by the application for database access, security, caching, clustering, and failover. Identify any dependencies on 3rd party software. In particular, note the proprietary APIs and features and determine the JBoss EAP or Java EE 6 equivalents. + +Review monitoring and administration procedures and tools:: + +Perform a review of all monitoring and administration procedures and tools in place to identify any that may need modification or replacement to work with the JBoss Enterprise Application Platform. + +Have a backup plan in place:: + +Before you begin, be sure to have a backup plan in place. This needs to not only the application source code, but must include any production data accessed by the application. +Review resources available for the migration process:: + +Resources include people, software, and hardware. Assess the skills of the development team that will be doing the work and plan for training or additional consulting help. Also be aware that additional hardware and other resources will be required during the migration process until the effort is completed. + +Prepare a migration plan:: + +Develop a migration plan including a detailed roadmap and resources that will be needed. + +Execute the plan:: + +Implement the strategic migration plan and employ implementation support strategies. diff --git a/docs/Migration-Technology-Categories.adoc b/docs/Migration-Technology-Categories.adoc new file mode 100644 index 0000000000..609f4951c2 --- /dev/null +++ b/docs/Migration-Technology-Categories.adoc @@ -0,0 +1,44 @@ +[[Migration-Technology-Categories]] +=== Migration Technology Categories + +.DRAFT + +Windup rules categorize changes by technology to make it easier to understand the development and administration skill sets required for the migration effort. + +The following is a partial list of suggested technologies. + +CDI:: + +CLUSTERING:: + +CONFIGURATION:: Requires server configuration + +TRANSACTIONS:: Requires understanding of database transactions, SQL... + +DATASOURCE:: Requires knowledge of datasource configuration, JBDC Drivers. + +EJB3:: + +JAVACLIENT:: + +JAXRS:: + +JMX:: + +JNDI:: + +JSF:: + +LOGGING:: + +REMOTING:: + +SECURITY:: + +SERVLET:: + +THREADS:: + +WEB:: + +WEBSERVICES:: diff --git a/docs/News.adoc b/docs/News.adoc new file mode 100644 index 0000000000..7c8ff3c8a6 --- /dev/null +++ b/docs/News.adoc @@ -0,0 +1,3 @@ +**2014-12-05** Windup 2.0.0.Beta6 released. + +**2014-12-22** Windup 2.0.0.Beta7 released. \ No newline at end of file diff --git a/docs/Performance-tuning.adoc b/docs/Performance-tuning.adoc new file mode 100644 index 0000000000..24834cfe8a --- /dev/null +++ b/docs/Performance-tuning.adoc @@ -0,0 +1,77 @@ +TO_DO: This page should link to the Rulesets pages, namely their configuration sections. + +# Performance tweaks + +#### All artifacts from Maven Central repository are ignored. +Any jar that comes from Maven Central is omitted from unzipping and decompiling. +The identity is verified by the archive's SHA1 hash. +This functionality is provided by the xref:Ruleset-Java-Archives-Identification[_Java Archives Identification Ruleset_]. + +#### Ignore custom Maven artifacts +Maven artifacts can be excluded from unzipping and decompilation by declaring ignored artifacts coordinates in a file `~/.windup/conf/ignore/example.archive-ignore.txt`, using the following syntax: + +---- +::[:] +---- +All values can use wildcards at the end. For example, `org.jboss.wildfly.*:*:*` will ignore all artifacts from groups whose groupId starts with `org.jboss.wildfly.`. + +Each line in the file is one pattern. All artifacts matched by these patterns will be ignored. + + +#### Ignore Java Packages (and sub-packages) +Windup may be configured to ignore packages during decompilation and analysis. + +When running windup via the command line, you may specify `--excludePackages com.foo` to exclude packages (and all sub-packages.) + +Ignored packages may also be configured via a text file with the naming convention `*.package-ignore.txt`. + +Windup looks for these files in multiple locations: + + * `~/.windup/ignore/` folder + * `$WINDUP_HOME/ignore/` folder + * The folder/file specified by the `--userIgnorePath "/custom/ignore/folder/"` option + +**Example use case:** Imagine you want to ignore the packages com.acme, com.acme.roadrunner, etc. All you would need to do is create the following file in one of the ignore directories: + +[source,text] +.~/.windup/ignore/example.package-ignore.txt +---- +com.acme +---- + +#### Ignore Files +Windup may be configured to ignore files during scanning and report generation. Ignored files may be configured via a text file with the naming convention `*.windup-ignore.txt`. + +Windup looks for these files in multiple locations: + + * `~/.windup/ignore/` folder + * `$WINDUP_HOME/ignore/` folder + * The folder/file specified by the `--userIgnorePath "/custom/ignore/folder/"` option + +**Example use case:** Imagine you want to ignore the library "ant.jar". If you want to ignore this file globally (for example: every time you run windup regardless of where exactly is your windup installation is located), then you would simply create a file in the `~/.windup/ignore/` folder (this folder is shared for all the local windup instances). The file would be named "example.windup-ignore.txt", and should contain a single line: ".*ant.jar". To ignore for only a single windup installation located in `$WINDUP_HOME`, the file should be created in the `$WINDUP_HOME/ignore/` directory. + +[source,text] +.~/.windup/ignore/example.windup-ignore.txt +---- +.*ant.jar +---- + +[TIP] +==== +You can use this same approach to ignore files of any type, not just archives. For example, we can also use this same technique to ignore Java source files matching a certain pattern. + +[source,text] +.~/.windup/ignore/java.windup-ignore.txt +---- +.*/org/example/.*/Example.*\.java +.*DTO\.java +---- +==== + +_(Developers: see also `UserIgnorePathOption` and `GatherIgnoredFileNamesRuleProvider`.)_ + + +### Ignore Java files: By package + +Java files may also be excluded by package: This is functionality specific to the Java rule-set, and you should consult the xref:Ruleset-Java-Basic-Ruleset#configuration[`--packages`] user input option. + diff --git a/docs/Review-the-Report.adoc b/docs/Review-the-Report.adoc index c1e86d69ac..a33373e032 100644 --- a/docs/Review-the-Report.adoc +++ b/docs/Review-the-Report.adoc @@ -1,6 +1,8 @@ [[Review-the-Report]] === Review the Report +:imagesdir: images + ==== About the Report When you execute Windup, the report is generated in the `OUTPUT_REPORT_DIRECTORY` you specify for the `--output` argument in the command line. This output directory contains the following files and subdirectories: @@ -19,7 +21,7 @@ The examples below use the https://github.com/windup/windup/blob/master/test-fil Use your favorite browser to open the `index.html` file located in the output report directory. You should see something like the following: -image:images/report-index-page.png[Report Index Page, 500] +image:report-index-page.png[Report Index Page, 500] Click on the link under the *Name* column to view the Windup application report page. @@ -34,7 +36,7 @@ The first section of the application report page summarizes the migration effort The following is an example of a Windup Application Report. -image:images/report-javaee-ear-summary.png[Report Summary Page, 500] +image:report-javaee-ear-summary.png[Report Summary Page, 500] ===== Archive Analysis Sections @@ -61,7 +63,7 @@ Estimated Story Points:: Level of effort required for migrating the file. The following is an example of the archive analysis summary section of a Windup Report. In this example, it's the analysis of the `WINDUP_SOURCE/test-files/jee-example-app-1.0.0.ear/jee-example-services.jar`. -image:images/report-javaee-ear-03-services-jar.png[Report Archive Page, 500] +image:report-javaee-ear-03-services-jar.png[Report Archive Page, 500] ===== File Analysis Pages @@ -73,11 +75,11 @@ The analysis of the `jee-example-services.jar` lists the files in the JAR and th In this example, warnings appear at the import of `weblogic.application.ApplicationLifecycleEvent` and report that the class is proprietary to WebLogic and must be removed. -image:images/report-javaee-ear-file-detail-part1.png[File Detail - Part 1, 500] +image:report-javaee-ear-file-detail-part1.png[File Detail - Part 1, 500] Later in the code, warnings appear for the creation of the InitialContext and for the object name when registering and unregistering an MBeans -image:images/report-javaee-ear-file-detail-part2.png[File Detail - Part 2, 500] +image:report-javaee-ear-file-detail-part2.png[File Detail - Part 2, 500] ==== Additional Reports @@ -87,7 +89,7 @@ Explore the Windup `OUTPUT_REPORT_DIRECTORY/reports` folder to find additional r The `OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html` page provides the list of rule providers that executed when running the Windup migration command against the application. -image:images/report-javaee-ear-ruleprovider.png[RuleProvider Report, 500] +image:report-javaee-ear-ruleprovider.png[RuleProvider Report, 500] ===== Rule Provider Execution Report @@ -97,6 +99,6 @@ The `OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html` page provides th You can directly access the the file analysis report pages described above by browsing for them by name in the `OUTPUT_REPORT_DIRECTORY/reports/` directory. Because the same common file names can exist in multiple archives, for example "manifest.mf" or "web.xml", Windup adds a unique numeric suffix to each report file name. -image:images/report-directory-file-list.png[Report Directory File List, 500] +image:report-directory-file-list.png[Report Directory File List, 500] diff --git a/docs/Rule-XML-Ruleset-Examples-Match-on-XMLFile.adoc b/docs/Rule-XML-Ruleset-Examples-Match-on-XMLFile.adoc new file mode 100644 index 0000000000..43c2a40082 --- /dev/null +++ b/docs/Rule-XML-Ruleset-Examples-Match-on-XMLFile.adoc @@ -0,0 +1,40 @@ +[[Rule-XML-Ruleset-Examples-Match-on-XMLFile]] +=== XML Ruleset Examples: Match on "xmlfile" + +.DRAFT + + +[source,xml] +---- + + + + + + + + + + + + + + + + +---- + +[source,xml] +---- + + + + + + + + + + + +---- diff --git a/docs/Rules-Basic-Rule-Execution-Flow-Patterns.adoc b/docs/Rules-Basic-Rule-Execution-Flow-Patterns.adoc index 295b76ad7f..11dd41bc84 100644 --- a/docs/Rules-Basic-Rule-Execution-Flow-Patterns.adoc +++ b/docs/Rules-Basic-Rule-Execution-Flow-Patterns.adoc @@ -1,15 +1,10 @@ [[Rules-Basic-Rule-Execution-Flow-Patterns]] === Basic Rule Execution Flow Patterns -TO_DO: Need some links to github to the respective example files. +==== Single Operation - operation(); -==== operation(); - single operation +No condition or iteration is needed. The following is an example of a single operation. -When no iteration or condition is needed. - -Example: [CopyJavaConfigToGraphRuleProvider](rules-java/src/main/java/org/jboss/windup/rules/apps/java/config/CopyJavaConfigToGraphRuleProvider.java) - -[source,java] -------- return ConfigurationBuilder.begin() .addRule() @@ -21,11 +16,14 @@ return ConfigurationBuilder.begin() }); -------- +Windup source code example: https://github.com/windup/windup/blob/master/rules-java/impl/src/main/java/org/jboss/windup/rules/apps/java/config/CopyJavaConfigToGraphRuleProvider.java#L99-L101 -==== if( ... ){ operation(); } - single conditional operation +The `copyConfigToGraph` GraphOperation used in the perform() above is defined before the rule. +==== Single Conditional Operation - if( ... ){ operation()} -[source,java] +A single condition must be met. The following is an example of a single conditional operation. + -------- return ConfigurationBuilder.begin() .addRule() @@ -38,10 +36,11 @@ return ConfigurationBuilder.begin() }); -------- +Windup source code example: https://github.com/windup/windup/blob/master/reporting/api/src/main/java/org/jboss/windup/reporting/rules/AttachApplicationReportsToIndexRuleProvider.java#L39-L41 -==== for( FooModel.class ){ ... } - Single iteration +==== Single Iteration - for( FooModel.class ){ ... } -For simple iterations, `IteratingRuleProvider` can be used, which makes the `perform` a bit less verbose: +For simple iterations, you can extend the `IteratingRuleProvider` class to simplify the `perform` code. [source,java] -------- @@ -67,9 +66,9 @@ public class ComputeArchivesSHA512 extends IteratingRuleProvider @Override public String toStringPerform() { return this.getClass().getSimpleName(); } } -------- +Windup source code example: https://github.com/windup/windup/blob/master/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/provider/DiscoverArchiveManifestFilesRuleProvider.java - -==== if( ... ){ for( ... ) } - conditional iteration +==== Conditional Iteration - if( ... ){ for( ... ) } [source,java] -------- @@ -82,12 +81,11 @@ return ConfigurationBuilder.begin() .perform( ... ) ) -------- +Windup source code example: https://github.com/windup/windup/blob/master/rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/rules/DiscoverEjbAnnotationsRuleProvider.java#L82-L93 +==== Iteration With a Condition - for( ... ){ if( ... ){ ... } } -==== for( ... ){ if( ... ){ ... } } - iteration with a condition - -[source,java] -------- return ConfigurationBuilder.begin() .addRule() @@ -111,11 +109,21 @@ return ConfigurationBuilder.begin() .perform( ... ) -------- +Windup source code example: https://github.com/windup/windup/blob/master/reporting/impl/src/main/java/org/jboss/windup/reporting/rules/rendering/RenderReportRuleProvider.java#L46-L66 -==== for( ... ){ for( ... ) { ... } } - nested iterations +==== Nested Iterations - for( ... ){ for( ... ) { ... } } -[source,java] -------- - +.addRule() + .when(...) + .perform(Iteration //first iteration + .over("list_variable").as("single_var") + .perform( + Iteration.over("single_var") //second iteration + .perform(...).endIteration() + ) + .endIteration() +); -------- +Windup source code example: https://github.com/windup/windup/blob/master/config/tests/src/test/java/org/jboss/windup/config/iteration/payload/IterationPayLoadPassTest.java#L183-L202 \ No newline at end of file diff --git a/docs/Rules-Create-Custom-Reports.adoc b/docs/Rules-Create-Custom-Reports.adoc new file mode 100644 index 0000000000..4ee6307436 --- /dev/null +++ b/docs/Rules-Create-Custom-Reports.adoc @@ -0,0 +1,19 @@ +[[Rules-Create-Custom-Reports]] +=== Create Custom Reports + +.DRAFT + +Most custom rules use high-level operations distributed with Windup, such as `Hint`. +Their results will appear in the report automatically - or better said, the respective rule will add it. + +When implemeting a brand new rule with your own conditions and operations, you also need to take care of adding the information to the report - either to some existing report (will appear as new box in one of report Windup creates), or create a new report (will appear as a new file in the output directory). + +This page describes how to do both. + + +==== Add Information to an Existing Report + +==== Create a New Custom Report + +Something like `rules-java/src/main/resources/reports/templates/ignored_files.ftl` might be a good example. +The report itself is created in CreateJavaIgnoredFilesReportRuleProvider. \ No newline at end of file diff --git a/docs/Rules-Create-a-Groovy-Rule-Add-on.adoc b/docs/Rules-Create-a-Groovy-Rule-Add-on.adoc new file mode 100644 index 0000000000..bd5faec694 --- /dev/null +++ b/docs/Rules-Create-a-Groovy-Rule-Add-on.adoc @@ -0,0 +1,39 @@ +[[Rules-Create-a-Groovy-Rule-Add-on]] +=== Create a Groovy Rule Add-on + +You can create a rule add-on using Java or a rule using XML or Groovy. This topic describes how to create a rule add-on using Groovy. + +==== Prerequisites + +* You should have already xref:Install-Windup[installed Windup]. +* Before you begin, you may also want to be familiar with the following documentation: +** Windup rules are based on the ocpsoft *rewrite* project. You can find more information about ocpsoft *rewrite* here: http://ocpsoft.org/rewrite/ +** The JavaDoc for the Windup API is located here: http://windup.github.io/windup/docs/javadoc/latest/ + +NOTE: Working examples of Groovy-based rules can be found in the Windup quickstarts GitHub repository located here: https://github.com/windup/windup-quickstarts + +==== Groovy Rule Add-on Example + +The following is an example of a Groovy rule add-on. + +-------- +ruleSet("ExampleBlacklistRule").setPhase(RulePhase.MIGRATION_RULES) + + .addRule() + .when( + Query.find(JavaClassModel.class).as("javaClasses") + ) + .perform( + Iteration.over("javaClasses").perform( + new GraphOperation () { + public void perform(GraphRewrite event, EvaluationContext context) { + // System.out.println("Performing rewrite operation") + } + } + ) + ) + .withMetadata(RuleMetadata.CATEGORY, "Java") +-------- + +NOTE: Windup only analyzes Groovy rule files with names ending in `.windup.groovy`. Be sure to name Groovy-based rules using this naming convention! + diff --git a/docs/Rules-Creating-Rule-Operations.adoc b/docs/Rules-Creating-Rule-Operations.adoc index ff47c73ee8..5f934197f8 100644 --- a/docs/Rules-Creating-Rule-Operations.adoc +++ b/docs/Rules-Creating-Rule-Operations.adoc @@ -1,6 +1,8 @@ [[Rules-Creating-Rule-Operations]] === Creating Rule Operations +:imagesdir: images + An operation is a task which can be invoked from within a rule. It is created by extending GraphOperation. @@ -11,8 +13,7 @@ public class FooOperation extends GraphOperation { @Override public void perform(GraphRewrite event, EvaluationContext context) - { - + { ... } } @@ -20,5 +21,5 @@ public class FooOperation extends GraphOperation Existing operations: -image:images/GraphOperationSubtypes.png["Existing operations"] +image:GraphOperationSubtypes.png["Existing operations"] diff --git a/docs/Rules-Development-Guide.adoc b/docs/Rules-Development-Guide.adoc new file mode 100644 index 0000000000..08b6c309af --- /dev/null +++ b/docs/Rules-Development-Guide.adoc @@ -0,0 +1,73 @@ +[[Rules-Development-Guide]] +=== Rules Development Guide + +This guide is for engineers, consultants, or others who plan to create +rules for Windup 2.0. + +==== General Windup Information + +* xref:What-is-Windup[What is Windup?] +* xref:Features-of-Windup-2.0[Features of Windup 2.0] +* xref:Get-Involved[Get Involved] +* xref:Report-Issues-with-Windup[Report Issues with Windup] +* xref:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable] + +==== Get Started with Windup + +* xref:Install-Windup[Install Windup] +* xref:Execute-Windup[Execute Windup] +* xref:Review-the-Report[Review the Report] + +==== Configure Your System for Java-based Rules + +If you plan to create Java-based rule add-ons, you must also do the following. + +* xref:Install-and-Configure-Maven[Install and Configure Maven] +* xref:http://windup.github.io/windup/docs/javadoc/latest/[Windup API JavaDoc reference]: The JavaDoc can serve as a reference for creating Java-based rule add-ons. + +==== Understand the Rule Processing + +* xref:Windup-Processing-Overview[Windup Processing Overview] +* xref:Rules-Rule-Execution-Lifecycle[Rule Execution Lifecycle] +* xref:Rules-Rule-Story-Points[Rule Story Points] +* xref:Rules-Difference-Between-XML-based-and-Java-based-Rules[ +Difference Between XML-based and Java-based Rules] + +==== Create and Test Java Rule Add-ons + +* xref:Rules-Java-based-Rule-Structure[Java-based Rule Structure] +* xref:Rules-Basic-Rule-Execution-Flow-Patterns[Basic Rule Execution Flow Patterns] +* xref:Rules-Create-a-Basic-Java-based-Rule-Add-on[Create a Basic Java-based Rule Add-on] +* xref:Rules-Create-an-Advanced-Ruleset[Create an Advanced Ruleset] + +==== Create and Test XML Rules + +* xref:Rules-Create-a-Basic-XML-Rule[Create a Basic XML Rule] + +** xref:Rules-XML-Rule-When-Condition-Syntax[XML Rule - When Condition Syntax] +** xref:Rules-XML-Rule-Perform-Action-Syntax[XML Rule - Perform Action Syntax] + +* xref:Rules-Test-a-Basic-XML-Rule-in-Windup[Test an XML Rule in Windup] + +==== Review the Report + +* xref:Review-the-Report[Review the Report] + +==== External Rule Examples + +* xref:Review-the-Windup-Quickstarts[Review the Windup Quickstarts] + +==== Debugging and Troubleshooting + +* xref:Dev-Debugging-and-Profiling[Debugging and Profiling] +* xref:Dev-Troubleshoot-Windup-Issues[Troubleshoot Windup Issues] + +==== Additional Help + +* xref:Report-Issues-with-Windup[Report Issues with Windup] +* xref:Glossary[Glossary of Terms] + +==== Appendix + +* xref:Windup-Architectural-Components[Windup Architectural Components] + diff --git a/docs/Rules-Development-Guide.asciidoc b/docs/Rules-Development-Guide.asciidoc deleted file mode 100644 index 83fd59d6fb..0000000000 --- a/docs/Rules-Development-Guide.asciidoc +++ /dev/null @@ -1,73 +0,0 @@ -[[Rules-Development-Guide]] -=== Rules Development Guide - -This guide is for engineers, consultants, or others who plan to create -rules for Windup 2.0. - -==== General Windup Information - -* link:What-is-Windup[What is Windup?] -* link:Features-of-Windup-2.0[Features of Windup 2.0] -* link:Get-Involved[Get Involved] -* link:Report-Issues-with-Windup[Report Issues with Windup] -* link:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable] - -==== Get Started with Windup - -* link:Install-Windup[Install Windup] -* link:Execute-Windup[Execute Windup] -* link:Review-the-Report[Review the Report] - -==== Configure Your System for Java-based Rules - -If you plan to create Java-based rule add-ons, you must also do the following. - -* link:Install-and-Configure-Maven[Install and Configure Maven] -* link:http://windup.github.io/windup/docs/javadoc/latest/[Windup API JavaDoc reference]: The JavaDoc can serve as a reference for creating Java-based rule add-ons. - -==== Understand the Rule Processing - -* link:Windup-Processing-Overview[Windup Processing Overview] -* link:Rules-Rule-Execution-Lifecycle[Rule Execution Lifecycle] -* link:Rules-Rule-Story-Points[Rule Story Points] -* link:Rules-Difference-Between-XML-based-and-Java-based-Rules[ -Difference Between XML-based and Java-based Rules] - -==== Create and Test Java Rule Add-ons - -* link:Rules-Java-based-Rule-Structure[Java-based Rule Structure] -* link:Rules-Basic-Rule-Execution-Flow-Patterns[Basic Rule Execution Flow Patterns] -* link:Rules-Create-a-Basic-Java-based-Rule-Add-on[Create a Basic Java-based Rule Add-on] -* link:Rules-Create-an-Advanced-Ruleset[Create an Advanced Ruleset] - -==== Create and Test XML Rules - -* link:Rules-Create-a-Basic-XML-Rule[Create a Basic XML Rule] - -** link:Rules-XML-Rule-When-Condition-Syntax[XML Rule - When Condition Syntax] -** link:Rules-XML-Rule-Perform-Action-Syntax[XML Rule - Perform Action Syntax] - -* link:Rules-Test-a-Basic-XML-Rule-in-Windup[Test an XML Rule in Windup] - -==== Review the Report - -* link:Review-the-Report[Review the Report] - -==== External Rule Examples - -* link:Review-the-Windup-Quickstarts[Review the Windup Quickstarts] - -==== Debugging and Troubleshooting - -* link:Dev-Debugging-and-Profiling[Debugging and Profiling] -* link:Dev-Troubleshoot-Windup-Issues[Troubleshoot Windup Issues] - -==== Additional Help - -* link:Report-Issues-with-Windup[Report Issues with Windup] -* link:Glossary[Glossary of Terms] - -==== Appendix - -* link:Windup-Architectural-Components[Windup Architectural Components] - diff --git a/docs/Rules-Java-based-Rule-Structure.adoc b/docs/Rules-Java-based-Rule-Structure.adoc index 4bda3d273f..029520356b 100644 --- a/docs/Rules-Java-based-Rule-Structure.adoc +++ b/docs/Rules-Java-based-Rule-Structure.adoc @@ -68,11 +68,17 @@ In the `.when()` part, the rule typically queries the graph, using the Other way to fill a when part is subclassing the `GraphCondition`. Actually, `Query` also implements it, and is only a convenient way to create a condition. +You can also use multiple conditions within one when() call using and(). +Example: +---- +.when(Query.fromType(XmlMetaFacetModel.class).and(Query...)) +---- Last noticable but important feature is the ability to use https://github.com/tinkerpop/gremlin/wiki[Gremlin] queries. See http://gremlindocs.com/[Gremlin docs] for reference manual. + ===== perform() [source,java] @@ -94,7 +100,7 @@ writes the findings into the graph. For that, various operations are available. These are subclasses of `GraphOperation`. You can also implement your own. See -Rules-Operations[Rules Operations] for more info. Again, there are +xref:Rules-Rules-Operations[Rules Operations] for more information. Again, there are several convenient implementations for constructs like iteration (`Iteration`). @@ -122,7 +128,20 @@ several convenient implementations for constructs like iteration ====== Nested iterations -TO_DO: Provide information about nested iterations +An iteration is also an operation, so everywhere an operation is expected, you can freely put the Iteration. If the Iteration is put inside the perform method of another Iteration, we speak about nested iterations. +An example of such nested iteration may be: +---- +.addRule() + .when(...) + .perform( + Iteration.over("list_variable").as("single_var") + .perform( + Iteration.over("single_var") //second iteration + .perform(...).endIteration() + ) + .endIteration() +); +---- ====== otherwise @@ -147,7 +166,16 @@ For more information, see http://ocpsoft.org/rewrite/[OCP Rewrite web]. ===== Where -TO_DO: Provide information about the where clause +The where clause is used to provide information about used parameters within the rule. So for example if you have used a parameter in some condition like for example `JavaClass.references("{myMatch}")`, you may use the where clause to specify what the `myMatch` is like `.where("myMatch").matches("java.lang.String.toString\(.*\)")`. + +---- +.when(JavaClass.references("{myMatch}").at(TypeReferenceLocation.METHOD)) +.perform(...) +.where("myMatch").matches("java.lang.String.toString\(.*\)") +---- + ++ +Please note that within the where clause the regex is used in contrast to JavaClass.references() where a windup specific syntax is expected. ===== Metadata @@ -165,4 +193,31 @@ and not actually used, is `RuleMetadata.CATEGORY`. ==== Available utilities For a list of what key services and constructs can be used in the rule, -see xref:Rules-Available-Rules-Utilities[Available Rules Utilities]. \ No newline at end of file +see xref:Rules-Available-Rules-Utilities[Available Rules Utilities]. + +===== Variable stack +The communication between the conditions and operations is done using the variable stack that is filled with the output of the condition/s and then given to the Iteration to be processed. +Within conditions, you can specify the name of the result iterable that is saved in the stack using `as()` method, the iteration can specify the iterable to iterate over using the `over()` method and even specify the name of for each processed single model of the result being processed. +Example: + +---- + +.addRule() + .when(Query...as("result_list")) + .perform( + Iteration.over("result_list").as("single_var") + ... + ) +); + +---- +The varstack may be accesed even from the second condition in order to narrow the result of the previous one. After that the iteration may choose which result it wants to iterate over (it is even possible to have multiple iterations listed in the perform, each of which may access different result saved in the variable stack). +---- +.addRule() + .when(Query...as("result_list").and(Query.from("result_list")....as("second_result_list"))) + .perform( + Iteration.over("second_result_list") + ... + ) +); +---- \ No newline at end of file diff --git a/docs/Rules-Rule-Configuration.adoc b/docs/Rules-Rule-Configuration.adoc new file mode 100644 index 0000000000..6fedfc832c --- /dev/null +++ b/docs/Rules-Rule-Configuration.adoc @@ -0,0 +1,40 @@ +[[Rules-Rule-Configuration]] +=== Rule Configuration + +_How to pass configuration from user input to the rules._ + + +==== Configuration of Custom Rules + +The rules can be parametrized by user input (e.g. from a command line argument, like `--packages`). +When creating a custom rule, you might need to allow the user to change the rule's behavior, or need some input from the user, like, a path to some directory, or address of some online service. This page shows how. + +For more information about how configuration is processed, see xref:Dev-Windup-Configuration[Windup Configuration]. + +===== Getting the options from the options map: + +[source,java] +-------- +GraphOperation copyConfigToGraph = new GraphOperation() +{ + @Override + public void perform(GraphRewrite event, EvaluationContext context) + { + Map config = event.getGraphContext().getOptionMap(); + Boolean sourceMode = (Boolean) config.get(SourceModeOption.NAME); + @SuppressWarnings("unchecked") + List includeJavaPackages = (List) config.get(ScanPackagesOption.NAME); + @SuppressWarnings("unchecked") + List excludeJavaPackages = (List) config.get(ExcludePackagesOption.NAME); + ... +-------- + +Example: Java ruleset uses a model for its options +[source,java] +-------- +WindupJavaConfigurationModel javaCfg = WindupJavaConfigurationService.getJavaConfigurationModel(event + .getGraphContext()); +javaCfg.setSourceMode(sourceMode == null ? false : sourceMode); +javaCfg.setScanJavaPackageList(includeJavaPackages); +javaCfg.setExcludeJavaPackageList(excludeJavaPackages); +-------- \ No newline at end of file diff --git a/docs/Rules-Rules-Overview.adoc b/docs/Rules-Rules-Overview.adoc new file mode 100644 index 0000000000..f94779a0a0 --- /dev/null +++ b/docs/Rules-Rules-Overview.adoc @@ -0,0 +1,33 @@ +[[Rules-Rules-Overview]] +=== Rules Overview + +.DRAFT + +_This page is under construction_ + +Ruleset:: A ruleset is a Forge add-on that contains one or more RuleProviders. The following Windup projects are rulesets. + +* rules-java-ee +* rules-xml + +RuleProvider:: A RuleProvider is a class that implements one or more rules using the `.addRule()` method. The following are examples of legacy Java rules that are defined in `rules-java-ee` ruleset. + +* EjbConfig +* JDKConfig +* SeamToCDI + +Rule:: A piece of code that performs a single unit of work during the migration process. Depending on the complexity of the rule, it may or may not include configuration data. Extensive configuration information may be externalized into external configuration, for example, a custom XML file. The following is an example of a Java-based rule added to the `JDKConfig` RuleProvider class. + +[source,java] +---- +.addRule() + .when(JavaClass.references("java.lang.ClassLoader$").at(TypeReferenceLocation.TYPE)) + .perform(Classification.as("Java Classloader, must be migrated.") + .with(Link.to("Red Hat Customer Portal: How to get resources via the ClassLoader in a JavaEE application in JBoss EAP", "https://access.redhat.com/knowledge/solutions/239033")) + .withEffort(1)) +---- + +Rules Metadata:: Information about whether a particular ruleset applies to a given situation. The metadata can include information about the source and target platform and frameworks. + +Rules Pipeline:: A collection of rules that feed information into the knowledge graph + diff --git a/docs/Rules-Test-a-Basic-XML-Rule-in-Windup.adoc b/docs/Rules-Test-a-Basic-XML-Rule-in-Windup.adoc index 5076cb4e4d..06d6d5d4b0 100644 --- a/docs/Rules-Test-a-Basic-XML-Rule-in-Windup.adoc +++ b/docs/Rules-Test-a-Basic-XML-Rule-in-Windup.adoc @@ -3,15 +3,17 @@ ==== Add the Rule to Windup -A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations: +A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations for files ending with `*.windup.groovy` and `*.windup.xml`: -* The `WINDUP_HOME/rules/` folder. +* The directory specified in the `--userRulesDirectory` option to the `windup-migrate-app`. + +* The `WINDUP_HOME/rules/` directory. + -This is the folder where you run the Windup executable. See xref:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable] for details. +`WINDUP_HOME` is the directory where you run the Windup executable (see xref:About-the-WINDUP_HOME-Variable[here]). -* The `${user.home}/.windup/rules/` folder. +* The `${user.home}/.windup/rules/` directory. + -This folder is created by Windup the first time you execute Windup. It used to track rules and add-ons and to contains the Windup log. +The `${user.home}/.windup` is a directory created by Windup at first run and contains rules, add-ons, and the Windup log. + -------- For Linux or Mac: ~/.windup/rules/ diff --git a/docs/Rules-Windup-Models.adoc b/docs/Rules-Windup-Models.adoc index 823381ec4d..f7ea361ff2 100644 --- a/docs/Rules-Windup-Models.adoc +++ b/docs/Rules-Windup-Models.adoc @@ -1,13 +1,15 @@ [[Rules-Windup-Models]] === Windup Models +:imagesdir: images + Windup models are the classes extending WindupVertexFrame. They are used to model the data in the graph database to Java objects. This is an overview of the most important models. The complete and up-to-date list of models is in xref:http://windup.github.io/windup/docs/javadoc/latest/org/jboss/windup/graph/model/WindupVertexFrame.html[Javadoc]. -image:images/WindupModels-NbScreenshot.png[Windup Models Graphic] +image:WindupModels-NbScreenshot.png[Windup Models Graphic] ==== Meta Models @@ -21,6 +23,6 @@ FileModel ArchiveModel ==== Reporting Models -==== Custom Models (coming from Addons) +==== Custom Models (coming from add-ons) See respective ruleset's documentation. \ No newline at end of file diff --git a/docs/Rules-XML-Rule-Construction.adoc b/docs/Rules-XML-Rule-Construction.adoc new file mode 100644 index 0000000000..0277e6ffba --- /dev/null +++ b/docs/Rules-XML-Rule-Construction.adoc @@ -0,0 +1,165 @@ +[[Rules-XML-Rule-Construction]] +=== XML-Rule-Construction + +DRAFT! + +This section describes the basic construction of XML rules. All XML rules are defined as elements within rulesets. Rulesets also define the phase in which the rules are run. + +===== Ruleset Element + +A ruleset is a group of one or more rules that targets a specific area of migration. This is the basic construct for the `` element. + +* ****: This element defines this as a Windup ruleset. +** ****: This element specifies when the ruleset should execute. ++ +See xref:Rules-Rule-Execution-Lifecycle[Rule Execution Lifecyle] for more information about rule phases. +** ****: This element contains the individual rules. +*** ****: This element is defines the rule. ++ +One or more rules can be defined for a ruleset. +See xref:rule-elements[Rule Elements] in the following section for details on how to define `` elements. +*** **** +** **** +* ****: + + +[[rule-elements]] +===== Rule Elements + +Rule elements follow the familiar construct: + + when(condition) + perform(action) + otherwise + perform(action) + +The following section describes the more commonly used elements in a `**: This element defines the condition or conditions to match on. +** ****: Match on a Java class. ++ +This element can have the following attributes: ++ +[cols="2*", options="header"] +|=== +|Attribute +|Description +|references="CLASS_NAME" +|Match on the fully qualified class name. Wildcards can be specified using `{*}` syntax. For example: "org.apache.commons.{*}" +|in="FILE_NAME" +|The file name +|as="VARIABLE_NAME" +|An optional variable name that can be used in later processing. +|=== ++ +This element can contain the following elements: ++ +[cols="2*", options="header"] +|=== +|Element +|Description +| +|The location where the reference was found in a Java source file, for example, in the IMPORT, ANNOTATION, METHOD, VARIABLE_DECLARATION. You can specify multiple locations. See the http://windup.github.io/windup/docs/javadoc/latest/org/jboss/windup/rules/apps/java/scan/ast/TypeReferenceLocation.html[TypeReferenceLocation] Javadoc for the full list of valid values. +|=== ++ +For more information, see the http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/rules/apps/java/condition/JavaClass.html[JavaClass] JavaDoc. + +** ****: Match on an XML file. The following table lists some of the most commonly used attributes and elements. ++ +This element can have the following attributes: ++ +[cols="2*", options="header"] +|=== +|Attribute +|Description +|matches="XPATH_PATH" +|Match on the XPath, for example: "/w:web-app/w:resource-ref/w:res-auth[text() = 'Container']". Wildcards can be specified using `{*}` syntax. +|in="FILE_NAME" +|The file name +|as="VARIABLE_NAME" +|An optional variable name that can be used in later processing. +|=== ++ +This element can contain the following elements: ++ +[cols="2*", options="header"] +|=== +|Element +|Description +| +|The namespace prefix and URI +|=== ++ +For more information, see the http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/rules/apps/xml/condition/XmlFile.html[XmlFile] JavaDoc. + +** ****: Match on a project. The following table lists some of the most commonly used attributes and elements. For more information, see the http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/project/condition/Project.html[Project] JavaDoc. + +* **** + +* ****: This element is invoked when the condition is met. + +** ****: This child element of **perform** is used to create a `hint` +This element can have the following attributes: ++ +[cols="2*", options="header"] +|=== +|Attribute +|Description +|effort=LEVEL_OF_EFFORT +|A level of effort assigned to this rule +|message="MESSAGE" +|The message ?? +|in="VARIABLE_NAME" +|A variable to use for substitution. +|title="Title" +|The title ??. +|=== ++ +This element can contain the following elements: ++ +[cols="2*", options="header"] +|=== +|Element +|Description +| +|The message to display in the report. +| +|An HREF link and description for further information. +|=== + +** ****: This specifies how to transform the the specified XML file + +** ****: This child element of **perform** is used to log a message. It takes the attribute **message** to define the text message. + +* **** + +* The **** element is invoked when the condition is not met. + +==== Predefined Rules + +Windup provides some predefined rules for more common migration requirements, for example, mapping files from the source platform to target platform. The following is an example of the predefined "XmlFileMappings" rule. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Rules-XML-Rule-When-Condition-Syntax.adoc b/docs/Rules-XML-Rule-When-Condition-Syntax.adoc index ae08cbad19..acc1d201a8 100644 --- a/docs/Rules-XML-Rule-When-Condition-Syntax.adoc +++ b/docs/Rules-XML-Rule-When-Condition-Syntax.adoc @@ -125,20 +125,18 @@ namespace:: The namespace to referenced in XML files. This element contains 2 at ===== Summary -Use the `project` element to find information in project files. For a better understanding of the `project` condition, see the JavaDoc for the http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/project/condition/Project.html[Project] class. +Use the `project` element to query for the project charateristics. For a better understanding of the `project` condition, see the JavaDoc for the http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/project/condition/Project.html[Project] class. -The following is an example of a rule that tests for an `xmlfile`. +The following is an example of a rule that checks a rule is dependent on the junit in the version between 2.0.0.Final and 2.2.0.Final. - + - - Descriptive message - + @@ -146,32 +144,29 @@ The following is an example of a rule that tests for an `xmlfile`. ====== project Element Attributes -The `project` element does not have any attributes. +The `project` element is used to match against the project as a whole. You can use this condition to query for dependencies of the project. It does not have any attributes itself. ====== project Element Child Elements -artifact:: The namespace to referenced in XML files. This element contains the following attributes: +artifact:: Subcondition used within `project` to query against project dependencies. This element contains the following attributes: * groupId="PROJECT_GROUP_ID" + -Match on the project `` +Match on the project `` of the dependency * artifactId="PROJECT_ARTIFACT_ID" -Match on the project `` +Match on the project `` of the dependency -* from="VARIABLE_NAME" +* fromVersion="FROM_VERSION" + -Begin the search query with the filtered result from a previous search identified by its `as` VARIABLE_NAME. - -* to = TO_DO: complete the project artifact 'to' element syntax +Specify the lower version bound of the artifact. For example `2.0.0.Final` +* toVersion="TO_VERSION" ++ +Specify the upper version bound of the artifact. For example `2.2.0.Final` [[filecontent-syntax]] ==== filecontent Syntax -TO_DO: complete the filecontent element syntax - -Use the `filecontent` element to find information in file content.For a better understanding of the `filecontent` condition, see the JavaDoc for the http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/rules/files/condition/FileContent.html[FileContent] class. - -Use the `filecontent` element to test for content within files. The following is an example of a rule that tests for `filecontent`. +Use the `filecontent` element to find strings or text within files, for example, a line in a Properties file. For a better understanding of the `filecontent` condition, see the JavaDoc for the http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/rules/files/condition/FileContent.html[FileContent] class. diff --git a/docs/Ruleset-Core.adoc b/docs/Ruleset-Core.adoc new file mode 100644 index 0000000000..f4c6f43b39 --- /dev/null +++ b/docs/Ruleset-Core.adoc @@ -0,0 +1,108 @@ +[[Ruleset-Core]] +=== Core + +.DRAFT + +_This is an example page. Content serves for design decision. These pages could be generated automatically in the future._ + +Purpose of this ruleset. + +==== Metadata +**ID:** N/A +**Graph prefix:** w: + + Rule providers + +_A definition list (dl/dt/dd) of RuleProviders of given Ruleset with brief descriptions._ + +_Template hint: Subclasses of [`WindupRuleProvider`](http://windup.github.io/windup/docs/javadoc/latest/index.html?org/jboss/windup/graph/model/WindupVertexFrame.html)._ + +* **AttachApplicationReportsToIndexRuleProvider** - +* **BaseConfig** - +* **Config** - +* **CreateApplicationReportIndexRuleProvider** - +* **CreateSourceReportRuleProvider** - +* **CssJsResourceRenderingRuleProvider** - +* **DiscoverArchiveTypesRuleProvider** - +* **DiscoverFileTypesRuleProvider** - +* **RenderGraphRuleProvider** - +* **RenderOverviewPageRuleProvider** - +* **RenderReportRuleProvider** - +* **RenderRuleProviderReportRuleProvider** - +* **RuleExecutionTimeReportRuleProvider** - +* **UnzipArchivesToOutputRuleProvider** - + +* **IteratingRuleProvider** - +* **WindupRuleProviderBuilder** - + + +==== Models + +_Subclasses of `WindupVertexFrame`. + +* AmbiguousJavaClassModel +* AmbiguousReferenceModel +* ApplicationArchiveModel +* ApplicationModel +* ApplicationReportIndexModel +* ApplicationReportModel +* ArchiveModel +* ClassificationModel +* DoctypeMetaModel +* EarArchiveModel +* EjbBeanBaseModel +* EjbDeploymentDescriptorModel +* EjbEntityBeanModel +* EjbMessageDrivenModel +* EjbSessionBeanModel +* EnvironmentReferenceModel +* FileLocationModel +* FileModel +* FileReferenceModel +* FreeMarkerSourceReportModel +* HibernateConfigurationFileModel +* HibernateEntityModel +* HibernateMappingFileModel +* HibernateSessionFactoryModel +* InlineHintModel +* JarArchiveModel +* JarManifestModel +* JavaClassFileModel +* JavaClassModel +* JavaMethodModel +* JavaParameterModel +* JavaSourceFileModel +* JavaTypeReferenceModel +* LinkModel +* MavenProjectModel +* NamespaceMetaModel +* PackageModel +* ProjectDependencyModel +* ProjectModel +* PropertiesModel +* ReportFileModel +* ReportModel +* ResourceModel +* RulePhaseExecutionStatisticsModel +* RuleProviderExecutionStatisticsModel +* SourceFileModel +* SourceReportModel +* SpringBeanModel +* SpringConfigurationFileModel +* TechnologyTagModel +* WarArchiveModel +* WebXmlModel +* WindupConfigurationModel +* WindupJavaConfigurationModel +* WindupVertexListModel +* XmlFileModel +* XmlTypeReferenceModel +* XsltTransformationModel + +==== Configuration + +_Subclasses of `TO_DO` + +==== Reports + +_Report files or report parts created by this ruleset._ \ No newline at end of file diff --git a/docs/Ruleset-Java-Archives-Identification.adoc b/docs/Ruleset-Java-Archives-Identification.adoc new file mode 100644 index 0000000000..73fd38a47b --- /dev/null +++ b/docs/Ruleset-Java-Archives-Identification.adoc @@ -0,0 +1,25 @@ +[[Ruleset-Java-Archives-Identification]] +=== Ruleset: Java Archives Identification + +ArtifactId: rules-java-archives + +==== Rules: +* `ArchiveIdentificationConfigLoadingRuleProvider` loads identification data from `*.archive-metadata.txt` in `$USER/cache` and `$WINDUP/cache`. The data are added to the distribution in https://github.com/windup/windup/blob/master/dist/src/main/assembly/assembly-offline.xml#L38[`dist/src/main/assembly/assembly-offline.xml`] and created in https://github.com/windup/windup/blob/master/dist/pom.xml#L87[dist/pom.xml] +* `IgnoredArchivesConfigLoadingRuleProvider` + + +==== Listeners: +* `ArchiveIdentificationGraphChangedListener` + When `ArchiveModel.ARCHIVE_NAME` changes, searches the library for it's SHA1. If found, adds `IdentifiedArchiveModel` type and appends `ArchiveCoordinateModel`. +* `ArchiveIdentificationLifecycleListener` registers `ArchiveIdentificationGraphChangedListener`. + +==== Models: +* IgnoredArchiveModel + +=== TO_DO: See the following list + +* Split the static classes `SkippedArchives` and `IdentifiedArchives` to an interface and implementations. +* Copy the binary search (file-seeking) implementation of `IdentifiedArchives` to prevent OOMEx. +* Since this reacts to write to ARCHIVE_NAME property, there's no guarantee that the ArchiveModel will be complete, and SHA1 already computed. This is overcome by a workaround - `setArchiveHashes()`. +* All identified archives are ignored. This is not how this archive should work. Identification and ignoring should be separated, because we will definitely add identification of other archives than just the Maven Central Repo (e.g. JDBC drivers). +* \ No newline at end of file diff --git a/docs/Ruleset-Java-Code-Matching-Examples.adoc b/docs/Ruleset-Java-Code-Matching-Examples.adoc new file mode 100644 index 0000000000..831062c9eb --- /dev/null +++ b/docs/Ruleset-Java-Code-Matching-Examples.adoc @@ -0,0 +1,183 @@ +[[Ruleset-Java-Code-Matching-Examples]] +=== Ruleset: Java Basic: Code Matching Examples + +.DRAFT This page will contain rule snippets for Java code matching, AND the java code they are supposed to match. Try `git grep ''` if you want to add. +.SGILDA +.OZIZKA: These are basically 'JavaClass' examples, correct? Would it be okay to change the title to reflect this? For example, something like: 'XML Ruleset Examples: Match on "javaclass"'? + +.SGILDA "No" to name change - XML Ruleset is something different - that is a RuleSet dealing with XML matching. This is really "Ruleset: Java: ...". It will also have Java syntax added. + + +=== Example XML snippets + +==== Import + +[source,java] +------------------- +package com.mycompany.app; + +import org.jbpm.graph.def.ActionHandler; +import org.jbpm.graph.def.ProcessDefinition; +... +------------------- + +[source,xml] +------------------- + + + + INHERITANCE + + + + + + + + + +------------------- +(See `rules-java-ee/src/main/resources/legacy/org.jboss.windup.rules.apps.legacy.java.JBossConfig.windup.xml`) + + +==== Method call + +[source,java] +------------------- +import org.jbpm.graph.exe.ExecutionContext; +... + public void myMethod( ExecutionContext exCtx){ + exCtx.setVariable("foo", "bar"); + } +... +------------------- + +[source,xml] +------------------- + + + + METHOD + + + + + ... + + + +------------------- + + +==== Annotation + +[source,java] +------------------- +import org.jboss.ejb3.annotation.Management; +... +@Service( name = "DeliveryManager" ) +@Local( DeliveryManagerLocal.class ) +@Management( DeliveryManagerManagement.class ) +public class DeliveryManager implements DeliveryManagerManagement +{ + @Resource( mappedName = "Delivery/remote" ) + DeliveryRemote delivery; +------------------- + +[source,xml] +------------------- + + + ANNOTATION + + +------------------- + + + + +==== Inheritance (Foo extends Bar) + +[source,java] +------------------- +public interface StockHome extends javax.ejb.EJBHome +{ + Stock create() throws java.rmi.RemoteException, javax.ejb.CreateException; +} +... +------------------- + +[source,xml] +------------------- + + + INHERITANCE + + +------------------- + + + + +==== Constructor call + +[source,java] +------------------- +JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://localhost:1099"); +------------------- + +[source,xml] +------------------- + + + CONSTRUCTOR_CALL + + +------------------- + + + + +==== Type (classes, interfaces, ...) references (anywhere, e.g. as method parameter) + +[source,java] +------------------- + +... +------------------- + +[source,xml] +------------------- + + + TYPE + + +------------------- + + + + + + + + + + + + +Template: + +==== + +[source,java] +------------------- + +... +------------------- + +[source,xml] +------------------- + +------------------- + diff --git a/docs/Ruleset-Ruleset-Template.adoc b/docs/Ruleset-Ruleset-Template.adoc new file mode 100644 index 0000000000..1df5f63b21 --- /dev/null +++ b/docs/Ruleset-Ruleset-Template.adoc @@ -0,0 +1,141 @@ +[[Ruleset-Ruleset-Template]] +=== Ruleset Template + +.DRAFT + +Ozizka: I'm not clear what this is? + +_This is an example page. Content serves for design decision. These pages could be generated automatically in the future._ + +Purpose of this ruleset. + +==== Metadata +**ID:** myRuleset +**Graph prefix:** myRuleset + +==== Rule providers + +_A definition list (dl/dt/dd) of RuleProviders of given Ruleset with brief descriptions._ + +_Template hint: Subclasses of http://windup.github.io/windup/docs/javadoc/latest/index.html?org/jboss/windup/graph/model/WindupVertexFrame.html[WindupRuleProvider]._ + +* **JDKconfigRuleProvider** - Targetted towards the classes distributed with JDK, like `java.lang.*`, `java.security.*`, `org.xml.*`, etc. +* **AnalyzeJavaFilesRuleProvider** - +* **AttachApplicationReportsToIndexRuleProvider** - +* **BaseConfig** - +* **Config** - +* **CopyJavaConfigToGraphRuleProvider** - +* **CreateApplicationReportIndexRuleProvider** - +* **CreateJavaApplicationOverviewReportRuleProvider** - +* **CreateJavaNonClassifiedFileReportRuleProvider** - +* **CreateSourceReportRuleProvider** - +* **CssJsResourceRenderingRuleProvider** - +* **DecompileArchivesRuleProvider** - +* **DiscoverArchiveTypesRuleProvider** - +* **DiscoverFileTypesRuleProvider** - +* **DiscoverJavaFilesRuleProvider** - +* **DiscoverMavenHierarchyRuleProvider** - +* **DiscoverMavenProjectsRuleProvider** - +* **DiscoverNonMavenArchiveProjectsRuleProvider** - +* **DiscoverNonMavenSourceProjectsRuleProvider** - +* **DiscoverXmlFilesRuleProvider** - +* **EjbConfig** - +* **EjbConfig** - +* **IndexClassFilesRuleProvider** - +* **IteratingRuleProvider** - +* **JBossConfig** - +* **JBossEsbConfig** - +* **JBossJBPMConfig** - +* **JDKConfig** - +* **JPPConfig** - +* **PersistenceConfig** - +* **RenderGraphRuleProvider** - +* **RenderOverviewPageRuleProvider** - +* **RenderReportRuleProvider** - +* **RenderRuleProviderReportRuleProvider** - +* **RuleExecutionTimeReportRuleProvider** - +* **SeamToCDI** - +* **SonicESBConfig** - +* **UnzipArchivesToOutputRuleProvider** - +* **WebLogicConfig** - +* **WebServiceConfig** - +* **WebsphereConfig** - +* **WindupRuleProviderBuilder** - +* **XmlBaseConfig** - +* **XmlGlassfishConfig** - +* **XmlJbossConfig** - +* **XmlJbossEsbConfig** - +* **XmlJonasConfig** - +* **XmlJppConfig** - +* **XmlJrunConfig** - +* **XmlKnowHowConfig** - +* **XmlOrionConfig** - +* **XmlPersistanceConfig** - +* **XmlResinConfig** - +* **XmlSoa5Config** - +* **XmlSonicEsbConfig** - +* **XmlSpringConfig** - +* **XmlWeblogicConfig** - +* **XmlWebserviceConfig** - +* **XmlWebsphereConfig** - + + +==== Models + +_Subclasses of `WindupVertexFrame`. + +* org.jboss.windup.graph.model.ApplicationArchiveModel +* org.jboss.windup.graph.model.ApplicationModel +* org.jboss.windup.graph.model.ArchiveModel +* org.jboss.windup.graph.model.ProjectDependencyModel +* org.jboss.windup.graph.model.ProjectModel +* org.jboss.windup.graph.model.WindupConfigurationModel +* org.jboss.windup.graph.model.performance.RulePhaseExecutionStatisticsModel +* org.jboss.windup.graph.model.performance.RuleProviderExecutionStatisticsModel +* org.jboss.windup.graph.model.report.IgnoredFileRegexModel +* org.jboss.windup.graph.model.resource.FileModel +* org.jboss.windup.graph.model.resource.SourceFileModel +* org.jboss.windup.reporting.model.ApplicationReportIndexModel +* org.jboss.windup.reporting.model.ApplicationReportModel +* org.jboss.windup.reporting.model.ClassificationModel +* org.jboss.windup.reporting.model.FileLocationModel +* org.jboss.windup.reporting.model.FileReferenceModel +* org.jboss.windup.reporting.model.FreeMarkerSourceReportModel +* org.jboss.windup.reporting.model.IgnoredFilesReportModel +* org.jboss.windup.reporting.model.InlineHintModel +* org.jboss.windup.reporting.model.LinkModel +* org.jboss.windup.reporting.model.ReportFileModel +* org.jboss.windup.reporting.model.ReportModel +* org.jboss.windup.reporting.model.TechnologyTagModel +* org.jboss.windup.reporting.model.source.SourceReportModel +* org.jboss.windup.rules.apps.java.model.AmbiguousJavaClassModel +* org.jboss.windup.rules.apps.java.model.AmbiguousReferenceModel +* org.jboss.windup.rules.apps.java.model.EarArchiveModel +* org.jboss.windup.rules.apps.java.model.IgnoredFileModel +* org.jboss.windup.rules.apps.java.model.JarArchiveModel +* org.jboss.windup.rules.apps.java.model.JarManifestModel +* org.jboss.windup.rules.apps.java.model.JavaClassFileModel +* org.jboss.windup.rules.apps.java.model.JavaClassModel +* org.jboss.windup.rules.apps.java.model.JavaMethodModel +* org.jboss.windup.rules.apps.java.model.JavaParameterModel +* org.jboss.windup.rules.apps.java.model.JavaSourceFileModel +* org.jboss.windup.rules.apps.java.model.PackageModel +* org.jboss.windup.rules.apps.java.model.PropertiesModel +* org.jboss.windup.rules.apps.java.model.WarArchiveModel +* org.jboss.windup.rules.apps.java.model.WindupJavaConfigurationModel +* org.jboss.windup.rules.apps.java.model.project.MavenProjectModel +* org.jboss.windup.rules.apps.java.scan.ast.JavaTypeReferenceModel +* org.jboss.windup.rules.apps.xml.model.DoctypeMetaModel +* org.jboss.windup.rules.apps.xml.model.NamespaceMetaModel +* org.jboss.windup.rules.apps.xml.model.XmlFileModel +* org.jboss.windup.rules.apps.xml.model.XmlTypeReferenceModel +* org.jboss.windup.rules.apps.xml.model.XsltTransformationModel + + +==== Configuration + +_Subclasses of http://windup.github.io/windup/docs/javadoc/latest/org/jboss/windup/config/WindupConfigurationOption.html[WindupConfigurationOption] + +==== Reports + +_Report files or report parts created by this ruleset._ \ No newline at end of file diff --git a/docs/Ruleset-XML-Ruleset-Element-Reference.adoc b/docs/Ruleset-XML-Ruleset-Element-Reference.adoc new file mode 100644 index 0000000000..7861a58249 --- /dev/null +++ b/docs/Ruleset-XML-Ruleset-Element-Reference.adoc @@ -0,0 +1,18 @@ +[[Ruleset-XML-Ruleset-Element-Reference]] +=== XML Ruleset Element Reference + +ruleset:: Defines this as a Windup rule. +phase:: Specifies when the ruleset should execute. See xref:Rules-Rule-Execution-Lifecycle[Rule Execution Lifecyle] for more information about rule phases. +rules:: Encapsulates all the the individual rules for this ruleset. +rule:: Child of the the `rules` element. One or more rules can be defined for a ruleset. +when:: Child of `rule`. Defines the condition to match on. +javaclass:: Child of `when`. Match on Java class condition. +location:: Child of `javaclass`. The location where the reference was found in a Java source file. See the http://windup.github.io/windup/docs/javadoc/latest/org/jboss/windup/rules/apps/java/scan/ast/TypeReferenceLocation.html[Enum TypeReferenceLocation] Javadoc for valid values. +xmlfile:: Match on XML file condition. +xslt:: This specifies how to transform the the specified XML file +perform:: This element is invoked when the condition is met. +hint:: Child element of `perform`. Used to create a provide a message. +message:: +xref: +log:: This child element of `perform` is used to log a message. It takes the attribute `message` to define the text message. +otherwise:: Invoked when the condition is not met. \ No newline at end of file diff --git a/docs/Sande-ScratchPad.adoc b/docs/Sande-ScratchPad.adoc new file mode 100644 index 0000000000..3b421553da --- /dev/null +++ b/docs/Sande-ScratchPad.adoc @@ -0,0 +1,197 @@ +=== Sande ScratchPad + +==== Conditions () + +* **javaclass**: JavaClass class extends ParameterizedGraphCondition +* **xmlfile**: XmlFile class extends ParameterizedGraphCondition +* **project**: Project class extends GraphCondition +* **filecontent**: FileContent class extends ParameterizedGraphCondition + +==== Operations + +* **lineitem**: LineItem extends AbstractIterationOperation +* **classification**: Classification extends ParameterizedIterationOperation +* **hint**: Hint extends ParameterizedIterationOperation +* **xslt**: XSLTTransformation extends AbstractIterationOperation ?? + +==== Element Handlers: + +===== **** handlers + +* **phase**: PhaseHandler implements ElementHandler +* **rules**: RulesHandler implements ElementHandler +* **rule**: RuleHandler implements ElementHandler + +===== **** handlers + +* **when**: WhenHandler implements ElementHandler +* **perform**: PerformHandler implements ElementHandler +* **otherwise**: OtherwiseHandler implements ElementHandler + +===== **** conditional handlers + +* **javaclass**: JavaClassHandler implements ElementHandler +* **project**: ProjectHandler implements ElementHandler +* **xmlfile**: XmlFileHandler implements ElementHandler + +===== **** and **** action handlers + +* HintHandler implements ElementHandler +* IterationHandler implements ElementHandler + + +===== Operation Handlers + +* **xslt**: XSLTTransformationHandler implements ElementHandler + +===== Other Handlers + +* **artifactId**: ArtifactHandler implements ElementHandler +* **classification**: ClassificationHandler implements ElementHandler +* **file-mapping**:FileMappingHandler implements ElementHandler +* **filecontent**:FileContentHandler implements ElementHandler +* **lineitem**:LineItemHandler implements ElementHandler +* **link**: LinkHandler implements ElementHandler +* **matches**: MatchesHandler implements ElementHandler +* **message**: MessageHandler implements ElementHandler +* **namespace**: NamespaceHandler implements ElementHandler +* **log**: LogHandler implements ElementHandler +* **package-mapping**: PackageNameMappingHandler implements ElementHandler +* **param**: ParamHandler implements ElementHandler + +===== Windup Core Handlers + +* RuleHandler implements ElementHandler +* RuleProviderHandler implements ElementHandler +* RulesHandler implements ElementHandler +* TypeReferenceLocationHandler implements ElementHandler; see http://windup.github.io/windup/docs/latest/javadoc/org/jboss/windup/rules/apps/java/scan/ast/TypeReferenceLocation.html[enum TypeReferenceLocation] +* WhereHandler implements ElementHandler +* XSLTParameterHandler implements ElementHandler + +===== Logical Conditions + +* AndHandler implements ElementHandler +* OrHandler implements ElementHandler +* NotHandler implements ElementHandler +* TrueHandler implements ElementHandler + +===== Rules Examples + + + + + + + DISCOVERY + + + + + + METHOD_PARAMETER + + + + + Message from XML Rule + + + + + + + + + + + + + + + + + Container Auth + + + + + + + + + + + + +A file-mapping is a predefined rule. It bundles the condition and perform that maps file extensions to model types. For example: + + + + + + + + + + + + + + + + + + + + + + + + + +==== XML Rule Element Description + +* ****: This element defines this as a Windup rule. +* ****: This element specifies when the ruleset should execute. See xref:Rules-Rule-Execution-Lifecycle[Rule Execution Lifecyle] for more information about rule phases. +* ****: element contains the individual rules. +** ****: This element is a child of the **rules** element. One or more rules can be defined for a ruleset. Each `rule` contains the following elements. +*** ****: This element defines the condition to match on. +**** **** +***** ****: The location where the reference was found in a Java source file. See the http://windup.github.io/windup/docs/javadoc/latest/org/jboss/windup/rules/apps/java/scan/ast/TypeReferenceLocation.html[Enum TypeReferenceLocation] Javadoc for valid values. +*** ****: This element is invoked when the condition is met. +**** ****: This child element of **perform** is used to create a `hint` +***** ****: +***** ****: +**** ****: This specifies how to transform the the specified XML file +**** ****: This child element of **perform** is used to log a message. It takes the attribute **message** to define the text message. +*** The **** element is invoked when the condition is not met. + +A file-mapping is a predefined rule. For example: + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Start-Windup.adoc b/docs/Start-Windup.adoc new file mode 100644 index 0000000000..e0729072b7 --- /dev/null +++ b/docs/Start-Windup.adoc @@ -0,0 +1,30 @@ +[[Start-Windup]] +=== Start Windup + +For information about the use of WINDUP_HOME in the instructions below, see xref:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable]. + +1. Open a terminal and navigate to the `WINDUP_HOME/bin` directory + +2. Type the following command to start Windup: ++ +--------------------------------------------------------------------------- +For Linux: WINDUP_HOME/bin $ ./windup +For Windows: C:\WINDUP_HOME\bin> windup +--------------------------------------------------------------------------- +3. You are presented with the following prompt. ++ +--------------------------------------------------------------------------- +Using Windup at /home/username/windup-distribution-2.0.0.VERSION + + _ ___ __ +| | / (_)___ ____/ /_ ______ +| | /| / / / __ \/ __ / / / / __ \ +| |/ |/ / / / / / /_/ / /_/ / /_/ / +|__/|__/_/_/ /_/\__,_/\__,_/ .___/ + /_/ + +JBoss Windup, version [ 2.0.0.VERSION ] - JBoss, by Red Hat, Inc. [ http://windup.jboss.org ] + +[windup-distribution-2.0.0.VERSION]$ +--------------------------------------------------------------------------- + diff --git a/docs/User-Guide.adoc b/docs/User-Guide.adoc new file mode 100644 index 0000000000..a1dff1e6d4 --- /dev/null +++ b/docs/User-Guide.adoc @@ -0,0 +1,31 @@ +[[User-Guide]] +=== Windup User Guide + +:toc: +:toclevels: 4 + +==== Overview + +This guide is for engineers, consultants, and others who plan to use +Windup 2.0 to migrate Java applications or other components. + +* xref:What-is-Windup[What is Windup?] +* xref:Features-of-Windup-2.0[Features of Windup 2.0] +* xref:Windup-Processing-Overview[Windup Processing Overview] +* xref:Get-Involved[Get Involved] +* xref:Report-Issues-with-Windup[Report Issues with Windup] +* xref:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable] + +==== Run Windup + +* xref:Install-Windup[Install Windup] +* xref:Execute-Windup[Execute Windup] +* xref:Review-the-Report[Review the Report] + +==== Additional Resources + +* xref:Review-the-Windup-Quickstarts[Review the Windup Quickstarts] +* xref:Known-Issues[Known Issues] +* xref:Glossary[Glossary of Terms] +* xref:Windup-Architectural-Components[Windup Architectural Components] + diff --git a/docs/User-Guide.asciidoc b/docs/User-Guide.asciidoc deleted file mode 100644 index 61a48824bb..0000000000 --- a/docs/User-Guide.asciidoc +++ /dev/null @@ -1,31 +0,0 @@ -[[User-Guide]] -=== Windup User Guide - -:toc: -:toclevels: 4 - -==== Overview - -This guide is for engineers, consultants, and others who plan to use -Windup 2.0 to migrate Java applications or other components. - -* link:What-is-Windup[What is Windup?] -* link:Features-of-Windup-2.0[Features of Windup 2.0] -* link:Windup-Processing-Overview[Windup Processing Overview] -* link:Get-Involved[Get Involved] -* link:Report-Issues-with-Windup[Report Issues with Windup] -* link:About-the-WINDUP_HOME-Variable[About the WINDUP_HOME Variable] - -==== Run Windup - -* link:Install-Windup[Install Windup] -* link:Execute-Windup[Execute Windup] -* link:Review-the-Report[Review the Report] - -==== Additional Resources - -* link:Review-the-Windup-Quickstarts[Review the Windup Quickstarts] -* link:Known-Issues[Known Issues] -* link:Glossary[Glossary of Terms] -* link:Windup-Architectural-Components[Windup Architectural Components] - diff --git a/docs/What-is-Windup.adoc b/docs/What-is-Windup.adoc index 2f2818a688..5804860851 100644 --- a/docs/What-is-Windup.adoc +++ b/docs/What-is-Windup.adoc @@ -1,4 +1,6 @@ -image:images/windup-logo-wiki-header.jpg[Windup Logo] +:imagesdir: images + +image:windup-logo-large.png[Windup Logo] '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/docs/Windup-Core-Development-Guide-NO-TOC.adoc b/docs/Windup-Core-Development-Guide-NO-TOC.adoc new file mode 100644 index 0000000000..c2ad432659 --- /dev/null +++ b/docs/Windup-Core-Development-Guide-NO-TOC.adoc @@ -0,0 +1,5 @@ += Windup Core Development Guide + +include::Windup-Core-Development-Guide-Topics.adoc[tabsize=4] + + diff --git a/docs/Windup-Core-Development-Guide-Topics.adoc b/docs/Windup-Core-Development-Guide-Topics.adoc new file mode 100644 index 0000000000..e86982c277 --- /dev/null +++ b/docs/Windup-Core-Development-Guide-Topics.adoc @@ -0,0 +1,170 @@ +== Overview + +This guide is for developers who plan to contribute source code updates +or core rule add-ons to the Windup 2.0 project. + +include::What-is-Windup.adoc[tabsize=4] + +include::Features-of-Windup-2.0.adoc[tabsize=4] + +include::About-the-WINDUP_HOME-Variable.adoc[tabsize=4] + +== Get Started + +Before you begin to contribute to Windup, take a quick tour to see how to use it. + +include::Install-and-Configure-Maven.adoc[tabsize=4] + +include::Dev-Get-the-Windup-Source-Code.adoc[tabsize=4] + +include::Dev-Build-Windup-from-Source.adoc[tabsize=4] + +include::Dev-Execute-Windup-Built-from-Source.adoc[tabsize=4] + +include::Execute-Windup.adoc[tabsize=4] + +include::Review-the-Report.adoc[tabsize=4] + +== Developer Contributing Information + +include::Dev-Development-Guidelines-and-Conventions.adoc[tabsize=4] + +include::Dev-Submit-Code-Updates-to-the-Windup-Project.adoc[tabsize=4] + +== Understand the Windup Architecture and Structure + +include::Windup-Architectural-Components.adoc[tabsize=4] + +include::Dev-Windup-Project-Structure.adoc[tabsize=4] + +== Rules and Rulesets + +include::Windup-Processing-Overview.adoc[tabsize=4] + +include::Rules-Rule-Execution-Lifecycle.adoc[tabsize=4] + +include::Rules-Rule-Story-Points.adoc[tabsize=4] + +include::Rules-Difference-Between-XML-based-and-Java-based-Rules.adoc[tabsize=4] + +== Create and Test Java Rule Add-ons + +include::Install-and-Configure-Maven.adoc[tabsize=4] + +include::Rules-Java-based-Rule-Structure.adoc[tabsize=4] + +include::Rules-Basic-Rule-Execution-Flow-Patterns.adoc[tabsize=4] + +include::Rules-Create-a-Basic-Java-based-Rule-Add-on.adoc[tabsize=4] + +// This is not ready for prime time... include::Rules-Create-an-Advanced-Ruleset.adoc[tabsize=4] + +== Create and Test XML Rules + +include::Rules-Create-a-Basic-XML-Rule.adoc[tabsize=4] + +include::Rules-XML-Rule-When-Condition-Syntax.adoc[tabsize=4] + +include::Rules-XML-Rule-Perform-Action-Syntax.adoc[tabsize=4] + +include::Rules-Test-a-Basic-XML-Rule-in-Windup.adoc[tabsize=4] + +== Core Developer topics + +include::Dev-Windup-Bootstrap.adoc[tabsize=4] + +include::Dev-Classloading-Notes.adoc[tabsize=4] + +include::Dev-Connect-to-the-Graph-via-Rexster.adoc[tabsize=4] + +include::Dev-Decompiling.adoc[tabsize=4] + +include::Dev-Dependencies.adoc[tabsize=4] + +include::Dev-Frames-Extensions.adoc[tabsize=4] + +include::Dev-Internal-API-Features.adoc[tabsize=4] + +include::Dev-Logging.adoc[tabsize=4] + +include::Dev-Variables-Stack.adoc[tabsize=4] + +// include::Dev-Port-WindRide-Functionality-to-Windup.adoc[tabsize=4] + +include::Dev-Git-Rebasing.adoc[tabsize=4] + +== Rules topics + +include::Rules-Available-Rules-Utilities.adoc[tabsize=4] + +include::Dev-Concepts-and-Philosophy.adoc[tabsize=4] + +include::Rules-Creating-Rule-Operations.adoc[tabsize=4] + +include::Rules-Rulesets.adoc[tabsize=4] + +include::Ruleset-Java-Basic-Ruleset.adoc[tabsize=4] + +include::Ruleset-Java-Classifications-and-Inline-Hints.adoc[tabsize=4] + +include::Ruleset-Java-EE-Apps.adoc[tabsize=4] + +include::Ruleset-Java-EE-Servers.adoc[tabsize=4] + +include::Ruleset-Reporting.adoc[tabsize=4] + +include::Ruleset-XML.adoc[tabsize=4] + +include::Rules-Windup-Models.adoc[tabsize=4] + +include::Rules-Create-Java-Queries.adoc[tabsize=4] + +include::Rules-Rules-Metadata.adoc[tabsize=4] + +include::Rules-Rules-Operations.adoc[tabsize=4] + +include::Rules-Ops-Reporting-Classification.adoc[tabsize=4] + +include::Rules-Ops-Reporting-Hint.adoc[tabsize=4] + +include::Rules-Ops-Reporting-TypeReference.adoc[tabsize=4] + +include::Rules-Ops-Xml-XsltTrasformation.adoc[tabsize=4] + +== Debugging and Troubleshooting + +include::Dev-Debugging-and-Profiling.adoc[tabsize=4] + +include::Dev-Troubleshoot-Windup-Issues.adoc[tabsize=4] + +== Wiki Information + +include::About-the-Windup-Wiki.adoc[tabsize=4] + +include::Dev-Add-Images-to-the-Windup-Wiki.adoc[tabsize=4] + +== Windup Product Release and Documentation Process + +include::Dev-Windup-Release-Process.adoc[tabsize=4]] + +include::Dev-Create-Windup-JavaDoc.adoc[tabsize=4] + +include::Dev-Windup-Documentation-Process.adoc[tabsize=4] + +== Additional Resources + +include::Review-the-Windup-Quickstarts.adoc[tabsize=4] + +include::Get-Involved.adoc[tabsize=4] + +include::Known-Issues.adoc[tabsize=4] + +include::Report-Issues-with-Windup.adoc[tabsize=4] + +== Appendix + +include::Glossary.adoc[tabsize=4] + +include::Dev-Windup-Project-Information.adoc[tabsize=4] + + diff --git a/docs/Windup-Core-Development-Guide.adoc b/docs/Windup-Core-Development-Guide.adoc index 83a68d526b..46812d4846 100644 --- a/docs/Windup-Core-Development-Guide.adoc +++ b/docs/Windup-Core-Development-Guide.adoc @@ -2,174 +2,8 @@ :toc: :toclevels: 4 +:numbered: -== Overview - -This guide is for developers who plan to contribute source code updates -or core rule add-ons to the Windup 2.0 project. - -include::What-is-Windup.adoc[tabsize=4] - -include::Features-of-Windup-2.0.adoc[tabsize=4] - -include::About-the-WINDUP_HOME-Variable.adoc[tabsize=4] - -== Get Started - -Before you begin to contribute to Windup, take a quick tour to see how to use it. - -include::Install-and-Configure-Maven.adoc[tabsize=4] - -include::Dev-Get-the-Windup-Source-Code.adoc[tabsize=4] - -include::Dev-Build-Windup-from-Source.adoc[tabsize=4] - -include::Dev-Execute-Windup-Built-from-Source.adoc[tabsize=4] - -include::Execute-Windup.adoc[tabsize=4] - -include::Review-the-Report.adoc[tabsize=4] - -== Developer Contributing Information - -include::Dev-Development-Guidelines-and-Conventions.adoc[tabsize=4] - -include::Dev-Submit-Code-Updates-to-the-Windup-Project.adoc[tabsize=4] - -== Understand the Windup Architecture and Structure - -include::Windup-Architectural-Components.adoc[tabsize=4] - -include::Dev-Windup-Project-Structure.adoc[tabsize=4] - -== Rules and Rulesets - -include::Windup-Processing-Overview.adoc[tabsize=4] - -include::Rules-Rule-Execution-Lifecycle.adoc[tabsize=4] - -include::Rules-Rule-Story-Points.adoc[tabsize=4] - -include::Rules-Difference-Between-XML-based-and-Java-based-Rules.adoc[tabsize=4] - -== Create and Test Java Rule Add-ons - -include::Install-and-Configure-Maven.adoc[tabsize=4] - -include::Rules-Java-based-Rule-Structure.adoc[tabsize=4] - -include::Rules-Basic-Rule-Execution-Flow-Patterns.adoc[tabsize=4] - -include::Rules-Create-a-Basic-Java-based-Rule-Add-on.adoc[tabsize=4] - -// This is not ready for prime time... include::Rules-Create-an-Advanced-Ruleset.adoc[tabsize=4] - -== Create and Test XML Rules - -include::Rules-Create-a-Basic-XML-Rule.adoc[tabsize=4] - -include::Rules-XML-Rule-When-Condition-Syntax.adoc[tabsize=4] - -include::Rules-XML-Rule-Perform-Action-Syntax.adoc[tabsize=4] - -include::Rules-Test-a-Basic-XML-Rule-in-Windup.adoc[tabsize=4] - -== Core Developer topics - -include::Dev-Windup-Bootstrap.adoc[tabsize=4] - -include::Dev-Classloading-Notes.adoc[tabsize=4] - -include::Dev-Connect-to-the-Graph-via-Rexster.adoc[tabsize=4] - -include::Dev-Decompiling.adoc[tabsize=4] - -include::Dev-Dependencies.adoc[tabsize=4] - -include::Dev-Frames-Extensions.adoc[tabsize=4] - -include::Dev-Internal-API-Features.adoc[tabsize=4] - -include::Dev-Logging.adoc[tabsize=4] - -include::Dev-Variables-Stack.adoc[tabsize=4] - -// include::Dev-Port-WindRide-Functionality-to-Windup.adoc[tabsize=4] - -include::Dev-Git-Rebasing.adoc[tabsize=4] - -== Rules topics - -include::Rules-Available-Rules-Utilities.adoc[tabsize=4] - -include::Dev-Concepts-and-Philosophy.adoc[tabsize=4] - -include::Rules-Creating-Rule-Operations.adoc[tabsize=4] - -include::Rules-Rulesets.adoc[tabsize=4] - -include::Ruleset-Java-Basic-Ruleset.adoc[tabsize=4] - -include::Ruleset-Java-Classifications-and-Inline-Hints.adoc[tabsize=4] - -include::Ruleset-Java-EE-Apps.adoc[tabsize=4] - -include::Ruleset-Java-EE-Servers.adoc[tabsize=4] - -include::Ruleset-Reporting.adoc[tabsize=4] - -include::Ruleset-XML.adoc[tabsize=4] - -include::Rules-Windup-Models.adoc[tabsize=4] - -include::Rules-Create-Java-Queries.adoc[tabsize=4] - -include::Rules-Rules-Metadata.adoc[tabsize=4] - -include::Rules-Rules-Operations.adoc[tabsize=4] - -include::Rules-Ops-Reporting-Classification.adoc[tabsize=4] - -include::Rules-Ops-Reporting-Hint.adoc[tabsize=4] - -include::Rules-Ops-Reporting-TypeReference.adoc[tabsize=4] - -include::Rules-Ops-Xml-XsltTrasformation.adoc[tabsize=4] - -== Debugging and Troubleshooting - -include::Dev-Debugging-and-Profiling.adoc[tabsize=4] - -include::Dev-Troubleshoot-Windup-Issues.adoc[tabsize=4] - -== Wiki Information - -include::About-the-Windup-Wiki.adoc[tabsize=4] - -include::Dev-Add-Images-to-the-Windup-Wiki.adoc[tabsize=4] - -== Windup Product Release and Documentation Process - -include::Dev-Windup-Release-Process.adoc[tabsize=4]] - -include::Dev-Create-Windup-JavaDoc.adoc[tabsize=4] - -include::Dev-Windup-Documentation-Process.adoc[tabsize=4] - -== Additional Resources - -include::Review-the-Windup-Quickstarts.adoc[tabsize=4] - -include::Get-Involved.adoc[tabsize=4] - -include::Known-Issues.adoc[tabsize=4] - -include::Report-Issues-with-Windup.adoc[tabsize=4] - -== Appendix - -include::Glossary.adoc[tabsize=4] - -include::Dev-Windup-Project-Information.adoc[tabsize=4] +include::Windup-Core-Development-Guide-Topics.adoc[tabsize=4] diff --git a/docs/Windup-Rules-Development-Guide-NO-TOC.adoc b/docs/Windup-Rules-Development-Guide-NO-TOC.adoc new file mode 100644 index 0000000000..d0ca51c2c8 --- /dev/null +++ b/docs/Windup-Rules-Development-Guide-NO-TOC.adoc @@ -0,0 +1,6 @@ += Windup Rules Development Guide + +include::Windup-Rules-Development-Guide-Topics.adoc[tabsize=4] + + + diff --git a/docs/Windup-Rules-Development-Guide-Topics.adoc b/docs/Windup-Rules-Development-Guide-Topics.adoc new file mode 100644 index 0000000000..7e19a825cb --- /dev/null +++ b/docs/Windup-Rules-Development-Guide-Topics.adoc @@ -0,0 +1,81 @@ +== Overview + +This guide is for engineers, consultants, and others who plan to create +custom rules for Windup 2.0. + +include::What-is-Windup.adoc[tabsize=4] + +include::Features-of-Windup-2.0.adoc[tabsize=4] + +include::About-the-WINDUP_HOME-Variable.adoc[tabsize=4] + +== Get Started + +include::Install-Windup.adoc[tabsize=4] + +include::Execute-Windup.adoc[tabsize=4] + +include::Review-the-Report.adoc[tabsize=4] + +== Understand the Rule Processing + +include::Windup-Processing-Overview.adoc[tabsize=4] + +include::Rules-Rule-Execution-Lifecycle.adoc[tabsize=4] + +include::Rules-Rule-Story-Points.adoc[tabsize=4] + +include::Rules-Difference-Between-XML-based-and-Java-based-Rules.adoc[tabsize=4] + +== Create and Test Java Rule Addons + +include::Install-and-Configure-Maven.adoc[tabsize=4] + +include::Rules-Java-based-Rule-Structure.adoc[tabsize=4] + +include::Rules-Basic-Rule-Execution-Flow-Patterns.adoc[tabsize=4] + +include::Rules-Create-a-Basic-Java-based-Rule-Add-on.adoc[tabsize=4] + +// This is not ready for prime time... include::Rules-Create-an-Advanced-Ruleset.adoc[tabsize=4] + +== Create and Test XML Rules + +include::Rules-Create-a-Basic-XML-Rule.adoc[tabsize=4] + +include::Rules-XML-Rule-When-Condition-Syntax.adoc[tabsize=4] + +include::Rules-XML-Rule-Perform-Action-Syntax.adoc[tabsize=4] + +include::Rules-Test-a-Basic-XML-Rule-in-Windup.adoc[tabsize=4] + +== Debugging and Troubleshooting + +include::Dev-Debugging-and-Profiling.adoc[tabsize=4] + +include::Dev-Troubleshoot-Windup-Issues.adoc[tabsize=4] + +== Additional Resources + +include::Get-Involved.adoc[tabsize=4] + +include::Review-the-Windup-Quickstarts.adoc[tabsize=4] + +include::Rules-Available-Rules-Utilities.adoc[tabsize=4] + +include::Known-Issues.adoc[tabsize=4] + +include::Report-Issues-with-Windup.adoc[tabsize=4] + +== Appendix + +include::Glossary.adoc[tabsize=4] + +include::Windup-Architectural-Components.adoc[tabsize=4] + +// This is not ready for prime time... include::Dev-Dependencies.adoc[tabsize=4] + +include::Rules-Windup-Models.adoc[tabsize=4] + + + diff --git a/docs/Windup-Rules-Development-Guide.adoc b/docs/Windup-Rules-Development-Guide.adoc index 5344e2cb57..7b238a3fd0 100644 --- a/docs/Windup-Rules-Development-Guide.adoc +++ b/docs/Windup-Rules-Development-Guide.adoc @@ -4,84 +4,7 @@ :toclevels: 4 :numbered: -== Overview - -This guide is for engineers, consultants, and others who plan to create -custom rules for Windup 2.0. - -include::What-is-Windup.adoc[tabsize=4] - -include::Features-of-Windup-2.0.adoc[tabsize=4] - -include::About-the-WINDUP_HOME-Variable.adoc[tabsize=4] - -== Get Started - -include::Install-Windup.adoc[tabsize=4] - -include::Execute-Windup.adoc[tabsize=4] - -include::Review-the-Report.adoc[tabsize=4] - -== Understand the Rule Processing - -include::Windup-Processing-Overview.adoc[tabsize=4] - -include::Rules-Rule-Execution-Lifecycle.adoc[tabsize=4] - -include::Rules-Rule-Story-Points.adoc[tabsize=4] - -include::Rules-Difference-Between-XML-based-and-Java-based-Rules.adoc[tabsize=4] - -== Create and Test Java Rule Addons - -include::Install-and-Configure-Maven.adoc[tabsize=4] - -include::Rules-Java-based-Rule-Structure.adoc[tabsize=4] - -include::Rules-Basic-Rule-Execution-Flow-Patterns.adoc[tabsize=4] - -include::Rules-Create-a-Basic-Java-based-Rule-Add-on.adoc[tabsize=4] - -// This is not ready for prime time... include::Rules-Create-an-Advanced-Ruleset.adoc[tabsize=4] - -== Create and Test XML Rules - -include::Rules-Create-a-Basic-XML-Rule.adoc[tabsize=4] - -include::Rules-XML-Rule-When-Condition-Syntax.adoc[tabsize=4] - -include::Rules-XML-Rule-Perform-Action-Syntax.adoc[tabsize=4] - -include::Rules-Test-a-Basic-XML-Rule-in-Windup.adoc[tabsize=4] - -== Debugging and Troubleshooting - -include::Dev-Debugging-and-Profiling.adoc[tabsize=4] - -include::Dev-Troubleshoot-Windup-Issues.adoc[tabsize=4] - -== Additional Resources - -include::Get-Involved.adoc[tabsize=4] - -include::Review-the-Windup-Quickstarts.adoc[tabsize=4] - -include::Rules-Available-Rules-Utilities.adoc[tabsize=4] - -include::Known-Issues.adoc[tabsize=4] - -include::Report-Issues-with-Windup.adoc[tabsize=4] - -== Appendix - -include::Glossary.adoc[tabsize=4] - -include::Windup-Architectural-Components.adoc[tabsize=4] - -// This is not ready for prime time... include::Dev-Dependencies.adoc[tabsize=4] - -include::Rules-Windup-Models.adoc[tabsize=4] +include::Windup-Rules-Development-Guide-Topics.adoc[tabsize=4] diff --git a/docs/Windup-User-Guide-NO-TOC.adoc b/docs/Windup-User-Guide-NO-TOC.adoc new file mode 100644 index 0000000000..73a1f7e3df --- /dev/null +++ b/docs/Windup-User-Guide-NO-TOC.adoc @@ -0,0 +1,8 @@ += Windup User Guide + +//:toc: +//:toclevels: 4 +//:numbered: + +include::Windup-User-Guide-Topics.adoc[tabsize=4] + diff --git a/docs/Windup-User-Guide-Topics.adoc b/docs/Windup-User-Guide-Topics.adoc new file mode 100644 index 0000000000..b4b0db6479 --- /dev/null +++ b/docs/Windup-User-Guide-Topics.adoc @@ -0,0 +1,44 @@ +== Overview + +This guide is for engineers, consultants, and others who plan to use +Windup 2.0 to migrate Java applications or other components. + +include::What-is-Windup.adoc[tabsize=4] + +include::Features-of-Windup-2.0.adoc[tabsize=4] + +include::About-the-WINDUP_HOME-Variable.adoc[tabsize=4] + +== Get Started + +include::Install-Windup.adoc[tabsize=4] + +include::Execute-Windup.adoc[tabsize=4] + +include::Review-the-Report.adoc[tabsize=4] + +== Additional Resources + +include::Review-the-Windup-Quickstarts.adoc[tabsize=4] + +include::Get-Involved.adoc[tabsize=4] + +include::Known-Issues.adoc[tabsize=4] + +include::Report-Issues-with-Windup.adoc[tabsize=4] + +== Appendix + +include::Glossary.adoc[tabsize=4] + +include::Windup-Processing-Overview.adoc[tabsize=4] + +include::Windup-Architectural-Components.adoc[tabsize=4] + +include::Rules-Rule-Execution-Lifecycle.adoc[tabsize=4] + +include::Rules-Rule-Story-Points.adoc[tabsize=4] + + + + diff --git a/docs/Windup-User-Guide.adoc b/docs/Windup-User-Guide.adoc index 19c0e0a6df..dff2adf7b3 100644 --- a/docs/Windup-User-Guide.adoc +++ b/docs/Windup-User-Guide.adoc @@ -4,47 +4,5 @@ :toclevels: 4 :numbered: -== Overview - -This guide is for engineers, consultants, and others who plan to use -Windup 2.0 to migrate Java applications or other components. - -include::What-is-Windup.adoc[tabsize=4] - -include::Features-of-Windup-2.0.adoc[tabsize=4] - -include::About-the-WINDUP_HOME-Variable.adoc[tabsize=4] - -== Get Started - -include::Install-Windup.adoc[tabsize=4] - -include::Execute-Windup.adoc[tabsize=4] - -include::Review-the-Report.adoc[tabsize=4] - -== Additional Resources - -include::Review-the-Windup-Quickstarts.adoc[tabsize=4] - -include::Get-Involved.adoc[tabsize=4] - -include::Known-Issues.adoc[tabsize=4] - -include::Report-Issues-with-Windup.adoc[tabsize=4] - -== Appendix - -include::Glossary.adoc[tabsize=4] - -include::Windup-Processing-Overview.adoc[tabsize=4] - -include::Windup-Architectural-Components.adoc[tabsize=4] - -include::Rules-Rule-Execution-Lifecycle.adoc[tabsize=4] - -include::Rules-Rule-Story-Points.adoc[tabsize=4] - - - +include::Windup-User-Guide-Topics.adoc[tabsize=4] diff --git a/docs/Windup-lab-scripts.adoc b/docs/Windup-lab-scripts.adoc new file mode 100644 index 0000000000..6e6c29cc79 --- /dev/null +++ b/docs/Windup-lab-scripts.adoc @@ -0,0 +1,120 @@ +[[Windup-Lab-Scripts]] +=== Windup Lab Scripts + +Semi-automated installation script (for Linux). + +This is a basis for a script that will automatically install everything in one run. Appropriate for multiple machines in a lab. + +[source,bash] +-------------------------------------------------------------------------------------------- +## Check if installed +HAS_MVN=$(echo $((`mvn -v > /dev/null ; echo $?` == 0)) ) +MVN='mvn' +ROOT_DIR=`pwd` + +## Download +wget -bc http://download.netbeans.org/netbeans/8.0.2/final/bundles/netbeans-8.0.2-javase-linux.sh & echo $! > nb.pid +wget ftp://mirror.reverse.net/pub/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.zip & echo $! > mvn.pid +git clone https://github.com/windup/windup-rulesets.git windup-rulesets & echo $! > windup-rs.pid +git clone https://github.com/windup/windup.git windup & echo $! > windup.pid +git clone https://github.com/windup/windup-distribution.git windup & echo $! > windup-dist.pid +git clone https://github.com/windup/windup-quickstarts.git & echo $! > windup-qs.pid +git clone https://github.com/windup/maven-indexer.git & echo $! > maven-indexer.pid +git clone https://github.com/windup/nexus-repository-indexer.git & echo $! > nexus-ri.pid +wait $( nb.pid + +## Maven 3.2.5+ +if [ ! $HAS_MVN ] ; then + unzip -q apache-maven-3.2.5-bin.zip + MVN=$PWD/apache-maven-3.2.5/bin/mvn +fi + +## settings.xml with JBoss Maven repository +wget https://raw.github.com/wiki/windup/windup/files/settings.xml +if [ ! -x ~/.m2/settings.xml] ; then + cp settings.xml ~/.m2/settings.xml +fi + + +## Necessary dependencies... +cd maven-indexer/ +$MVN install -DskipTests +cd .. + +cd nexus-repository-indexer/ +$MVN install -DskipTests +cd .. + +## Windup +cd windup/ +$MVN install -DskipTests -s settings.xml +cd .. + +## Windup Dist +cd windup-distribution/ +$MVN install -DskipTests -s settings.xml +cd .. + +## Windup Rulesets +cd windup-rulesets/ +$MVN install -DskipTests & echo $! > windup-rs.pid +cd .. + +## Windup QuickStarts +#firefox https://github.com/windup/windup-quickstarts +cd windup-quickstarts/ +$MVN install -DskipTests & echo $! > windup-qs.pid +cd .. + +wait $( + + + + + + +Windup Core Development Guide + + + + + +
+
+

Overview

+
+
+

This guide is for developers who plan to contribute source code updates +or core rule add-ons to the Windup 2.0 project.

+
+
+

Windup Logo

+
+
+
+

What is Windup?

+
+

JBoss Windup is a rule-based tool to simplify application migrations.

+
+
+

Running from a Forge environment, the tool examines EAR, WAR, and +JAR deployments (or a project source directory) and produces an HTML report detailing the inner workings of +the Java application to simplify migration efforts. It seeks to make +migrating from other containers to JBoss EAP a piece of cake.

+
+
+

Windup 2.0 vs. Windup 0.7.x

+
+

Windup 2.0 aims to deliver the same functionality as legacy Windup, however, the internal architecture and rule structure is very different and allows for the creation of much more complex rules.

+
+
+
+

How Does Windup Simplify Migration?

+
+

Windup looks for common resources and highlight technologies and known “trouble +spots” in migrating applications. The goal of Windup is to provide a +high level view into relevant technologies in use within the +application, and provide a consumable report for organizations to +estimate, document, and migrate enterprise applications to Java EE and JBoss EAP.

+
+
+

These are some of the of the areas targetted by current core Windup rulesets:

+
+ ++++ + + + + + + + + + + + + + + + + + + + + +
RulesetDescription

Java code

Reads compiled Java files, determines if blacklisted classes are imported, and if so, continues to profile the resource.

JSP code

Reads JSP files, extracts the JSP imports and taglibs, and continues to +profile the resource

XML configuration

Reads XML files into a DOM objects and continues to profile the resource.

+
+
+

Follow Windup on Twitter!

+
+

Follow Windup on Twitter @JBossWindup for updates and more!

+
+
+
+
+

Features of Windup 2.0

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Shared Data Model + +

Windup 2.0 creates a shared data model graph that provides the following benefits.

+
+
    +
  • +

    It enables complex rule interaction, allowing rules to pass findings to other rules.

    +
  • +
  • +

    It enables 3rd-party plug-ins to interact with other plugins, rules and reports.

    +
  • +
  • +

    The data graph organizes the findings to be searchable and queryable.

    +
  • +
+
+
+Extensibility + +

Windup 2.0 can be extended by developers, users, and 3rd-parties.

+
+
    +
  • +

    It provides a plug-in API to inject other applications into Windup.

    +
  • +
  • +

    It enables 3rd-parties to create simple POJO plug-ins that can interact with the data graph.

    +
  • +
  • +

    Means we don’t have to invent everything. Users with domain knowledge can implement their own rules.

    +
  • +
+
+
+Better Rules + +

Windup 2.0 provides more powerful and complex rules.

+
+
    +
  • +

    XML-based rules are simple to write and and easy to implement.

    +
  • +
  • +

    Java-based rule add-ons are based on OCPsoft Rewrite and provide greater flexibility and power creating when rules.

    +
  • +
  • +

    Rules can now be nested to handle more complex situations. This means you can nest simple statements rather than use complex XPATH or REGEX expressions. +*Rules can be linked using and/or statements

    +
  • +
+
+
+Automation + +

Windup 2.0 has the ability to automate some of the migration processes.

+
+
    +
  • +

    Windup is integrated with Forge 2.0, meaning it can generate projects, libraries, and configuration files.

    +
  • +
  • +

    Rules can create Forge inputs and put them into the data graph.

    +
  • +
  • +

    During the automation phase, the data graph inputs can be processed to generate a new project.

    +
  • +
+
+
+Work Estimation + +

Estimates for the level of effort is based on the skills required and the classification of migration work needed.

+
+
    +
  • +

    Lift and Shift - The code or file is standards-based and can be ported to the new environment with no changes.

    +
  • +
  • +

    Mapped - There is a standard mapping algorithm to port the code or file to the new environment.

    +
  • +
  • +

    Custom – The code or file must be rewritten or modified to work in the new environment.

    +
  • +
+
+
+Better Reporting + +

Windup 2.0 reports are now targeted for specific audiences.

+
+
    +
  • +

    IT Management - Applications are ranked by cost of migration.

    +
  • +
  • +

    Project Management - Reports detail the type of work and estimation of effort to complete the tasks.

    +
  • +
  • +

    Developers - An Eclipse plug-in provides hints and suggested code changes within the IDE.

    +
  • +
+
+
+
+
+
+

About the WINDUP_HOME Variable

+
+

This documentation uses the WINDUP_HOME replaceable value to denote the path to the Windup distribution. When you encounter this value in the documentation, be sure to replace it with the actual path to your Windup installation.

+
+
+
    +
  • +

    If you download and install the latest distribution of Windup from the JBoss Nexus repository, WINDUP_HOME refers to the windup-distribution-2.0.0.VERSION folder extracted from the downloaded ZIP file.

    +
  • +
  • +

    If you build Windup from GitHub source, WINDUP_HOME refers to the windup-distribution-2.0.0-VERSION folder extracted from the Windup source dist/target/windup-distribution-2.0.0-VERSION.zip file.

    +
  • +
+
+
+
+
+
+

Get Started

+
+
+

Before you begin to contribute to Windup, take a quick tour to see how to use it.

+
+
+

Install and Configure Maven

+
+

If you plan to contribute to the core code base or create Java-based rule add-ons, you must first install and configure Maven to build Windup from source.

+
+
+

Download and Install Maven

+
+

If you plan to use Eclipse Luna (4.4) to build Windup, you can skip this +step and go directly to the section entitled Configure Maven to Build Windup. This version of Eclipse embeds Maven 3.2.1 so you do not need to +install it separately.

+
+
+

If you plan to run Maven using the command line or plan to use Red Hat +JBoss Developer Studio 7.1.1 or an older version of Eclipse, you must +install Maven 3.1.1. or later.

+
+
+
    +
  1. +

    Go to Apache Maven Project - +Download Maven and download the latest distribution for your operating +system.

    +
  2. +
  3. +

    See the Maven documentation for information on how to download and +install Apache Maven for your operating system.

    +
  4. +
+
+
+
+

Configure the Maven Installation in Your IDE

+
+

JBoss Developer Studio 7.1.1 is built upon Eclipse Kepler (4.3), which +embeds Maven 3.0.4. If you plan to use JBoss Developer Studio 7.1.1 or +an Eclipse version earier than Eclipse Luna (4.4), you must replace the +embedded 3.0.4 version of Maven with this newer version.

+
+
+
    +
  1. +

    From the menu, choose Window -→ Preferences.

    +
  2. +
  3. +

    Expand Maven and click on Installations.

    +
  4. +
  5. +

    Uncheck Embedded (3.0.4/1.4.0.20130531-2315)

    +
  6. +
  7. +

    Click Add and navigate to your Maven install directory. Select it +and click OK.

    +
  8. +
  9. +

    Make sure the new external Maven installation is checked and click +OK to return to JBoss Developer Studio.

    +
  10. +
+
+
+

Note: If you use another IDE, refer to the product documentation to +update the Maven installation.

+
+
+
+

Configure Maven to Build Windup

+
+

Windup uses artifacts located in the +JBoss Nexus +repository. You must configure Maven to use this repository before you +build Windup.

+
+
+
    +
  1. +

    Open your ${user.home}/.m2/settings.xml file for editing.

    +
  2. +
  3. +

    Copy the following jboss-nexus-repository profile XML prior to the +ending </profiles> element.

    +
    +
    +
    <profile>
    +  <id>jboss-nexus-repository</id>
    +  <repositories>
    +    <repository>
    +      <id>jboss-nexus-repository</id>
    +      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    +      <releases>
    +        <enabled>true</enabled>
    +      </releases>
    +      <snapshots>
    +        <enabled>true</enabled>
    +      </snapshots>
    +    </repository>
    +  </repositories>
    +  <pluginRepositories>
    +    <pluginRepository>
    +      <id>jboss-nexus-plugin-repository</id>
    +      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    +      <releases>
    +        <enabled>true</enabled>
    +      </releases>
    +      <snapshots>
    +        <enabled>true</enabled>
    +      </snapshots>
    +    </pluginRepository>
    +  </pluginRepositories>
    +</profile>
    +
    +
    +
  4. +
  5. +

    Copy the following XML prior to the ending </activeprofiles> +element to make the profile active.

    +
    +
    +
    <activeProfile>jboss-nexus-repository</activeProfile>
    +
    +
    +
  6. +
+
+
+

You are now configured to build Windup.

+
+
+
+
+

Get the Windup Source Code

+
+

To contribute to the Windup 2.0 project source code, you must fork the Windup repository to your own Git, clone your fork, commit your work on topic branches, and make pull requests back to the Windup repository.

+
+
+

Install the Git Client

+
+

If you don’t have the Git client (git), get it from: +http://git-scm.com/

+
+
+
    +
  • +

    Be sure to generate an SSH key and add the public key to your GitHub account: https://help.github.com/articles/generating-ssh-keys. You can verify the key using the following command:

    +
    +
    +
    ssh -T git@github.com
    +
    +
    +
    +

    You should see a message indicating your ID has successfully authenticated.

    +
    +
  • +
  • +

    You should also configure your name and email identity using the following commands:

    +
    +
    +
    git config --global user_name "FIRST_NAME LAST_NAME"
    +git config --global user_email "YOUR_EMAIL_ADDRESS"
    +
    +
    +
  • +
+
+
+
+

Fork and Clone the Windup Repository

+
+
    +
  1. +

    Fork the Windup project. This +creates the windup project in your own Git with the default remote +name 'origin'.

    +
  2. +
  3. +

    Clone your fork. This creates and populates a directory in your +local file system.

    +
    +
    +
    git clone https://github.com/<your-username>/windup.git
    +
    +
    +
  4. +
  5. +

    Change to the windup directory.

    +
  6. +
  7. +

    Add the remote upstream repository so you can fetch any changes to +the original forked repository.

    +
    +
    +
    git remote add upstream git@github.com:windup/windup.git
    +
    +
    +
  8. +
  9. +

    Get the latest files from the upstream repository.

    +
    +
    +
    git fetch upstream
    +
    +
    +
  10. +
+
+
+
+
+

Build Windup from Source

+
+

This information is provided for new developers who plan to contribute code +to the Windup open source project. This section describes how to build Windup from source and how to extract the Windup distribution that is created during the build process.

+
+
+

If you use Linux and are an experienced Windup developer looking for a quick refresher, jump to: Quick Build Review for Experienced Windup Developers.

+
+
+

System Requirements to Build Windup

+
+
    +
  1. +

    Java 1.7.

    +
    +

    You can choose from the following:

    +
    +
    +
    +
    OpenJDK
    +Oracle Java SE
    +
    +
    +
  2. +
  3. +

    Maven 3.1.1 or newer

    +
    +

    If you have not yet installed or configured Maven, see +Install and Configure Maven for details.

    +
    +
    +

    If you have installed Maven, you can check the version by typing the +following in a command prompt:

    +
    +
    +
    +
    mvn --version
    +
    +
    +
  4. +
  5. +

    IDE requirements

    +
    +

    If you prefer, you can work within an IDE. The following IDEs are recommended.

    +
    + +
    +

    You must also make sure the IDE embeds Maven 3.1.1 or later. See +Install and Configure Maven for details.

    +
    +
  6. +
+
+
+
+

Build Windup Using Maven Command Line

+
+
    +
  1. +

    Make sure you have configured Maven as described here: +Install and Configure Maven.

    +
  2. +
  3. +

    Check out Windup source code: git clone git@github.com:windup/windup.git Windup. See Get the Windup Source Code for more info.

    +
  4. +
  5. +

    Open a command terminal and navigate to the root of the Windup project directory.

    +
    +
    +
        cd Windup/
    +
    +
    +
  6. +
  7. +

    To create a branch and build Windup using the latest version of the source code:

    +
    +
      +
    • +

      Fetch the latest source code from the upstream repository.

      +
      +
      +
      git fetch upstream
      +
      +
      +
    • +
    • +

      Checkout a local copy of the branch.

      +
      +
      +
      git checkout -b BRANCH_NAME upstream/master
      +
      +
      +
    • +
    +
    +
  8. +
  9. +

    If, at any point, you want to toss your changes and reset your local branch to the contents of the upstream repository, issue the following 2 commands. Do NOT do this if you have made changes that you don’t want to lose!

    +
    +
    +
    git fetch upstream
    +
    +
    +
    +
    +
    git reset --hard upstream/master
    +
    +
    +
  10. +
  11. +

    Build the project.

    +
    +
    +
    mvn clean install
    +
    +
    +
    +

    You can also build the project without the tests.

    +
    +
    +
    +
    mvn clean install -DskipTests
    +
    +
    +
  12. +
+
+
+
+

Build Windup Using Red Hat JBoss Developer Studio or Eclipse

+
+

If you prefer, you can use an IDE to build Windup.

+
+
+
    +
  1. +

    Make sure you have configured the Maven installation in your IDE as +described here: +Install +and Configure Maven.

    +
  2. +
  3. +

    Start JBoss Developer Studio or Eclipse.

    +
  4. +
  5. +

    From the menu, select FileImport.

    +
  6. +
  7. +

    In the selection list, choose MavenExisting Maven Projects, +then click Next.

    +
  8. +
  9. +

    Click Browse and navigate to the root of the Windup +project directory, then click OK.

    +
  10. +
  11. +

    After all projects are listed, click Next. Ignore any Maven build +or dependency errors and click Finish. If you get a dialog titled +Incomplete Maven Goal Execution, ignore it and click OK to continue.

    +
  12. +
  13. +

    In the Project Explorer tab, find the windup_parent project in the +list, right-click, and choose Run As -→ Maven install.

    +
  14. +
+
+
+
+

Extract the Windup Distribution Source File

+
+

The build process creates a windup-distribution-2.0.0-SNAPSHOT-offline.zip file in the Windup source dist/target/ directory.

+
+
+

Unzip the dist/target/windup-distribution-2.0.0-SNAPSHOT-offline.zip file into a directory of your choice.

+
+
+
+

Quick Build Review for Experienced Windup Developers

+
+
+
git clone git@github.com:windup/windup.git windup
+## Or if you haven't set up github account:
+#git clone https://github.com/windup/windup.git
+cd windup
+mvn clean install -DskipTests
+rm -rf /tmp/windup-zip/ /tmp/windup/
+unzip -q dist/target/windup-distribution-*-offline.zip -d /tmp/windup-zip
+mv /tmp/windup-zip/windup-distribution-* /tmp/windup
+
+
+
+
+
+

Execute Windup (Built from Windup Source)

+
+

These instructions are for Windup core developers who plan to build Windup from source to test code updates.

+
+
+
    +
  • +

    If you are new to the project and not familiar with the procedures to execute Windup, see Execute Windup. It contains complete step-by-step instructions to execute Windup and also provides command line examples.

    +
  • +
  • +

    Experienced users who need a refresher can follow the steps below.

    +
    +
    +
    mkdir tmp
    +cd tmp
    +unzip -q ../dist/target/windup-*.zip
    +cd windup-*
    +rm -rf ~/.forge/addons/
    +bin/windup.sh
    +
    +## Execute Windup
    +$ windup-migrate-app --input /home/username/work/Migration/TestApps/_apps/BradApp --output Report --packages org com net
    +
    +## Exit Windup
    +$ exit
    +
    +## View the Report
    +firefox Report/index.html
    +
    +
    +
  • +
+
+
+
+

Execute Windup

+
+

Prerequisites

+
+

Before you begin, you must gather the following information.

+
+
+
    +
  1. +

    The fully qualified path of the application archive or folder you plan to migrate.

    +
  2. +
  3. +

    The fully qualified path to a folder that will contain the resulting report information.

    +
    +
      +
    • +

      If the folder does not exist, it is created by Windup.

      +
    • +
    • +

      If the folder exists, you are prompted with the message:

      +
      +
      +
      Overwrite all contents of <OUTPUT_DIRECTORY> (anything already in the directory will be deleted)? [y/N]
      +
      +
      +
      +

      Choose "y" if you want Windup to delete and recreate the directory.

      +
      +
    • +
    • +

      If you are confident you want to overwrite the output directory, you can specify --overwrite on the command line to automatically delete and recreate the directory.

      +
      + + + + + +
      +
      Note
      +
      +Be careful not to specify a directory that contains important information! +
      +
      +
    • +
    +
    +
  4. +
  5. +

    You must also provide a list of the application packages to be evaluated.

    +
    +
      +
    • +

      In most cases, you are interested only in evaluating the custom application class packages and not the standard Java EE or 3rd party packages. For example, if the MyCustomApp application uses the package com.mycustomapp, you provide that package using the --packages argument on the command line. It is not necessary to provide the standard Java EE packages, like java.util or javax.ejb.

      +
    • +
    • +

      While you can provide package names for standard Java EE 3rd party software like org.apache, it is usually best not to include them as they should not impact the migration effort.

      +
    • +
    • +

      If you omit the --packages argument, every package in the application is scanned, resulting in very slow performance. It is best to provide the argument with one or more packages.

      +
    • +
    +
    +
  6. +
+
+
+
+

Start Windup

+
+

For information about the use of WINDUP_HOME in the instructions below, see About the WINDUP_HOME Variable.

+
+
+
    +
  1. +

    Open a terminal and navigate to the WINDUP_HOME/bin directory

    +
  2. +
  3. +

    Type the following command to start Windup:

    +
    +
    +
    For Linux:    WINDUP_HOME/bin $ ./windup
    +For Windows:  C:\WINDUP_HOME\bin> windup
    +
    +
    +
  4. +
  5. +

    You are presented with the following prompt.

    +
    +
    +
    Using Windup at WINDUP_HOME
    +
    + _       ___           __
    +| |     / (_)___  ____/ /_  ______
    +| | /| / / / __ \/ __  / / / / __ \
    +| |/ |/ / / / / / /_/ / /_/ / /_/ /
    +|__/|__/_/_/ /_/\__,_/\__,_/ .___/
    +                          /_/
    +
    +JBoss Windup, version [ 2.0.0-VERSION ] - JBoss, by Red Hat, Inc. [ http://windup.jboss.org ]
    +
    +[windup-distribution-2.0.0-VERSION]$
    +
    +
    +
  6. +
+
+
+
+

Run Windup

+
+
    +
  1. +

    The command to run Windup is windup-migrate-app.

    +
  2. +
  3. +

    This command can take arbitrary options processed by different addons. The list of options in the core Windup distribution can be found in Javadoc. Most commonly used command line arguments are:

    +
    +
    +
    --input INPUT_ARCHIVE_OR_FOLDER
    +
    +

    This is the fully qualified application archive or source path.

    +
    +
    --output OUTPUT_REPORT_DIRECTORY
    +
    +

    The fully qualified path to the folder that will contain the the report information produced by Windup.

    +
    + + + + + +
    +
    Note
    +
    +If the OUTPUT_REPORT_DIRECTORY directory exists and you do not specify the --overwrite argument, you are prompted to overwrite the contents. If you respond "y", it is deleted and recreated by Windup, so be careful not to specify an output directory that contains important information! +
    +
    +
    +
    --overwrite (optional)
    +
    +

    Specify this optional argument only if you are certain you want to force Windup to delete the existing OUTPUT_REPORT_DIRECTORY. The default value is false.

    +
    +
    --userRulesDirectory
    +
    +

    Points to a directory to load XML rules from. (Search pattern: *.windup.groovy and *.windup.xml)

    +
    +
    --packages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)
    +
    +

    This is a comma-delimited list of the packages to be evaluated by Windup.

    +
    +
    --excludePackages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)
    +
    +

    This is a comma-delimited list of the packages to be excluded by Windup.

    +
    +
    --source-mode true (optional)
    +
    +

    This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

    +
    +
    +
    +
  4. +
  5. +

    To evaluate an application archive, use the following syntax:

    +
    +
    +
    windup-migrate-app --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
    +
    +
    +
    +

    To run Windup against application source code, you must add the --sourceMode true argument:

    +
    +
    +
    +
    windup-migrate-app --sourceMode true --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
    +
    +
    +
    +

    See Windup Command Examples below for concrete examples of commands that use source code directories and archives located in the Windup GitHub repository.

    +
    +
  6. +
  7. +

    You should see the following result upon completion of the command:

    +
    +
    +
    ***SUCCESS*** Windup execution successful!
    +
    +
    +
  8. +
  9. +

    To exit Windup, type:

    +
    +
    +
    exit
    +
    +
    +
  10. +
  11. +

    Open the OUTPUT_REPORT_DIRECTORY/index.html file in a browser to access the report. +The following subdirectories in the OUTPUT_REPORT_DIRECTORY contain the supporting information for the report:

    +
    +
    +
    OUTPUT_REPORT_DIRECTORY/
    +    graph/
    +    renderedGraph/
    +    reports/
    +    stats/
    +    index.html
    +
    +
    +
  12. +
  13. +

    For details on how to evaluate the report data, see Review the Report.

    +
  14. +
+
+
+
+

Run Windup in Batch Mode

+
+

Windup can be also executed in batch mode within a shell or batch script using the --evaluate argument as follows.

+
+
+
    +
  1. +

    Open a terminal and navigate to the WINDUP_HOME directory.

    +
  2. +
  3. +

    Type the following command to run Windup in batch mode:

    +
    +
    +
    For Linux:     $ bin/windup --evaluate "windup-migrate-app --input INPUT_ARCHIVE --output OUTPUT_REPORT --packages PACKAGE_1 PACKAGE_2 PACKAGE_N"
    +For Windows:   > bin\windup.bat --evaluate "windup-migrate-app --input INPUT_ARCHIVE --output OUTPUT_REPORT --packages PACKAGE_1 PACKAGE_2 PACKAGE_N"
    +
    +
    +
  4. +
+
+
+
+

Windup Help

+
+

To see the complete list of available arguments for the windup-migrate-app command, execute the following command in the Windup prompt:

+
+
+
+
man windup-migrate-app
+
+
+
+
+

Windup Command Examples

+
+

The following Windup command examples report against applications located in the Windup source test-files directory.

+
+
+
Source Code Example
+
+

The following command runs against the seam-booking-5.2 application source code. It evaluates all org.jboss.seam packages and creates a folder named 'seam-booking-report' in the /home/username/windup-reports/ directory to contain the reporting output.

+
+
+
+
windup-migrate-app --sourceMode true --input /home/username/windup-source/test-files/seam-booking-5.2/ --output /home/username/windup-reports/seam-booking-report --packages org.jboss.seam
+
+
+
+
+
Archive Example
+
+

The following command runs against the jee-example-app-1.0.0.ear EAR archive. It evaluates all com.acme and org.apache packages and creates a folder named 'jee-example-app-1.0.0.ear-report' in the /home/username/windup-reports/ directory to contain the reporting output.

+
+
+
+
windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache
+
+
+
+
+
Windup Batch Example
+
+

The following Windup batch command runs against the jee-example-app-1.0.0.ear EAR archive. It evaluates all com.acme and org.apache packages and creates a folder named 'jee-example-app-1.0.0.ear-report' in the /home/username/windup-reports/ directory to contain the reporting output.

+
+
+
+
For Linux: $ bin/windup --evaluate "windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache"
+For Windows: > bin\windup.bat --evaluate "windup-migrate-app --input \windup-source\test-files\jee-example-app-1.0.0.ear --output \windup-reports\jee-example-app-1.0.0.ear-report --packages com.acme org.apache
+
+
+
+
+
Windup Quickstart Examples
+
+

For more concrete examples, see the Windup quickstarts located on GitHub here: https://github.com/windup/windup-quickstarts. If you prefer, you can download the 2.0.0.Alpha1 release ZIP or TAR distribution of the quickstarts.

+
+
+

The quickstarts provide examples of Java-based and XML-based rules you can run and test using Windup. The README instructions provide a step-by-step guide to run the quickstart example. You can also look through the code examples and use them as a starting point for creating your own rules.

+
+
+
+
+
+

Review the Report

+
+

About the Report

+
+

When you execute Windup, the report is generated in the OUTPUT_REPORT_DIRECTORY you specify for the --output argument in the command line. This output directory contains the following files and subdirectories:

+
+
+
    +
  • +

    index.html: This is the landing page for the report.

    +
  • +
  • +

    archives/: Contains the archives extracted from the application

    +
  • +
  • +

    graph/: Contains binary graph database files

    +
  • +
  • +

    reports/: This directory contains the generated HTML report files

    +
  • +
  • +

    stats/: Contains Windup performance statistics

    +
  • +
+
+
+

The examples below use the test-files/jee-example-app-1.0.0.ear located in the Windup GitHub source repository for input and specify the com.acme and org.apache package name prefixes to scan. For example:

+
+
+
+
windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache
+
+
+
+
+

Open the Report

+
+

Use your favorite browser to open the index.html file located in the output report directory. You should see something like the following:

+
+
+

Report Index Page

+
+
+

Click on the link under the Name column to view the Windup application report page.

+
+
+
+

Report Sections

+
+
Application Report Page
+
+

The first section of the application report page summarizes the migration effort. It provides the total Story Points and a graphically displays the effort by technology. A Story Point is a term commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

+
+
+
    +
  • +

    The migration of the JEE Example App EAR is assigned a total of 42 story points. A pie chart shows the breakdown of story points by package.

    +
  • +
  • +

    This is followed by a section for each of the archives contained in the EAR. It provides the total of the story points assigned to the archive and lists the files contained in archive along with the warnings and story point assigned to each file.

    +
  • +
+
+
+

The following is an example of a Windup Application Report.

+
+
+

Report Summary Page

+
+
+
+
Archive Analysis Sections
+
+

Each archive summary begins with a total of the story points assigned to its migration, followed by a table detailing the changes required for each file in the archive. The report contains the following columns.

+
+
+
+
Name
+
+

The name of the file being analyzed

+
+
Technology
+
+

The type of file being analyzed. For example:

+
+
    +
  • +

    Java Source

    +
  • +
  • +

    Decompiled Java File

    +
  • +
  • +

    Manifest

    +
  • +
  • +

    Properties

    +
  • +
  • +

    EJB XML

    +
  • +
  • +

    Spring XML

    +
  • +
  • +

    Web XML

    +
  • +
  • +

    Hibernate Cfg

    +
  • +
  • +

    Hibernate Mapping

    +
  • +
+
+
+
Issues
+
+

Warnings about areas of code that need review or changes.

+
+
Estimated Story Points
+
+

Level of effort required for migrating the file.

+
+
+
+
+

The following is an example of the archive analysis summary section of a Windup Report. In this example, it’s the analysis of the WINDUP_SOURCE/test-files/jee-example-app-1.0.0.ear/jee-example-services.jar.

+
+
+

Report Archive Page

+
+
+
+
File Analysis Pages
+
+

The analysis of the jee-example-services.jar lists the files in the JAR and the warnings and story points assigned to each one. Notice the com.acme.anvil.listener.AnvilWebLifecycleListener file has 5 warnings and is assigned 7 story points. Click on the file to see the detail.

+
+
+
    +
  • +

    The Information section provides a summary of the story points and notes that the file was decompiled by Windup.

    +
  • +
  • +

    This is followed by the file source code listing. Warnings appear in the file at the point where migration is required.

    +
  • +
+
+
+

In this example, warnings appear at the import of weblogic.application.ApplicationLifecycleEvent and report that the class is proprietary to WebLogic and must be removed.

+
+
+

File Detail - Part 1

+
+
+

Later in the code, warnings appear for the creation of the InitialContext and for the object name when registering and unregistering an MBeans

+
+
+

File Detail - Part 2

+
+
+
+
+

Additional Reports

+
+

Explore the Windup OUTPUT_REPORT_DIRECTORY/reports folder to find additional reporting information.

+
+
+
Rule Provider Execution Report
+
+

The OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html page provides the list of rule providers that executed when running the Windup migration command against the application.

+
+
+

RuleProvider Report

+
+
+
+
Rule Provider Execution Report
+
+

The OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html page provides the list of rule providers that executed when running the Windup migration command against the application.

+
+
+
+
Individual File Analysis Reports
+
+

You can directly access the the file analysis report pages described above by browsing for them by name in the OUTPUT_REPORT_DIRECTORY/reports/ directory. Because the same common file names can exist in multiple archives, for example "manifest.mf" or "web.xml", Windup adds a unique numeric suffix to each report file name.

+
+
+

Report Directory File List

+
+
+
+
+
+
+
+

Developer Contributing Information

+
+
+

Development Guidelines and Conventions

+ +
+

Project Source Code Formatting

+
+

All project source code contributed to Windup should be formatted using the settings defined in the Eclipse_Code_Format_Profile.xml file located in the root directory of the Windup project.

+
+
+
Eclipse IDE
+
+
    +
  1. +

    In Eclipse, choose Windows → Preferences.

    +
  2. +
  3. +

    Expand Java → Code Style → Formatter

    +
  4. +
  5. +

    Click Import

    +
  6. +
  7. +

    Browse to the Eclipse_Code_Format_Profile.xml located in the root of the Windup project directory, then click 'OK'.

    +
  8. +
+
+
+
+
Netbeans IDE
+
+

Use this file to format Windup source code:

+
+ +
+
+
IntelliJ IDEA
+
+

Use this file to format Windup source code:

+
+ +
+
+
+

Source Code Naming Conventions

+
+
Class Interface and Implementation Names
+
+
    +
  • +

    Do not name interfaces using the prefix 'I' for interface names. Instead, use a descriptive term for the interface, like Module.java.

    +
  • +
  • +

    The implementation class name should begin with a descriptive name, followed by the interface name, for example, for example JavaHandlerModule.java

    +
  • +
+
+
+
+
Standard Prefixes and Suffixes
+
+
    +
  • +

    Append all RuleProvider class names with RuleProvider.

    +
  • +
  • +

    Append all XML rule file names with .windup.xml

    +
  • +
  • +

    Append all Model class names with Model.

    +
  • +
  • +

    All test names should be prefixed with 'Test'.

    +
  • +
  • +

    Property constants: TBD

    +
  • +
+
+
+
+
+

Maven Project Naming Conventions

+
+
Maven Module Names
+
+

The following are not really accurate at this time. This is still TBD!

+
+
+
    +
  • +

    Lowercase with dashes. Start with windup-.

    +
  • +
  • +

    Ruleset add-ons start with windup-rules-.

    +
  • +
+
+
+
+
+
+

Submit Code Updates to the Windup Project

+
+

To get the Windup Source Code, see Get the Windup Source Code for instructions.

+
+
+
    +
  1. +

    Open a command terminal and navigate to the root of the Windup project directory.

    +
  2. +
  3. +

    Create a new topic branch to contain your features, changes, or fixes using the git checkout command:

    +
    +
    +
     git checkout -b  <topic-branch-name> upstream/master
    +
    +
    +
    +

    If you are fixing a JIRA, it is a good practice to use the number in the +branch name. For example:

    +
    +
    +
    +
    git checkout -b WINDUP-225 upstream/master
    +
    +
    +
  4. +
  5. +

    Make changes or updates to the source files. Be sure to test the changes thoroughly!

    +
  6. +
  7. +

    When you are sure your updates are ready and working, use the git add command to add new or changed file contents to the +staging area.

    +
    +
    +
    git add <folder-name>/
    +git add <file-name>
    +
    +
    +
  8. +
  9. +

    Use the git status command to view the status of the files in the +directory and in the staging area and ensure that all modified files are +properly staged:

    +
    +
    +
    git status
    +
    +
    +
  10. +
  11. +

    Commit your changes to your local topic branch. For example:

    +
    +
    +
    git commit -m 'WINDUP-225: Description of change...'
    +
    +
    +
  12. +
  13. +

    Push your local topic branch to your GitHub forked repository. This +will create a branch on your GitHub fork repository with the same name as +your local topic branch name.

    +
    +
    +
    git push origin HEAD
    +
    +
    +
    +

    Note: The above command assumes your remote repository is named +'origin'. You can verify your forked remote repository name using the +command `git remote -v`.

    +
    +
  14. +
  15. +

    Browse to the newly created branch on your forked GitHub repository.

    +
    +
    +
    https://github.com/<your-username>/windup/tree/<topic-branch-name>
    +
    +
    +
  16. +
  17. +

    Open a Pull Request. For details, see +Using Pull +Requests.

    +
    +
      +
    • +

      Give the pull request a clear title and description.

      +
    • +
    • +

      Review the modifications that are to be submitted in the pull to be sure it contains +only the changes you expect.

      +
    • +
    +
    +
  18. +
  19. +

    The pull request will be reviewed and merged by a Windup project administrator.

    +
  20. +
+
+
+
+
+
+

Understand the Windup Architecture and Structure

+
+
+

Windup Architectural Components

+
+

The following open source software, tools, and APIs are used within +Windup to analyze and provide migration information. If you plan to +contribute source code to the core Windup 2.0 project, you should be +familiar with them.

+
+
+

Forge

+
+

Forge is an open source, extendable, rapid application development tool +for creating Java EE applications using Maven. For more information +about Forge 2, see: JBoss Forge.

+
+
+
+

Forge Furnace

+
+

Forge Furnace is a modular runtime container behind Forge that provides +the ability to run Forge add-ons in an embedded application. For more +information about Forge Furnace, see: +Run Forge Embedded.

+
+
+
+

TinkerPop

+
+

TinkerPop is an open source graph computing framework. For more +information, see: TinkerPop.

+
+
+
+

Titan

+
+

Titan is a scalable graph database optimized for storing and querying graphs. +For more information, see: Titan Distributed Graph Database and Titan Beginner’s Guide.

+
+
+
+

Frames

+
+

Frames represents graph data in the form of interrelated Java Objects or +a collection of annotated Java Interfaces. For more information, see: +TinkerPop Frames.

+
+
+

Windup includes several Frames extensions, which are documented here: +Frames Extensions.

+
+
+
+

Gremlin

+
+

Gremlin is a graph traversal language that allows you to query, analyze, +and manipulate property graphs that implement the Blueprints property +graph data model. For more information, see: +TinkerPop Gremlin Wiki.

+
+
+
+

Blueprints

+
+

Blueprints is an industry standard API used to access graph databases. +For more information about Blueprints, see: +TinkerPop Blueprints Wiki.

+
+
+
+

Pipes

+
+

Pipes is a dataflow framework used to process graph data. It for the +transformation of data from input to output. For more information, see: +Tinkerpop Pipes Wiki.

+
+
+
+

Rexster

+
+

Rexster is a graph server that exposes any Blueprints graph through HTTP/REST and a binary protocol called RexPro. Rexster makes extensive use of Blueprints, Pipes, and Gremlin. For more information, see: +TinkerPop Rexster Wiki.

+
+
+
+

OCPsoft Rewrite

+
+

OCPsoft Rewrite is an open source routing and URL rewriting solution for +Servlets, Java Web Frameworks, and Java EE. For more information about +Ocpsoft Rewrite, see: OCPsoft Rewrite.

+
+
+
+
+

Windup Project Structure

+
+

The Windup 2.0 project consists of the following subprojects.

+
+
+
+
config/
+
+

This project is for the engine that runs the rules and abstracts the graph operations.

+
+
decompiler/
+
+

This subproject contains an API that wraps calls to the decompiler. +Windup currently uses only one decompiler: Procyon

+
+
exec/
+
+

This subproject contains the bootstrap code to run the Windup application.

+
+
ext/
+
+

This subproject is for code extensions. It currently only contains the +Groovy rules syntax. Eventually it will contain any code that is not +related to the rules or the core code base.

+
+
graph/
+
+

This subproject contains the datastore and Frames extensions.

+
+
logging/
+
+

This is the logging subproject. This subproject may be removed, depending on the outcome of this JIRA: WINDUP-49.

+
+
reporting/
+
+

This subproject contains code that does reporting.

+
+
rules/
+
+

This subproject contains all the rules.

+
+
test-files/
+
+

This subproject contains the demo applications that are used for test input.

+
+
tests/
+
+

This subproject contains the integration test suite.

+
+
tinkerpop/
+
+

This subproject contains a code fix for Titan NPE issues.

+
+
ui/
+
+

This subproject contains experimental Forge UI code.

+
+
utils/
+
+

This subproject contains all utility code.

+
+
+
+
+
+
+
+

Rules and Rulesets

+
+
+

Windup Processing Overview

+
+

Windup is a rule-based migration tool that allows you to write customized rules to analyze the APIs, technologies, and architectures used by the applications you plan to migrate. The Windup tool also executes its own core rules through all phases of the migration process.

+
+
+

The following is a high level conceptual overview of what happens within Windup when you execute the tool against your application or archive.

+
+
+

Discovery Phase

+
+

Wnen you run the windup-migrate-app command, Windup executes its own core rules to extract files from archives, decompile classes, and analyze the application. In this phase Windup builds a data model and stores component data and relationships in a graph database, which can then be queried and updated as needed by the migration rules and for reporting purposes.

+
+
+

For more information about the phases of rule execution and how to control rule dependencies, see Rule Execution Lifecycle.

+
+
+

For more information about the graph database components, see Windup Architectural Components.

+
+
+
+

Application Migration

+
+

The next step in the process is the execution of the migration rules. In this phase, the rules typically do not execute against the application input files. Instead, they execute against the graph database model. Windup rules are independent and decoupled and they communicate with each other using the graph database model. Rules query the graph database to obtain information needed to test the rule condition. They also update the data model with information based on the result of the rule execution. This allows rules to easily interact with other rules and enables the creation of very complex rules.

+
+
+

The Windup distribution contains a large number of migration rules, but in some cases, you may need to create additional custom rules for your specific implementation. Windup’s architecture allows you to create Java-based rule addons or XML rules and add easily add them to Windup. Custom rule creation is covered in the Windup Rules Development Guide.

+
+
+
+

Generate Findings Based on the Rule Execution Results

+
+

The final step in the process is to pull data from the graph database model to generate of reports and optionally generate scripts. Again, Windup uses rules to generate the final output.

+
+
+

By default, Windup generates the following reports at the end of the application migration process. The reports are located in the reports/ subdirectory of the output report path specified when you execute Windup:

+
+
+
    +
  • +

    Application Report: This report provides a summary of the total estimated effort, or story points, that are required for the migration. It also provides a detailed list of issues and suggested changes, broken down by archive or folder.

    +
  • +
  • +

    RuleProvider report: This is a detailed listing of the rule providers that fired when running Windup and whether any errors occurred.

    +
  • +
  • +

    Additional reports are generated that provide detailed line-by-line migration tips for individual files.

    +
  • +
+
+
+

Windup can also generate scripts to automate migration processes based on the findings. For example, some configuration files are easily mapped and can be automatically generated as part of the migration process.

+
+
+
+
+

Rule Execution Lifecycle

+
+

Rule Lifecycle

+
+

Windup executes each rule in a sequential order. The following +sections describe the phases of rule execution and how rules may specify +that one or more other rules must be executed before or after they are +run.

+
+
+

For a graphical overview of rule processing, see +this +diagram.

+
+
+
+

Rule Phases

+
+
+
INFO: Loaded [67] org.jboss.windup.config.WindupRuleProvider [
+org.jboss.windup.config.phase.Implicit
+org.jboss.windup.config.phase.Initialization
+org.jboss.windup.config.phase.Discovery
+org.jboss.windup.config.phase.ArchiveExtraction
+org.jboss.windup.config.phase.ArchiveMetadataExtraction
+org.jboss.windup.config.phase.ClassifyFileTypes
+org.jboss.windup.config.phase.DiscoverProjectStructure
+org.jboss.windup.config.phase.Decompilation
+org.jboss.windup.config.phase.InitialAnalysis
+org.jboss.windup.config.phase.MigrationRules
+org.jboss.windup.config.phase.PostMigrationRules
+org.jboss.windup.config.phase.PreReportGeneration
+org.jboss.windup.config.phase.ReportGeneration
+org.jboss.windup.config.phase.PostReportGeneration
+org.jboss.windup.config.phase.ReportRendering
+org.jboss.windup.config.phase.PostReportRendering
+org.jboss.windup.config.phase.Finalize
+org.jboss.windup.config.phase.PostFinalize
+]
+
+
+
+

By default, a rule runs during the MIGRATION_RULES phase. However, a +rule may require certain processing or actions to occur before it +executes, such as the extraction of archives and scanning of java or XML +files.

+
+
+

Rule phases provide a way for rule authors to specify and control in +which phase of the rule lifecycle the rule should execute. This is done +by overriding the WindupRuleProvider.getPhase() method. The following +example specifies this rule should execute during the INITIAL_ANALYSIS rule phase.

+
+
+
+
@Override
+public RulePhase getPhase() {
+    return InitialAnalysis.class;
+}
+
+
+
+

The following is the list of rule phases as defined in the RulePhase +enum class. Note that there are also PRE_ processing and POST_ +processing phases for each of the following rule phases.

+
+
+
+
DISCOVERY
+
+

This phase is called during resource discovery. Static files are scanned +by their basic properties, for example, the name, extension, location, +and fully qualified Java class name. Archives are unzipped in this +phase. Typically, any rule that only puts data into the graph is +executed during this phase.

+
+
INITIAL_ANALYSIS
+
+

This phase is called to perform a basic analysis of the files content. +It extracts all method names from class files, extracts metadata, such +as the XML namespace and root element, from XML files.

+
+
COMPOSITION
+
+

This phase is called to perform high-level composition operations on the +graph. For example, it may link items found in XML files to the related +Java classes or references to server resources in Java classes.

+
+
MIGRATION_RULES
+
+

This phase is the default phase for all rules unless overridden. +During this phase, migration rules attach data to the graph associated +with migration. This could include: - Hints to migrators for manual +migration - Automated migration of schemas or source segments - +Blacklists to indicate vendor specific APIs.

+
+
REPORT_GENERATION
+
+

During this phase, reporting visitors produce report data in the graph +that will later be used by the report rendering phase.

+
+
REPORT_RENDERING
+
+

This is the phase that renders the report.

+
+
FINALIZE
+
+

This phase is called to clean up resources and close streams.

+
+
+
+
+

For more information about rule phases, see the RulePhase Javadoc.

+
+
+
+

Execute Before and Execute After

+
+

A rule may specify that one or more rules must be executed before it is +run. In this case, all named rules will be fired in the order specified +before executing the the current rule.

+
+
+
+
@Override
+public List<Class<? extends WindupRuleProvider>> getExecuteBefore()
+{
+   return asClassList(RuleToFireBefore.class);
+}
+
+
+
+

A rule may also specify that one or more rules must be executed after it +is run. In this case, all named rules will be fired in the order +specified after executing the the current rule.

+
+
+
+
@Override
+public List<Class<? extends WindupRuleProvider>> getExecuteAfter()
+{
+    return asClassList(RuleToFireAfter.class);
+}
+
+
+
+
+
+

Rule Story Points

+
+

What are Story Points?

+
+

Story points are an abstract metric commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. They are based on a modified Fibonacci sequence.

+
+
+

In a similar manner, Windup uses story points to express the level of effort needed to migrate particular application constructs, and in a sum, the application as a whole. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

+
+
+
+

How Story Points are Estimated in Rules

+
+

Estimating story points for a rule can be tricky. The following are the general guidelines Windup uses when estimating the level of effort required for a rule.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Level of EffortStory PointsDescription

Lift and Shift

0

The code or file is standards-based and requires no effort.

Mapped

1- 2 per file

There is a standard mapping algorithm to port the code or file. The number of story points required is small, but is dependent on the number of files to port.

Custom

5 - 20 per change or component

+

The number of story points required to modify and rewrite code depends on the complexity of the change, the number of unknown imports, the size of the files, and the number of components. The following are examples of how to estimate story points.

+
+
+
    +
  • +

    Port MyBatis to JPA: '20' story points per query.

    +
  • +
  • +

    Port a web page from one web framework to another depends on the complexity and the number of components involved in the migration. You could estimate '20' story points per component.

    +
  • +
+
+
+
+
+

Difference Between XML-based and Java-based Rules

+
+

First of all, to prevent confusion:

+
+
    +
  1. +

    Rules can be written using XML or the Java API. We call them XML-based and Java-based Rules.

    +
  2. +
  3. +

    Independent of the syntax, the rules may inspect (classify) XML or Java code.

    +
  4. +
+
+
+

See the examples below.

+
+
+
+

Which one to choose?

+
+

The XML rules provide a quick, simple way to create rules to analyze Java and XML files. Java rules provide the ability to create very complex rules.

+
+
+
    +
  • +

    If you simply need to highlight a specific section of Java code or XML file content and provide hints for it, it is recommended that you create the rule using XML.

    +
  • +
  • +

    If you need to create a new custom report, you need to create the reporting rules using Java.

    +
  • +
  • +

    If you need to extend functionality beyond what the XML rules provide, you need to create the rule using Java.

    +
  • +
+
+
+
+

Pros and cons - XML

+
+

Pros:

+
+
+
    +
  • +

    XML rules are fairly easy to write and require less code.

    +
  • +
  • +

    You do not need to configure Maven to build from source because there is no need for compilation of +XML rules.

    +
  • +
  • +

    Deployment is simple. You simply drop the XML rule into the appropriate path and Windup automatically scans the new rule.

    +
  • +
+
+
+

Cons:

+
+
+
    +
  • +

    XML rules only support a simple subset of conditions and operations.

    +
  • +
  • +

    XML rules do not provide for direct custom graph data manipulation.

    +
  • +
  • +

    XML rules do not support the ability to create custom reports.

    +
  • +
+
+
+
+

Pros and Cons - Java

+
+

Pros:

+
+
+
    +
  • +

    Java rule add-ons allow you to write custom rules and provide a lot of flexibility.

    +
  • +
  • +

    You can set breakpoints and test Java rule add-ons using a debugger.

    +
  • +
  • +

    IDEs provide code completion for the Windup API.

    +
  • +
+
+
+

Cons:

+
+
+
    +
  • +

    You must configure Maven to compile the Windup Java rule add-ons.

    +
  • +
  • +

    Java rule add-ons that are not included in the Windup core code base must be a full Forge add-on.

    +
  • +
  • +

    Java rule add-ons require writing a lot of Java code/

    +
  • +
  • +

    Writing Java rule add-ons are complex and required knowledge of Windup internals.

    +
  • +
+
+
+
+

Examples

+
+

Example of a rule written in XML classifying Java code:

+
+
+
+
<?xml version="1.0"?>
+<ruleset xmlns="http://windup.jboss.org/v1/xml" id="EjbRules">
+    <rules>
+        <rule id="EjbRules_2fmb">
+            <when>
+                <javaclass references="javax.persistence.Entity" as="default">
+                    <location>TYPE</location>
+                </javaclass>
+            </when>
+            <perform>
+                <iteration>
+                    <classification classification="JPA Entity" effort="0"/>
+                </iteration>
+            </perform>
+        </rule>
+    </rules>
+</ruleset>
+
+
+
+

Example of a rule written in Java classifying Java code:

+
+
+
+
/**
+ * Scans for classes with EJB related annotations, and adds EJB related metadata for these.
+ */
+public class DiscoverEjbAnnotationsRuleProvider extends WindupRuleProvider
+{
+    @Override
+    public Configuration getConfiguration(GraphContext context) {
+        return ConfigurationBuilder.begin()
+        .addRule()
+        .when(JavaClass.references("javax.ejb.{annotationType}").at(TypeReferenceLocation.ANNOTATION))
+        .perform(new AbstractIterationOperation<JavaTypeReferenceModel>()
+        {
+            public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload)
+            {
+                extractEJBMetadata(event, payload);
+            };
+        })
+        .where("annotationType").matches("Stateless|Stateful")
+        .withId(ruleIDPrefix + "_StatelessAndStatefulRule")
+        .addRule()
+        .when(JavaClass.references("javax.ejb.MessageDriven").at(TypeReferenceLocation.ANNOTATION))
+        .perform(new AbstractIterationOperation<JavaTypeReferenceModel>() {
+            @Override
+            public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) {
+                extractMessageDrivenMetadata(event, payload);
+            }
+        })
+        .withId(ruleIDPrefix + "_MessageDrivenRule")
+        .addRule()
+        .when(JavaClass.references("javax.persistence.Entity").at(TypeReferenceLocation.ANNOTATION).as(ENTITY_ANNOTATIONS)
+                    .or(JavaClass.references("javax.persistence.Table").at(TypeReferenceLocation.ANNOTATION).as(TABLE_ANNOTATIONS_LIST)))
+        .perform(Iteration.over(ENTITY_ANNOTATIONS).perform(new AbstractIterationOperation<JavaTypeReferenceModel>() {
+            @Override public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) {
+                extractEntityBeanMetadata(event, payload);
+            }
+        }).endIteration())
+        .withId(ruleIDPrefix + "_EntityBeanRule");
+    }
+    ...
+}
+
+
+
+
+

Summary

+
+

The following is a draft…​ it may go.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RequirementXML RuleJava Rule Add-on

Easy to write?

Yes

Depends on the complexity of the rule

Requires that you configure Maven?

No

Yes

Requires that you compile the rule?

No

Yes

Simple deployment?

No

Yes

Supports custom reports?

No

Yes

Ability to create complex conditions and operations?

No

Yes

Ability to directly manipulate the graph data?

No

Yes

+
+
+
+
+
+

Create and Test Java Rule Add-ons

+
+
+

Install and Configure Maven

+
+

If you plan to contribute to the core code base or create Java-based rule add-ons, you must first install and configure Maven to build Windup from source.

+
+
+

Download and Install Maven

+
+

If you plan to use Eclipse Luna (4.4) to build Windup, you can skip this +step and go directly to the section entitled Configure Maven to Build Windup. This version of Eclipse embeds Maven 3.2.1 so you do not need to +install it separately.

+
+
+

If you plan to run Maven using the command line or plan to use Red Hat +JBoss Developer Studio 7.1.1 or an older version of Eclipse, you must +install Maven 3.1.1. or later.

+
+
+
    +
  1. +

    Go to Apache Maven Project - +Download Maven and download the latest distribution for your operating +system.

    +
  2. +
  3. +

    See the Maven documentation for information on how to download and +install Apache Maven for your operating system.

    +
  4. +
+
+
+
+

Configure the Maven Installation in Your IDE

+
+

JBoss Developer Studio 7.1.1 is built upon Eclipse Kepler (4.3), which +embeds Maven 3.0.4. If you plan to use JBoss Developer Studio 7.1.1 or +an Eclipse version earier than Eclipse Luna (4.4), you must replace the +embedded 3.0.4 version of Maven with this newer version.

+
+
+
    +
  1. +

    From the menu, choose Window -→ Preferences.

    +
  2. +
  3. +

    Expand Maven and click on Installations.

    +
  4. +
  5. +

    Uncheck Embedded (3.0.4/1.4.0.20130531-2315)

    +
  6. +
  7. +

    Click Add and navigate to your Maven install directory. Select it +and click OK.

    +
  8. +
  9. +

    Make sure the new external Maven installation is checked and click +OK to return to JBoss Developer Studio.

    +
  10. +
+
+
+

Note: If you use another IDE, refer to the product documentation to +update the Maven installation.

+
+
+
+

Configure Maven to Build Windup

+
+

Windup uses artifacts located in the +JBoss Nexus +repository. You must configure Maven to use this repository before you +build Windup.

+
+
+
    +
  1. +

    Open your ${user.home}/.m2/settings.xml file for editing.

    +
  2. +
  3. +

    Copy the following jboss-nexus-repository profile XML prior to the +ending </profiles> element.

    +
    +
    +
    <profile>
    +  <id>jboss-nexus-repository</id>
    +  <repositories>
    +    <repository>
    +      <id>jboss-nexus-repository</id>
    +      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    +      <releases>
    +        <enabled>true</enabled>
    +      </releases>
    +      <snapshots>
    +        <enabled>true</enabled>
    +      </snapshots>
    +    </repository>
    +  </repositories>
    +  <pluginRepositories>
    +    <pluginRepository>
    +      <id>jboss-nexus-plugin-repository</id>
    +      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    +      <releases>
    +        <enabled>true</enabled>
    +      </releases>
    +      <snapshots>
    +        <enabled>true</enabled>
    +      </snapshots>
    +    </pluginRepository>
    +  </pluginRepositories>
    +</profile>
    +
    +
    +
  4. +
  5. +

    Copy the following XML prior to the ending </activeprofiles> +element to make the profile active.

    +
    +
    +
    <activeProfile>jboss-nexus-repository</activeProfile>
    +
    +
    +
  6. +
+
+
+

You are now configured to build Windup.

+
+
+
+
+

Java-based Rule Structure

+
+

TO_DO: Add a how-to for compound rules, nested rules, rules over multiple sources, negative queries (not matched by anything).

+
+
+

Windup Rule Provider

+
+

Windup rules are based on OCPsoft Rewrite, an open source routing and URL rewriting solution for Servlets, Java Web Frameworks, and Java EE. The rewrite framework allows you to create rule providers and rules in an easy to read format.

+
+
+

Windup rule add-ons must extend the WindupRuleProvider class.

+
+
+
    +
  • +

    If the rule should run in a phase other than the default MIGRATION_PHASE, you must implement the getPhase() method and specify in which Windup lifecycle phase the rule should be executed. For more information about rule phases, see Rule Execution Lifecycle.

    +
  • +
  • +

    Rules are added using the getConfiguration(GraphContext context) method. This method is inherited from the OCPsoft Rewrite interface org.ocpsoft.rewrite.config.ConfigurationProvider. Rules are discussed in more detail later.

    +
  • +
  • +

    If other rules must execute after or before the rules in this provider, you must provide the list of WindupRuleProvider classes using the getExecuteAfter() or getExecuteAfter() methods.

    +
  • +
+
+
+

The following is an example of a simple Java-based rule add-on.

+
+
+
+
public class ExampleRuleProvider extends WindupRuleProvider
+{
+    @Override public RulePhase getPhase(){
+        return RulePhase.DISCOVERY;
+    }
+
+    // @formatter:off
+    @Override
+    public Configuration getConfiguration(GraphContext context)
+    {
+        return ConfigurationBuilder.begin()
+        .addRule()
+        .when(
+            // Some implementation of GraphCondition.
+            Query.find(...)....
+        )
+       .perform(
+            ...
+       );
+    }
+    // @formatter:on
+    // (@formatter:off/on prevents Eclipse from formatting the rules.)
+}
+
+
+
+
+

Add Rule Code Structure

+
+

Like most rule-based frameworks, Windup rules consist of the following:

+
+
+
    +
  • +

    Condition: This is the when(condition) that determines if the rule should execute.

    +
  • +
  • +

    Operation: This defines what to perform() if the condition is met.

    +
  • +
+
+
+

Rules consist of the when part, the perform, the otherwise part, +and some others, all of which are optional.

+
+
+
when()
+
+
+
.when(Query.fromType(XmlMetaFacetModel.class))
+
+
+
+

In the .when() part, the rule typically queries the graph, using the +Query API. Results of the query are put on variables stack +(Variables), many times indirectly through the querying API.

+
+
+

Other way to fill a when part is subclassing the GraphCondition. +Actually, Query also implements it, and is only a convenient way to +create a condition. +You can also use multiple conditions within one when() call using and(). +Example:

+
+
+
+
.when(Query.fromType(XmlMetaFacetModel.class).and(Query...))
+
+
+
+

Last noticable but important feature is the ability to use +Gremlin queries. See +Gremlin docs for reference manual.

+
+
+
+
perform()
+
+
+
.perform(
+   new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml")
+   {
+      public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel model)
+      {
+         // for each model, do something
+      }
+   }
+)
+
+
+
+

In the .perform() part, the rule typically iterates over the items of interest +(Java files, XML files, querying services, …​), processes them, and +writes the findings into the graph.

+
+
+

For that, various operations are available. These are subclasses of +GraphOperation. You can also implement your own. See +Rules Operations for more information. Again, there are +several convenient implementations for constructs like iteration +(Iteration).

+
+
+
Iteration
+
+
+
.perform(
+    Iteration.over(XmlMetaFacetModel.class, "xmlModels").as("xml")
+    .when(...)
+    .perform(
+        new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml"){
+            public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel xmlFacetModel)
+            {
+            }
+        })
+    .otherwise(
+        new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml"){
+            public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel payload)
+                { ... }
+        })
+    .endIteration()
+
+
+
+
+
Nested iterations
+
+

An iteration is also an operation, so everywhere an operation is expected, you can freely put the Iteration. If the Iteration is put inside the perform method of another Iteration, we speak about nested iterations. +An example of such nested iteration may be:

+
+
+
+
.addRule()
+     .when(...)
+     .perform(
+     Iteration.over("list_variable").as("single_var")
+       .perform(
+         Iteration.over("single_var") //second iteration
+           .perform(...).endIteration()
+     )
+     .endIteration()
+);
+
+
+
+
+
otherwise
+
+

Windup rules inherit the rule constructs from OCP Rewrite. For example, +.otherwise() Gives you a chance to perform something in case the +conditions in .when() return false (e.g. they do not match anything). +For more information, see OCP Rewrite web.

+
+
+
+
.otherwise(
+   new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml")
+   {
+      public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel model)
+      {
+         // for each model, do something altenate
+      }
+   }
+)
+
+
+
+
+
+
Where
+
+

The where clause is used to provide information about used parameters within the rule. So for example if you have used a parameter in some condition like for example JavaClass.references("{myMatch}"), you may use the where clause to specify what the myMatch is like .where("myMatch").matches("java.lang.String.toString\(.*\)").

+
+
+
+
.when(JavaClass.references("{myMatch}").at(TypeReferenceLocation.METHOD))
+.perform(...)
+.where("myMatch").matches("java.lang.String.toString\(.*\)")
+
+
+
+

+ +Please note that within the where clause the regex is used in contrast to JavaClass.references() where a windup specific syntax is expected.

+
+
+
+
Metadata
+
+

Rules can specify metadata. Currently, the only appearing in some rules, +and not actually used, is RuleMetadata.CATEGORY.

+
+
+
+
.withMetadata(RuleMetadata.CATEGORY, "Basic")
+
+
+
+

.withMetadata() is basically putting key/value to a +Map<Object, Object>.

+
+
+
+
+

Available utilities

+
+

For a list of what key services and constructs can be used in the rule, +see Available Rules Utilities.

+
+
+
Variable stack
+
+

The communication between the conditions and operations is done using the variable stack that is filled with the output of the condition/s and then given to the Iteration to be processed. +Within conditions, you can specify the name of the result iterable that is saved in the stack using as() method, the iteration can specify the iterable to iterate over using the over() method and even specify the name of for each processed single model of the result being processed. +Example:

+
+
+
+
.addRule()
+     .when(Query...as("result_list"))
+     .perform(
+     Iteration.over("result_list").as("single_var")
+          ...
+     )
+);
+
+
+
+

The varstack may be accesed even from the second condition in order to narrow the result of the previous one. After that the iteration may choose which result it wants to iterate over (it is even possible to have multiple iterations listed in the perform, each of which may access different result saved in the variable stack).

+
+
+
+
.addRule()
+     .when(Query...as("result_list").and(Query.from("result_list")....as("second_result_list")))
+     .perform(
+     Iteration.over("second_result_list")
+          ...
+     )
+);
+
+
+
+
+
+
+

Basic Rule Execution Flow Patterns

+
+

Single Operation - operation();

+
+

No condition or iteration is needed. The following is an example of a single operation.

+
+
+
+
return ConfigurationBuilder.begin()
+    .addRule()
+    .perform(new GraphOperation(){
+        @Override
+        public void perform(GraphRewrite event, EvaluationContext context){
+            ...
+        }
+    });
+
+
+ +
+

The copyConfigToGraph GraphOperation used in the perform() above is defined before the rule.

+
+
+
+

Single Conditional Operation - if( …​ ){ operation()}

+
+

A single condition must be met. The following is an example of a single conditional operation.

+
+
+
+
return ConfigurationBuilder.begin()
+    .addRule()
+    .when( ... )
+    .perform(new GraphOperation(){
+        @Override
+        public void perform(GraphRewrite event, EvaluationContext context){
+            ...
+        }
+    });
+
+
+ +
+
+

Single Iteration - for( FooModel.class ){ …​ }

+
+

For simple iterations, you can extend the IteratingRuleProvider class to simplify the perform code.

+
+
+
+
public class ComputeArchivesSHA512 extends IteratingRuleProvider<ArchiveModel>
+{
+    public ConditionBuilder when() {
+        return Query.find(ArchiveModel.class);
+    }
+
+    // @formatter:off
+    public void perform( GraphRewrite event, EvaluationContext context, ArchiveModel archive ){
+        try( InputStream is = archive.asInputStream() ){
+            String hash = DigestUtils.sha512Hex(is);
+            archive.asVertex().setProperty(KEY_SHA512, hash);
+        }
+        catch( IOException e ){
+            throw new WindupException("Failed to read archive: " + archive.getFilePath() +
+                "\n    Due to: " + e.getMessage(), e);
+        }
+    }
+    // @formatter:on
+
+    @Override public String toStringPerform() { return this.getClass().getSimpleName(); }
+}
+
+
+ +
+
+

Conditional Iteration - if( …​ ){ for( …​ ) }

+
+
+
return ConfigurationBuilder.begin()
+    .addRule()
+    .when(
+        new GraphCondition(){ ... }
+    ).perform(
+        Iteration.over(ArchiveModel.class)
+            .perform( ... )
+    )
+
+
+ +
+
+

Iteration With a Condition - for( …​ ){ if( …​ ){ …​ } }

+
+
+
return ConfigurationBuilder.begin()
+.addRule()
+    .when(
+        // Stores all ArchiveModel's into variables stack, under that type.
+        Query.find(ArchiveModel.class)
+    ).perform(
+        Iteration.over(ArchiveModel.class) // Picks up ArchiveModel's from the varstack.
+            .when(new AbstractIterationFilter<ArchiveModel>(){
+                @Override
+                public boolean evaluate(GraphRewrite event, EvaluationContext context, ArchiveModel payload)
+                {
+                    return payload.getProjectModel() == null;
+                }
+                @Override
+                public String toString()
+                {
+                    return "ProjectModel == null";
+                }
+            })
+            .perform( ... )
+
+
+ +
+
+

Nested Iterations - for( …​ ){ for( …​ ) { …​ } }

+
+
+
.addRule()
+     .when(...)
+     .perform(Iteration //first iteration
+     .over("list_variable").as("single_var")
+     .perform(
+         Iteration.over("single_var") //second iteration
+         .perform(...).endIteration()
+     )
+     .endIteration()
+);
+
+
+ +
+
+
+

Create a Basic Java-based Rule Add-on

+
+

You can create a rule using Java or XML. This topic describes how to create a rule add-on using Java.

+
+
+

Prerequisites

+
+ +
+
+ + + + + +
+
Note
+
+Working examples of Java-based rules can be found in the Windup quickstarts GitHub repository located here: https://github.com/windup/windup-quickstarts +
+
+
+
+

Create a Rule Add-on

+
+
Create a Maven Project
+
+

Create a new Maven Java Project. These instructions will refer to the project folder location with the replaceable variable 'RULE_PROJECT_HOME'. Modify the project pom.xml file as follows

+
+
+
    +
  1. +

    Add the following properties:

    +
    +
    +
    <properties>
    +    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    +    <maven.compiler.source>1.7</maven.compiler.source>
    +    <maven.compiler.target>1.7</maven.compiler.target>
    +    <version.windup>2.0.0.VERSION</version.windup>
    +    <version.forge>2.12.1.Final</version.forge>
    +</properties>
    +
    +
    +
  2. +
  3. +

    Add a dependency management section for the Windup BOM.

    +
    +
    +
    <dependencyManagement>
    +    <dependencies>
    +        <!-- Windup BOM -->
    +        <dependency>
    +            <groupId>org.jboss.windup</groupId>
    +            <artifactId>windup-bom</artifactId>
    +            <version>${version.windup}</version>
    +            <type>pom</type>
    +               <scope>import</scope>
    +         </dependency>
    +    </dependencies>
    +</dependencyManagement>
    +
    +
    +
  4. +
  5. +

    Add a <dependencies> section to include Windup, rulesets, and test dependencies required by your rule add-on. Windup is a Forge/Furnace based application and has a modular design, so the dependencies will vary depending on the Windup APIs used by the rule. For more information on Windup dependencies, see Windup Dependencies.

    +
    +

    The following are examples of some dependencies you may need for your rule add-on.

    +
    +
    +
    +
    <!-- Windup API dependencies -->
    +<dependency>
    +    <groupId>org.jboss.windup.graph</groupId>
    +    <artifactId>windup-graph</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.config</groupId>
    +    <artifactId>windup-config</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.ext</groupId>
    +    <artifactId>windup-config-groovy</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.utils</groupId>
    +    <artifactId>utils</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.reporting</groupId>
    +    <artifactId>windup-reporting</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +
    +<!-- Dependencies on other rulesets -->
    +<dependency>
    +    <groupId>org.jboss.windup.rules.apps</groupId>
    +    <artifactId>rules-java</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.container</groupId>
    +    <artifactId>cdi-api</artifactId>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.container</groupId>
    +    <artifactId>cdi</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +
    +<!-- Test dependencies -->
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.test</groupId>
    +    <artifactId>furnace-test-harness</artifactId>
    +    <scope>test</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.test</groupId>
    +    <artifactId>arquillian-furnace-classpath</artifactId>
    +    <scope>test</scope>
    +</dependency>
    +<dependency>
    +    <groupId>junit</groupId>
    +    <artifactId>junit</artifactId>
    +    <version>4.11</version>
    +    <type>jar</type>
    +</dependency>
    +
    +<dependency>
    +    <groupId>org.jboss.windup.exec</groupId>
    +    <artifactId>windup-exec</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>test</scope>
    +</dependency>
    +
    +
    +
  6. +
  7. +

    Add the <plugins> section to make it a Forge add-on.

    +
    +
    +
    <plugins>
    +    <!-- The following plugins make this artifact a Forge add-on. -->
    +    <plugin>
    +        <groupId>org.jboss.forge.furnace</groupId>
    +        <artifactId>furnace-maven-plugin</artifactId>
    +        <version>${version.forge}</version>
    +        <executions>
    +            <execution>
    +                <id>generate-dot</id>
    +                <phase>prepare-package</phase>
    +                <goals> <goal>generate-dot</goal> </goals>
    +                <configuration> <attach>true</attach> </configuration>
    +            </execution>
    +        </executions>
    +    </plugin>
    +    <plugin>
    +        <artifactId>maven-jar-plugin</artifactId>
    +        <executions>
    +            <execution>
    +                <id>create-forge-addon</id>
    +                <phase>package</phase>
    +                <goals> <goal>jar</goal> </goals>
    +                <configuration>
    +                    <classifier>forge-addon</classifier>
    +                </configuration>
    +            </execution>
    +        </executions>
    +    </plugin>
    +</plugins>
    +
    +
    +
  8. +
+
+
+
+
Create the Java RuleProvider
+
+
    +
  1. +

    Add beans.xml file to META-INF/ dir in resources - typically, $project-dir/src/main/resources/META-INF/beans.xml. This file can be empty. It tells CDI to scan your add-on for CDI beans.

    +
  2. +
  3. +

    Within your Maven project, create a Java class that extends the WindupRuleProvider class. It is suggested that you end the name of the class with RuleProvider. For example:

    +
    +
    +
    public class MyCustomRuleProvider extends WindupRuleProvider
    +{
    +}
    +
    +
    +
  4. +
  5. +

    If the rule provider must run in a phase other than the default MIGRATION_RULES phase, override the phase using the getPhase() method. For example, you may want the rule provider to perform a task during the initial DISCOVERY phase, for example, to ignore files with a specific name or extension.

    +
    +
    +
        @Override
    +    public RulePhase getPhase() {
    +        return RulePhase.DISCOVERY;
    +    }
    +
    +
    +
    +

    For more information about rule phases, see Rules Execution Lifecycles.

    +
    +
  6. +
  7. +

    To control the order in which the rule is executed, implement the getExecuteBefore() or getExecuteAfter() method.

    +
    +
    +
    List<Class<? extends WindupRuleProvider>> executeBeforeList = new ArrayList<>();
    +
    +@Override
    +public List<Class<? extends WindupRuleProvider>> getExecuteBefore()
    +{
    +   return executeBeforeList.add(RuleToFireBefore.class);
    +}
    +
    +
    +
    +
    +
    List<Class<? extends WindupRuleProvider>> executeAfterList = new ArrayList<>();
    +
    +@Override
    +public List<Class<? extends WindupRuleProvider>> getExecuteAfter()
    +{
    +    return executeAfterList.add(RuleToFireAfter.class);
    +}
    +
    +
    +
  8. +
  9. +

    Finally, add the rule or rules to the rule provider.

    +
    +
      +
    • +

      High-level Conditions and Operations

      +
      +

      The following is a specific high-level rule which uses high-level conditions (JavaClass) and operations (Classification). See the documentation of those conditions and operations for the details.

      +
      +
      +
      +
      @Override
      +public Configuration getConfiguration(GraphContext context)
      +{
      +    return ConfigurationBuilder.begin()
      +        .addRule()
      +        .when(
      +            JavaClass.references("weblogic.servlet.annotation.WLServlet").at(TypeReferenceLocation.ANNOTATION)
      +        )
      +        .perform(
      +            Classification.as("WebLogic @WLServlet")
      +               .with(Link.to("Java EE 6 @WebServlet", "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/index.html"))
      +               .withEffort(0)
      +               .and(Hint.withText("Migrate to Java EE 6 @WebServlet.").withEffort(8))
      +        );
      +}
      +
      +
      +
      +

      For more examples of rule providers, see the +BaseConfig.java +rule.

      +
      +
    • +
    • +

      Low-level Conditions and Operations

      +
      +

      As you can see, the conditions and operations above are Java-specific. +They come with the Java Basic ruleset. The list of existing rulesets +will be part of the project documentation. Each ruleset will be +accompanied with a documentation for its `Condition`s and `Operation`s +(and also `Model`s).

      +
      +
      +

      These high-level elements provided by rulesets may cover majority of +cases, but not all. Then, you will need to dive into the mid-level +Windup building elements.

      +
      +
    • +
    • +

      Mid-level Conditions and Operations

      +
    • +
    +
    +
  10. +
+
+
+
+
+

Install the Java-based Rule Add-on

+
+

The easiest and fastest way to build the rule add-on, install it into the local Maven repository, and install it into Windup as a rule add-on is to use the Windup addon-build-and-install command.

+
+
+
    +
  • +

    If you have not started Windup, follow the instructions to Execute Windup.

    +
  • +
  • +

    At the Windup console prompt, enter the addon-build-and-install command:

    +
    +
    +
    addon-build-and-install --projectRoot RULE_PROJECT_HOME
    +
    +
    +
  • +
  • +

    You should see the following result.

    +
    +
    +
    ***SUCCESS*** Addon MyCustomRuleProvider:::2.0.0.VERSION was installed successfully.
    +
    +
    +
  • +
+
+
+
+

Test the Java-based Rule Add-on

+
+

Test the Java-based rule add-on against your application file by running the windup-migrate-app command in the Windup console prompt.

+
+
+

The command uses this syntax:

+
+
+
+
windup-migrate-app [--sourceMode true] --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
+
+
+
+

You should see the following result:

+
+
+
+
***SUCCESS*** Windup report created: QUICKSTART_HOME/windup-reports-java/index.html
+
+
+
+

For more information and examples of how to run Windup, see: Execute Windup

+
+
+
+

Review the Output Report

+
+
    +
  1. +

    Open OUTPUT_REPORT_DIRECTORY /index.html file in a browser.

    +
  2. +
  3. +

    You are presented with an Overview page containing the application profiles.

    +
  4. +
  5. +

    Click on the application link to review the detail page. Check to be sure the warning messages, links, and story points match what you expect to see.

    +
  6. +
+
+
+

TBD.

+
+
+ +
+
+
+
+
+
+

Create and Test XML Rules

+
+
+

Create a Basic XML Rule

+
+

You can create a Windup rule using Java, XML, or Groovy. This topic describes how to create a rule using XML.

+
+
+

Prerequisites

+
+ +
+
+
+

File Naming Convention for XML Rules

+
+

You must name the file containing an XML rule with the .windup.xml extension. Windup identifies files with this extension as XML-base rules, so be sure to use this naming convention, otherwise the rule will not be evaluated!

+
+
+
+

Basic XML Rule Template

+
+

XML rules consist of conditions and actions and follow the familiar "if/then/else" construct:

+
+
+
+
when(condition)
+    perform(action)
+otherwise
+    perform(action)
+
+
+
+

The following is the basic syntax for XML rules.

+
+
+
+
<?xml version="1.0"?>
+<ruleset xmlns="http://windup.jboss.org/v1/xml" id="XmlFileMappings">
+    <phase>
+        <!-- The phase in which to run the rules -->
+    </phase>
+    <rules>
+        <rule>
+            <when>
+                <!-- Test a condition... -->
+            </when>
+            <perform>
+                <!-- Perform this action when condition is satisfied -->
+            </perform>
+            <otherwise>
+                <!-- Perform this action when condition is not satisfied -->
+            </otherwise>
+        </rule>
+      <rules>
+    </ruleset>
+
+
+
+
+

Create the Rule When Condition

+
+

The syntax is dependent on whether you are creating a rule to evaluate Java class, an XML file, a project, or file content and is described in more detail here: XML Rule - When Condition Syntax

+
+
+
+

Create the Rule Perform Action

+
+

Operations allowed in the perform section of the rule include the classification of application resources, in-line hints for migration steps, links to migration information, and project lineitem reporting. The syntax is described in detail here: XML Rule - Perform Action Syntax.

+
+
+
+
+

XML Rule - When Condition Syntax

+
+

Conditions allowed in the when portion of a rule must extend GraphOperaton and currently include evaluation of Java classes, XML files, projects, and file content. Because XML rules are modeled after the Java-based rule add-ons, links to JavaDocs for the related Java classes are provided for a better understanding of how they behave.

+
+
+

The complete XML rule schema is located here: https://github.com/windup/windup/blob/master/config-xml/rule-schema.xsd.

+
+
+

The following sections describe the more common XML when rule conditions.

+
+ +
+

javaclass Syntax

+
+
Summary
+
+

Use the javaclass element to find imports, methods, variable declarations, annotations, class implementations, and other items related to Java classes. For a better understanding of the javaclass condition, see the JavaDoc for the JavaClass class.

+
+
+

The following is an example of a rule that tests for a javaclass.

+
+
+
+
<rule>
+    <when>
+        <javaclass references="org.jboss.ws.api.annotation.WebContext" in="org/jboss/{*}" as="webcontextclasses">
+            <location>IMPORT</location>
+            <location>TYPE</location>
+        </javaclass>
+    </when>
+    <perform>
+        <hint message="WebContext is deprecated." effort="0"/>
+    </perform>
+</rule>
+
+
+
+
+
Construct a javaclass Element
+
+
javaclass Element Attributes
+
+
+
references="CLASS_NAME"
+
+

The package or class name to match on. Wildcard characters can be used.

+
+
+
Example: references="org.apache.commons.{*}"
+
+
+
+
as="VARIABLE_NAME"
+
+

A variable name assigned to the rule so that it can be used as a reference in later processing. See the from attribute below.

+
+
+
Example: as="MyEjbRule"
+
+
+
+
in="PATH_FILTER"
+
+

Used to filter input files matching this regex (regular expression) naming pattern. Wildcard characters can be used.

+
+
+
Example: in="{*}File1"
+
+
+
+
from="VARIABLE_NAME"
+
+

Begin the search query with the filtered result from a previous search identified by its as VARIABLE_NAME.

+
+
+
Example: from="MyEjbRule"
+
+
+
+
+
+
+
+
JavaClass Element Child Elements
+
+
+
location
+
+

The location where the reference was found in a Java class. Location can refer to annotations, field and variable declarations, imports, and methods. For the complete list of valid values, see the JavaDoc for TypeReferenceLocation.

+
+
+
Example: <location>IMPORT</location>
+
+
+
+
+
+
+
+
+
+

xmlfile Syntax

+
+
Summary
+
+

Use the xmlfile element to find information in XML files. For a better understanding of the xmlfile condition, see the XmlFile JavaDoc.

+
+
+

The following is an example of a rule that tests for an xmlfile.

+
+
+
+
<rule>
+    <when>
+        <xmlfile matches="/w:web-app/w:resource-ref/w:res-auth[text() = 'Container']">
+            <namespace prefix="w" uri="http://java.sun.com/xml/ns/javaee"/>
+        </xmlfile>
+    </when>
+    <perform>
+        <hint title="Title for Hint from XML">
+            <message>Container Auth</message>
+        </hint>
+        <xslt description="Example XSLT Conversion" extension="-converted-example.xml"
+              template="/exampleconversion.xsl"/>
+    </perform>
+</rule>
+
+
+
+
+
Construct an xmlfile Element
+
+
xmlfile Element: Attributes
+
+
+
matches="XPATH"
+
+

Match on an XML file condition.

+
+
+
Example: matches="/w:web-app/w:resource-ref/w:res-auth[text() = 'Container']"
+
+
+
+
xpathResultMatch="XPATH_RESULT_STRING"
+
+

Return results that match the given regex.

+
+
+
Example: xpathResultMatch=""
+
+
+
+
as="VARIABLE_NAME"
+
+

A variable name assigned to the rule so that it can be used as a reference in later processing. See the from attribute below.

+
+
+
Example: as="MyEjbRule"
+
+
+
+
in="PATH_FILTER"
+
+

Used to filter input files matching this regex (regular expression) naming pattern. Wildcard characters can be used.

+
+
+
Example: in="{*}File1"
+
+
+
+
from="VARIABLE_NAME"
+
+

Begin the search query with the filtered result from a previous search identified by its as VARIABLE_NAME.

+
+
+
Example: from="MyEjbRule"
+
+
+
+
public-id="PUBLIC_ID"
+
+

The DTD public-id regex.

+
+
+
Example: public-id="public"
+
+
+
+
+
+
+
+
xmlfile Element: Child Elements
+
+
+
namespace
+
+

The namespace to referenced in XML files. This element contains 2 attributes: The prefix and the uri.

+
+
+
Example: <namespace prefix="abc" uri="http://maven.apache.org/POM/4.0.0"/>
+
+
+
+
+
+
+
+
+
+

project Syntax

+
+
Summary
+
+

Use the project element to query for the project charateristics. For a better understanding of the project condition, see the JavaDoc for the Project class.

+
+
+

The following is an example of a rule that checks a rule is dependent on the junit in the version between 2.0.0.Final and 2.2.0.Final.

+
+
+
+
<rule>
+    <when>
+        <project>
+            <artifact groupId="junit" artifactId="junit" from="2.0.0.Final" to="2.2.0.Final"/>
+        </project>
+    </when>
+    <perform>
+        <lineitem message="The project uses junit with the version between 2.0.0.Final and 2.2.0.Final"/>
+    </perform>
+</rule>
+
+
+
+
+
Construct a project Element
+
+
project Element Attributes
+
+

The project element is used to match against the project as a whole. You can use this condition to query for dependencies of the project. It does not have any attributes itself.

+
+
+
+
project Element Child Elements
+
+
+
artifact
+
+

Subcondition used within project to query against project dependencies. This element contains the following attributes:

+
+
    +
  • +

    groupId="PROJECT_GROUP_ID"

    +
    +

    Match on the project <groupId> of the dependency

    +
    +
  • +
  • +

    artifactId="PROJECT_ARTIFACT_ID" +Match on the project <artifactId> of the dependency

    +
  • +
  • +

    fromVersion="FROM_VERSION"

    +
    +

    Specify the lower version bound of the artifact. For example 2.0.0.Final

    +
    +
  • +
  • +

    toVersion="TO_VERSION"

    +
    +

    Specify the upper version bound of the artifact. For example 2.2.0.Final

    +
    +
  • +
+
+
+
+
+
+
+
+
+

filecontent Syntax

+
+

Use the filecontent element to find strings or text within files, for example, a line in a Properties file. For a better understanding of the filecontent condition, see the JavaDoc for the FileContent class.

+
+
+
+
+

XML Rule - Perform Action Syntax

+
+

Operations allowed in the perform section of the rule include the classification of application resources, in-line hints for migration steps, links to migration information, and project lineitem reporting. Because XML rules are modeled after the Java-based rule add-ons, links to JavaDocs for the related Java classes are provided for a better understanding of how they behave.

+
+
+

The complete XML rule schema is located here: https://github.com/windup/windup/blob/master/config-xml/rule-schema.xsd.

+
+
+

The following sections describe the more common XML rule perform actions.

+
+ +
+

classification Syntax

+
+
Summary
+
+

The classification element is used to identify or classify application resources. It provides a level of effort and can also provide links to additional information about how to migrate this resource classification. For a better understanding of the classification action, see the JavaDoc for the Classification class.

+
+
+

The following is an example of a rule that classifies a resource as a WebLogic EAR application deployment descriptor file.

+
+
+

Example:

+
+
+
+
<rule id="XmlWebLogicRules_10vvyf">
+    <when>
+        <xmlfile as="default" matches="/*[local-name()='weblogic-application']">
+        </xmlfile>
+    </when>
+    <perform>
+        <iteration>
+            <classification classification="Weblogic EAR Application Descriptor" effort="3"/>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+
Construct a classification Element
+
+
classification Element Attributes
+
+
+
classification="STRING"
+
+

Classify the resource as the specified string.

+
+

Example:

+
+
+
+
classification="JBoss Seam Components"
+
+
+
+
effort="NUMBER"
+
+

The level of effort assigned to this resource.

+
+

Example:

+
+
+
+
effort="2"
+
+
+
+
+
+
+
+
classification Element Child Elements
+
+
+
xref
+
+

Provides a link URI and text description for additional information.

+
+

Example:

+
+
+
+
<classification classification="Websphere Startup Service" effort="4">
+    <link href="http://docs.oracle.com/javaee/6/api/javax/ejb/Singleton.html" description="EJB3.1 Singleton Bean"/>
+    <link href="http://docs.oracle.com/javaee/6/api/javax/ejb/Startup.html" description="EJB3.1 Startup Bean"/>
+ </classification>
+
+
+
+
+
+
+
+
+
+ +
+
Summary
+
+

The link element is used in classifications or hints to identify or classify links to informational content. For a better understanding of the link action, see the JavaDoc for the Link class.

+
+
+

The following is an example of a rule that creates links to additional information.

+
+
+

Example:

+
+
+
+
<rule id="SeamToCDIRules_2fmb">
+    <when>
+        <javaclass references="org.jboss.seam.{*}" as="default"/>
+    </when>
+    <perform>
+        <iteration>
+            <classification classification="SEAM Component" effort="1">
+                <link href="http://www.seamframework.org/Seam3/Seam2ToSeam3MigrationNotes" description="Seam 2 to Seam 3 Migration Notes"/>
+                <link href="http://docs.jboss.org/weld/reference/latest/en-US/html/example.html" description="JSF Web Application Example"/>
+                <link href="http://docs.jboss.org/weld/reference/latest/en-US/html/contexts.html" description="JBoss Context Documentation"/>
+                <link href="http://www.andygibson.net/blog/tutorial/cdi-conversations-part-2/" description="CDI Conversations Blog Post"/>
+            </classification>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+ +
+ +
+
+
href="URI"
+
+

The URI for the referenced link/.

+
+

Example:

+
+
+
+
href="https://access.redhat.com/articles/1249423"
+
+
+
+
description="URI_DESCRIPTION"
+
+

A description for the link.

+
+

Example:

+
+
+
+
description="Migrate WebLogic Proprietary Servlet Annotations"
+
+
+
+
+
+
+
+
+
+

hint Syntax

+
+
Summary
+
+

The hint element is used to provide a hint or inline information about how to migrate a section of code. For a better understanding of the hint action, see the JavaDoc for the Hint class.

+
+
+

The following is an example of a rule that creates a hint.

+
+
+

Example:

+
+
+
+
<rule id="WebLogicWebServiceRules_8jyqn">
+    <when>
+        <javaclass references="weblogic.wsee.connection.transport.http.HttpTransportInfo.setUsername({*})" as="default">
+            <location>METHOD</location>
+        </javaclass>
+    </when>
+    <perform>
+        <iteration>
+            <hint message="Replace proprietary web-service authentication with JAX-WS standards." effort="0">
+                <link href="http://java-x.blogspot.com/2009/03/invoking-web-services-through-proxy.html" description="JAX-WS Proxy Password Example"/>
+            </hint>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+
Construct a hint Element
+
+
hint Element: Attributes
+
+
+
message="MESSAGE"
+
+

A message describing the migration hint

+
+

Example:

+
+
+
+
message=""
+
+
+
+
effort="NUMBER"
+
+

The level of effort assigned to this resource.

+
+

Example:

+
+
+
+
effort="2"
+
+
+
+
+
+
+
+
hint Element: Child Elements
+
+
+
xref
+
+

Identify or classify links to informational content. See the section on link Syntax for details.

+
+

Example:

+
+
+
+
link href="http://java-x.blogspot.com/2009/03/invoking-web-services-through-proxy.html" description="JAX-WS Proxy Password Example"/>
+
+
+
+
+
+
+
+
+
+

xslt Syntax

+
+
Summary
+
+

The xslt element specifies how to transform an XML file. For a better understanding of the xslt action, see the JavaDoc for the XSLTTransformation class.

+
+
+

The following is an example of rule that defines an XSLT action.

+
+
+

Example:

+
+
+
+
<rule id="XmlWebLogicRules_6bcvk">
+    <when>
+        <xmlfile as="default" matches="/weblogic-ejb-jar"/>
+    </when>
+    <perform>
+        <iteration>
+            <classification classification="Weblogic EJB XML" effort="3"/>
+            <xslt description="JBoss EJB Descriptor (Windup-Generated)" template="transformations/xslt/weblogic-ejb-to-jboss.xsl" extension="-jboss.xml"/>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+
Construct an xslt Element
+
+
xslt Element: Attributes
+
+
+
of="STRING"
+
+

Create a new transformation for the given reference.

+
+

Example:

+
+
+
+
of="testVariable_instance"
+
+
+
+
description="String"
+
+

Sets the description of this XSLTTransformation.

+
+

Example:

+
+
+
+
description="XSLT Transformed Output"
+
+
+
+
extension="String"
+
+

Sets the extension for this XSLTTransformation.

+
+

Example:

+
+
+
+
extension="-result.html"
+
+
+
+
template=String
+
+

Sets the XSL template.

+
+

Example:

+
+
+
+
template="simpleXSLT.xsl"
+
+
+
+
+
+
+
+
xslt Element: Child Elements
+
+
+
xslt-parameter=Map<String,String>
+
+

Specify XSLTTransformation parameters as property value pairs

+
+

Example:

+
+
+
+
<xslt-parameter property="title" value="EJB Transformation"/>
+
+
+
+
+
+
+
+
+
+

lineitem Syntax

+
+
Summary
+
+

The lineitem element is used to provide line item information about a hint on the project or application overview page. For a better understanding of the lineitem action, see the JavaDoc for the Lineitem class.

+
+
+

The following is an example of a rule that creates a lineitem message.

+
+
+

Example:

+
+
+
+
<rule>
+    <when>
+        <javaclass references="weblogic.servlet.annotation.WLServlet" as="default">
+            <location>ANNOTATION</location>
+        </javaclass>
+    </when>
+    <perform>
+        <hint message="Replace the proprietary WebLogic @WLServlet annotation with the Java EE 6 standard @WebServlet annotation." effort="1">
+            <link href="https://access.redhat.com/articles/1249423" description="Migrate WebLogic Proprietary Servlet Annotations" />
+            <lineitem message="Proprietary WebLogic @WLServlet annotation found in file."/>
+        </hint>
+    </perform>
+</rule>
+
+
+
+
+
Construct a lineitem Element
+
+
lineitem Element: Attributes
+
+
+
message="MESSAGE"
+
+

A lineitem message

+
+

Example:

+
+
+
+
message="Proprietary code found."
+
+
+
+
+
+
+
+
+
+

iteration Syntax

+
+
Summary
+
+

The iteration element specifies to iterate over an implicit or explicit variable defined within the rule. For a better understanding of the iteration action, see the JavaDoc for the Iteration class.

+
+
+

The following is an example of a rule that preforms an iteration.

+
+
+

Example:

+
+
+
+
<rule id="XmlWebLogicRules_14wscy">
+     <when>
+         <xmlfile as="1" matches="/wl:weblogic-webservices | /wl9:weblogic-webservices">
+             <namespace prefix="wl9" uri="http://www.bea.com/ns/weblogic/90"/>
+             <namespace prefix="wl" uri="http://www.bea.com/ns/weblogic/weblogic-webservices"/>
+         </xmlfile>
+         <xmlfile as="2" matches="//wl:webservice-type | //wl9:webservice-type" from="1">
+             <namespace prefix="wl9" uri="http://www.bea.com/ns/weblogic/90"/>
+             <namespace prefix="wl" uri="http://www.bea.com/ns/weblogic/weblogic-webservices"/>
+         </xmlfile>
+     </when>
+     <perform>
+         <iteration over="1">
+             <classification classification="Weblogic Webservice Descriptor" effort="0"/>
+         </iteration>
+         <iteration over="2">
+             <hint message="Webservice Type" effort="0"/>
+         </iteration>
+     </perform>
+ </rule>
+
+
+
+
+
Construct an iteration Element
+
+
iteration Element: Attributes
+
+
+
over="NUMBER"
+
+

??

+
+

Example:

+
+
+
+
over="2"
+
+
+
+
+
+
+
+
iteration Element: Child Elements
+
+

iteration child elements include a when condition, along with the actions iteration, classification, hint, xslt, lineitem, and otherwise.

+
+
+
+
+
+
+

Test an XML Rule in Windup

+
+

Add the Rule to Windup

+
+

A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations for files ending with .windup.groovy and .windup.xml:

+
+
+
    +
  • +

    The directory specified in the --userRulesDirectory option to the windup-migrate-app.

    +
  • +
  • +

    The WINDUP_HOME/rules/ directory.

    +
    +

    WINDUP_HOME is the directory where you run the Windup executable (see here).

    +
    +
  • +
  • +

    The ${user.home}/.windup/rules/ directory.

    +
    +

    The ${user.home}/.windup is a directory created by Windup at first run and contains rules, add-ons, and the Windup log.

    +
    +
    +
    +
    For Linux or Mac:   ~/.windup/rules/
    +For Windows: "\Documents and Settings\USER_NAME\.windup\rules\"  -or-  "\Users\USER_NAME\.windup\rules\"
    +
    +
    +
  • +
+
+
+
+

Test the XML Rule

+
+
    +
  1. +

    If you have not started Windup, follow the instructions to Execute Windup.

    +
  2. +
  3. +

    Test the XML rule against your application file by running the windup-migrate-app command in the Windup console prompt.

    +
    +

    The command uses this syntax:

    +
    +
    +
    +
    windup-migrate-app [--sourceMode true] --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
    +
    +
    +
    +

    You should see the following result:

    +
    +
    +
    +
    ***SUCCESS*** Windup report created: OUTPUT_REPORT_DIRECTORY/index.html
    +
    +
    +
  4. +
+
+
+
+

Additional Resources

+
+ +
+
+
+
+
+
+

Core Developer topics

+
+
+

Windup Bootstrap

+
+
DRAFT
+

This section describes how Windup starts up, finds the resources, loads the rules, and executes them.

+
+
+

Boot

+
+
    +
  1. +

    @Inject WindupProcessor

    +
    +
    +
    CDI instantiates `WindupProcessorImpl`
    +
    +
    +
  2. +
  3. +

    Create WindupProcessorConfig

    +
  4. +
  5. +

    WindupProcessorImpl.execute( WindupProcessorConfig )

    +
    +
    +
    WindupProcessorImpl instantiates `@Inject GraphContext graphContext`, which holds
    +graph-related objects.
    +
    +
    +
  6. +
  7. +

    GraphContextFactoryImpl:

    +
    +
    +
    `create()`
    +`@Produces GraphContext produceGraphContext()`
    +
    +
    +
  8. +
+
+
+
+

GraphContext

+ +
+
+

RuleSubset

+ +
+
+

Frames creation

+
+

In the GraphContextImpl constructor. For additonal method Handlers, +see

+
+
+
+
final Module addModules = new Module()
+{
+    @Override
+    public Graph configure(Graph baseGraph, FramedGraphConfiguration config)
+    {
+        config.setFrameClassLoaderResolver(fclr);
+        // Java Handlers
+        config.addMethodHandler(new FrameMapHandler());
+        config.addMethodHandler(new MapInPropertiesHandler());
+        config.addMethodHandler(new MapInAdjacentPropertiesHandler());
+        return baseGraph;
+     }
+};
+
+
+
+
+
+

Classloading Notes

+
+
DRAFT
+

Page contains temporary notes, to be edited.

+
+
+

This covers the specific situations when the Windup core developer needs to look up certain runtime classes. Does not relate to rules authoring.

+
+
+

Forge add-ons transitive dependencies

+
+

Let A depend on B depend on C. +Depending on scope of C in B’s POM:

+
+
+
+
<scope>provided</scope>
+
+
+
+

provided will NOT export C, so A depending on B won’t see C’s classes. +Only compile scope is exported. +compile will export C, so A depending on B will also see C’s classes.

+
+
+
    +
  • +

    provided == import

    +
  • +
  • +

    compile == import & export

    +
  • +
  • +

    optional == optional, not installed automatically

    +
  • +
  • +

    runtime == export only

    +
  • +
+
+
+
+

Finding classes

+
+
+
AddonRegistry.getServices(MyServiceInterface.class)
+
+// To get the AddonRegistry, use Windup's FurnaceHolder:
+FurnaceHolder.getFurnace().getAddonRegistry().getServices(MyServiceInterface.class);
+
+
+
+

or

+
+
+
+
@Inject Imported<MyServiceInterface.class) imported;
+
+
+
+
+

Instantiating

+
+

If you want something from the current add-on, you can simply @Inject the type you wish to use. Alternately you can @Inject an Imported<T> instance, or also @Inject the AddonRegistry itself.

+
+
+
+

Which ClassLoader is used? Always the one of the current code?

+
+

Depends, if you are in a Furnace Service, then yes, it will use the current code’s add-on ClassLoader.

+
+
+
+

Reading annotations from classes

+
+

Since classes can be proxied by Forge/Furnace, it’s safer to read annotations using Annotations API:

+
+
+
+
Rules annotation = Annotations.getAnnotation(this.getClass(), Rules.class);
+
+
+
+

Supposedly, Furnace proxies should also be able to handle such call:

+
+
+
+
Rules annotation1 = ((FurnaceProxy) proxy).getOriginalClass().getAnnotation(Rules.class);
+
+
+
+

TO_DO: Find out how exactly this is done.

+
+
+
+

How do I know if I am in a Furnace service?

+
+

Every furnace service is wrapped in a proxy. If it came from another +add-on (not your current add-on) and was not instantiated with new Blah(), +you are in a furnace service. So if it was @Inject`ed or retrieved via +`addonRegistry.getServices(…​)

+
+
+
+
(16:32:40) jsightler: ozizka: I do like a Resource.open(...) type API -- that sounds like a good idea.
+(16:32:57) LincolnBaxter: ozizka: unless you use the TCCL (which you shouldn't in a modular environment), then using the class's own classloader is the best solution for that situation
+(16:33:41) LincolnBaxter: ozizka: using a shared Resource.open() APi will actually be sort of a no-op, and just introduce another layer, since you generally need to be able to specify a classloader anyway
+(16:33:53) jsightler: lincolnthree: Well...
+(16:34:09) LincolnBaxter: ozizka: unless I'm misunderstanding the point of this
+(16:34:10) jsightler: lincolnthree: In windup we frequently need resources from the caller's add-on
+(16:34:18) LincolnBaxter: ozizka: ah wait
+(16:34:27) LincolnBaxter: ozizka: the *caller*'s classloader
+(16:34:35) LincolnBaxter: ozizka: not the CL of the current operation
+(16:34:44) LincolnBaxter: ozizka: that's different. hmm
+(16:35:11) ozizka-FN: Right
+(16:35:18) ozizka-FN: Actually that's what I wanted to ask -
+(16:35:21) jsightler: We deal with this in an ad-hoc way at the moment... it might be nice to have a centralized service that does it.
+(16:35:25) ozizka-FN: which classloader is used?
+(16:35:33) ozizka-FN: Always the one of the current code?
+(16:35:44) ozizka-FN: Implicitly
+(16:35:54) LincolnBaxter: ozizka: depends, if you are in a Furnace Service, then yes, it will use the current code's add-on's classloader
+(16:36:00) ozizka-FN: Ah
+(16:36:11) ozizka-FN: How do I know if I am in a Furnace service?
+(16:36:14) LincolnBaxter: ozizka: because every furnace service is wrapped in a proxy
+(16:36:31) LincolnBaxter: ozizka: basically if it came from another add-on (not your current add-on), you are in a furnace service
+(16:36:43) LincolnBaxter: ozizka: and if you didn't instantiate with new Blah()
+(16:37:00) LincolnBaxter: ozizka: so if it was @Injected or retrieved via addonRegistry.getServices(...)
+(16:37:43) LincolnBaxter: jsightler: ozizka: mbriskar: why do we need the classloader of the calling add-on? just curious
+(16:37:54) ozizka-FN: So here we would use TCCL right?
+LincolnBaxter lincolnthree
+(16:38:28) ozizka-FN: lincolnthree:  To load it's resources
+(16:38:31) ozizka-FN: from other add-on
+(16:38:32) ozizka-FN: .
+(16:38:35) ozizka-FN: Or is there other way?
+(16:38:42) LincolnBaxter: ozizka: that's a vague statement ;)
+(16:38:48) LincolnBaxter: ozizka: where is *here*?
+(16:38:56) LincolnBaxter: ozizka: the best way is to pass the actual classloader you want to use
+(16:39:01) ozizka-FN: For this use case. For the Resource.open()
+LincolnBaxter lincolnthree
+(16:39:21) ozizka-FN: lincolnthree, right, but well, putting classloading code into rules...
+(16:39:25) ozizka-FN: Not user friendly
+
+
+
+
+

Resources loading

+
+
+
(16:48:30) ozizka-FN: lincolnthree:  Just a note - the potential collisions caused  by add-on's CL span is not considered as a risk?
+(16:49:25) ozizka-FN: I mean, it could load the file from it's deps.
+(16:49:36) ozizka-FN: * file = resource
+(16:49:50) LincolnBaxter: ozizka1: so the way it works is actually very controlled
+(16:50:06) LincolnBaxter: ozizka1: classloader will always attempt to load its own resources before loading from another add-on
+(16:50:23) LincolnBaxter: ozizka1: at which point the order is determined by the order of the add-on dependency in the POM
+
+(16:53:26) ozizka-FN: Q: Unwrapping proxies caused the code in invoke() not actually being called?
+(16:53:32) ozizka-FN: Since the method calls were not intercepted?
+(16:54:09) LincolnBaxter: ozizka1: exactly :)
+
+(16:54:10) ozizka-FN: lincolnthree, Is that impl a real TCCL or just TCCL-like concept?
+(16:54:29) LincolnBaxter: ozizka1: what do you mean "real" ?
+(16:54:51) ozizka-FN: Not sure about how TCCL is implemented, I thought you'd need to call something like
+(16:54:52) ozizka-FN: Thread.currentThread().setContextClassLoader(classLoader);
+(16:54:56) LincolnBaxter: ozizka1: also if you are interested in where the resource loading / ordering is controlled —> https://github.com/forge/furnace/blob/master/container/src/main/java/org/jboss/forge/furnace/impl/modules/AddonModuleLoader.java#L194
+(16:55:01) jsightler: lincolnthree: I wondered that too :)
+(16:55:30) LincolnBaxter: ozizka1: jsightler, actually it does: https://github.com/forge/furnace/blob/master/proxy/src/main/java/org/jboss/forge/furnace/proxy/ClassLoaderInterceptor.java#L103
+(16:55:55) LincolnBaxter: ozizka1: jsightler: https://github.com/forge/furnace/blob/master/container-api/src/main/java/org/jboss/forge/furnace/util/ClassLoaders.java#L27
+
+(16:56:57) ozizka-FN: Hm, ok so I guess if we dug deeper, it would eventually come to Thread.currentThread().setContextClassLoader(classLoader); ?
+(16:57:15) LincolnBaxter: ozizka1: yep: https://github.com/forge/furnace/blob/master/container-api/src/main/java/org/jboss/forge/furnace/util/SecurityActions.java#L71
+
+
+ +
+
+

What classloader is used by Freemarker to load resources?

+
+

org.jboss.windup.reporting.freemarker.FurnaceFreeMarkerTemplateLoader

+
+
+
+
+

Connect to the Graph via Rexster

+
+

There is a specific add-on for running Rexster along your graph with +groupId org.jboss.windup.rexster and artifactId Rexster.

+
+
+

Running Rexster Within Your Test

+
+

Deploy the Rexster add-on by adding the Rexster add-on to the dependencies.

+
+
+
+
@Deployment
+    @Dependencies({
+                ....
+                @AddonDependency(name = "org.jboss.windup.rexster:rexster", version = "2.0.0-SNAPSHOT"),
+                ....
+    })
+
+
+
+

Then put some debug breakpoint in the specific phase of graph you are interested in and browse http://localhost:8182/ to enjoy the graph! Username and password: rexster

+
+
+
+

Run Rexster within Windup

+
+

Make sure the Rexster add-on is deployed in Furnace and is accessible on http://localhost:8182/.

+
+
+
+
username: rexster
+password: rexster
+
+
+
+
+
+

Decompiling

+
+

The Decompiler API

+
+
DRAFT
+
    +
  • +

    The 3 main use cases for the decompiler API are to process:

    +
    +
      +
    1. +

      Directories

      +
    2. +
    3. +

      JARS or Archives

      +
    4. +
    5. +

      Class files

      +
    6. +
    +
    +
  • +
  • +

    The DecompilerConfig should also contain Filter<String> (or maybe Filter<TypeReference>) to decide whether to decompile the class or not.

    +
  • +
  • +

    windup.ProcyonConfiguration should extend abstract windup.DecompilerConfig<T>, which would contain the configurables common to all decompilers. In case of Procyon, outputDir would be delegated to procyon.DecompilerSettings.

    +
  • +
+
+
+
+

Procyon

+
+
Config
+
+
    +
  • +

    windup.ProcyonConfiguration contains procyon.DecompilerSettings.

    +
  • +
  • +

    procyon.DecompilerSettings contains outputDir (the others are not much important). +TO_DO: Make that a parameter to method call?

    +
  • +
+
+
+
+
TypeReference
+
+

TO_DO: Check how we get info about Java files; perhaps cache the TypeReference results - if worth it?

+
+
+
+
ITypeLoader
+
+
    +
  • +

    JarTypeLoader - iterates a JarFile, expects a .jar File as input.

    +
  • +
  • +

    ClasspathTypeLoader - loads classes from a list of classes.

    +
  • +
  • +

    ClasspathTypeLoader("some/path:other/path")

    +
  • +
  • +

    ClasspathTypeLoader() → sysprop("java.class.path") : sysprop("sun.boot.class.path")

    +
  • +
  • +

    InputTypeLoader

    +
  • +
  • +

    CompoundTypeLoader - 2 typeloaders, queried in succession

    +
  • +
+
+
+

TO_DO: Create a simple FileSystemTypeLoader.

+
+
+
+
+
+

Dependencies (Forge add-ons)

+
+
DRAFT
+

Based on +this +discussion.

+
+
+

Maven Add-on Structure

+
+

The following is the typical structure of Maven add-on modules.

+
+
+
+
my-add-on-parent
++--- my-add-on - jar, classifier: forge-addon
++--- my-add-on-api - jar
++--- my-add-on-impl - jar
++--- my-add-on-tests - jar
+
+
+
+

The add-on POM file can declare dependencies on other forge-addons. +To prevent exporting the add-on to dependent modules, use <optional>true</optional>.

+
+
+
+
<dependency>
+    <groupId>org.jboss.forge.furnace.container</groupId>
+    <artifactId>cdi</artifactId>
+    <classifier>forge-addon</classifier>
+    <optional>true</optional>
+</dependency>
+
+
+
+

The add-on POM files may also declare a dependency on typical Maven artifacts. +To prevent exporting the add-on to dependent modules, use <optional>true</optional>.

+
+
+
+
<dependency>
+    <groupId>com.thinkaurelius.titan</groupId>
+    <artifactId>titan-lucene</artifactId>
+    <version>${version.titangraph.lucene}</version>
+</dependency>
+
+
+
+

One more question regarding dependencies. Is it advisable to depend on the`forge-addon` +artifact from add-on’s subparts?

+
+
+

Add-ons should reference the <classifier>forge-addon</classifier> +artifact from other add-ons.

+
+
+
+

Add-on sub-parts

+
+

Add-on sub-parts declare dependency preferably on forge add-on APIs, not +on the add-ons themselves, wherever possible (wherever an add-on has an +explicit API). These dependencies must be marked as provided scope.

+
+
+
+
<dependency>
+    <groupId>org.jboss.forge.furnace.container</groupId>
+    <artifactId>cdi-api</artifactId>
+    <classifier>forge-addon</classifier>
+    <scope>provided</scope>
+</dependency>
+
+
+
+

They may instead depend on the primary add-on dependency, e.g. +forge-addon. The latter makes the POM files simpler, but can be confusing, +because the add-on dependency still needs to be declared in the depending +add-on’s POM.

+
+
+
+
<dependency>
+    <groupId>org.jboss.forge.furnace.container</groupId>
+    <artifactId>cdi-api</artifactId>
+</dependency>
+
+
+
+

Declaring a forge-addon depencendy anywhere else than the +forge-addon pom doesn’t actually cause Furnace to establish an add-on +dependency. I.e. classes from the dep won’t be available unless you +declare it in the `forge-addon’s pom.

+
+
+

Add-on’s sub-parts may also declare dependencies on other normal maven +dependencies, and these are treated as normal.

+
+
+ + + + + +
+
Note
+
+
+

Add-on depends on API , scope compile > Add-on +depends on Impl , scope compile with <optional>true</optional> - +prevents exporting this dependency to consumers of the add-on.

+
+
+
+
+
+

Test dependencies

+
+

For test dependencies on add-ons: Any add-on/sub-part requiring an add-on +for testing purposes should use <scope>test</scope>.

+
+
+
+
<dependency>
+    <groupId>org.jboss.windup.graph</groupId>
+    <artifactId>windup-graph</artifactId>
+    <version>${project.version}</version>
+    <classifier>forge-addon</classifier>
+    <scope>test</scope>
+</dependency>
+
+
+
+
+

Dependencies between sub-parts within the same add-on

+
+

Subpart may declare dependency on other subpart. E.g. impl typically +depends on api. In that case, the scope should be set appropriately +for the given situation - typically provided or compile scope.

+
+
+
+
<dependency>
+    <groupId>org.jboss.windup.graph</groupId>
+    <artifactId>windup-graph-api</artifactId>
+    <scope>compile</scope>
+</dependency>
+
+
+
+
+
+

Frames Extensions

+
+

Windup has several Frames extensions to satisfy its needs.

+
+
+

Multiple Types in a Vertex

+
+

Frames stores only one type in the type property. To specify multiple types, use the '|' separator. All sub-parts are indexed.

+
+
+
+

Map Handler

+
+

TBD

+
+
+

To store a map in a single vertexes properties.

+
+
+
+

Map

+
+

To store a map in as adjacent vertices.

+
+
+
+
@TypeValue("MapModelMain")
+public interface MapMainModel extends WindupVertexFrame
+{
+    @AdjacentMap(label = "map") void setMap(Map<String, MapValueModel> map);
+    @AdjacentMap(label = "map") Map<String, MapValueModel> getMap();
+}
+
+
+
+

See the FrameMapHandlerTest.

+
+
+
+

List handler.

+
+

TBD.

+
+
+

To store a list of strings in a single vertexes properties. +The keys will be 0, 1, 2, 3, …​

+
+
+
+

List

+
+

WindupVertexListModel offers a generic model for lists of other +models, which are stored as adjacent vertices.

+
+
+
+
+

Internal API Features

+
+

Find the RuleProvider that provided a Rule

+
+

A Rule implements Context, which stores metadata. The following example gets the RuleProvider from the Rule context.

+
+
+
+
WindupRuleProvider ruleProvider =
+     (WindupRuleProvider) context.get(RuleMetadata.RULE_PROVIDER);
+
+
+
+

For more information about the metadata stored in the context, see Rules Metadata

+
+
+
+

In-memory Frames

+
+
+
GraphService<FooModel> fooModelService = context.getService(FooModel.class);
+FooModel inMemoryModel = fooModelService.create();
+
+
+
+
+

Performance measurement

+
+
+
ExecutionStatistics.get().begin("Process-01");
+// ... your code to be timed goes here
+ExecutionStatistics.get().end("Process-01");
+
+
+
+

The results goes to stats/detailed_stats.csv.

+
+
+
+
+

Logging

+
+
DRAFT
+

This page describes how to log from the Java-based rules.

+
+
+

Textual logging

+
+

Windup uses java.util.logging. Convenient way to get the logger is:

+
+
+
+
private static final Logger LOG = Logging.get(MyClass.class);
+
+
+
+
+

Displaying Progress

+
+

IterationProgress

+
+
+
+
return ConfigurationBuilder.begin().addRule()
+            .when(Query.find(ArchiveModel.class))
+            .perform(UnzipArchiveToOutputFolder.unzip()
+            .and(IterationProgress.monitoring("Unzipped archive: ", 1))
+            .and(Commit.every(1))
+            );
+
+
+
+
+
+

Variables Stack

+
+
DRAFT
+

The Variables class stores the variables which are available in rules, EL expressions, and FreeMarker and XSLT templates.

+
+
+

Accessing variables

+
+
From a Java-based rule
+
+

TO_DO: Describe how to access variables from a Java-based rule.

+
+
+
+
From a Groovy-based rule
+
+

TO_DO: Describe how to access variables from a Groovy-based rule.

+
+
+
+
From an EL expression
+
+

TO_DO: Describe how to access variables from an EL expression.

+
+
+
+
From a FreeMarker
+
+

TO_DO: Describe how to access variables from a FreeMarker.

+
+
+
+
From XSLT template
+
+

TO_DO: Describe how to access variables from an XSLT template.

+
+
+
+
+

Accessing variables as a flat Map

+
+

TO_DO: Describe how to access variables from a Map.

+
+
+
+
+

Git Rebasing

+
+

This section describes a few ways you can pull in the code to rebase to the latest code base.

+
+
+

Approach Suggested on GitHub

+
+

This is the approach suggested on GitHub.

+
+
+
    +
  1. +

    Checkout the source:

    +
    +
    +
    git checkout -b lincolnthree-WINDUP-133 master
    +git pull https://github.com/lincolnthree/windup.git WINDUP-133
    +
    +
    +
  2. +
  3. +

    Run the tests to make sure it builds.

    +
    +
    +
    mvn clean install
    +
    +
    +
  4. +
  5. +

    If they pass, merge and push them to your repository.

    +
    +
    +
    git checkout master
    +git merge --no-ff lincolnthree-WINDUP-133
    +git push origin master
    +
    +
    +
  6. +
+
+
+
+

Script Provided by the Windup Development Team

+
+

Ondra Zizka wrote the following script to bring down a series of pull requests into a +single branch. It then pushes that branch to upstream master-ignore.

+
+
+
    +
  1. +

    Bring down the pulls into a single branch.

    +
    +
    +
    pull() {
    +  cmd="git fetch upstream master "
    +  for PR in "$@"
    +  do
    +    cmd="$cmd pull/$PR/head:pullRequest$PR"
    +  done
    +
    +  $cmd
    +
    +  git branch -D pulls
    +  git checkout master
    +  git rebase upstream/master
    +  git checkout -b pulls
    +
    +  for PR in "$@"
    +    do
    +    git checkout pullRequest$PR
    +    git rebase pulls
    +    git checkout pulls
    +    git merge pullRequest$PR
    +    git branch -D pullRequest$PR
    +  done
    +}
    +
    +
    +
  2. +
  3. +

    Fetch using the one pull request.

    +
    +
    +
    git fetch upstream master pull/$PR/head:pullRequest$PR
    +
    +
    +
  4. +
  5. +

    The branch is now updated with the latest source.

    +
  6. +
+
+
+
+
+
+
+

Rules topics

+
+
+

Available Rule Utilities

+
+

Programmatically Access the Graph

+
+

Note: Needs update. This is out of date!

+
+
+

(Lower Level API, to cover cases not provided by high level API)

+
+
+

This topic describes how to to programmatically access or update graph data when you create a Java-based rule add-on.

+
+
+
Query the graph
+
+

There are several ways - including Query API, Gremlin support, or +GraphService methods.

+
+
+
Query the Graph Within the .when() method
+
+

Building a rule contains the method when(), which is used to create a +condition. Vertices that fulfill the condition, are passed to the +perform() method.

+
+
+

For the queries in the when() method, class Query is used. There are +several methods which you can use to specify the condition. For example: +* find() specifies the Model type of the vertex * as() method +specifies the name of the final list, that is passed to the perform() +method * from(String name) starts the query not on the all vertices, +but only on the vertices already stored in the the given name (used to +begin query on the result of the other one) * withProperty() specify +the property value of the given vertex

+
+
+

The following are examples of simple queries.

+
+
+

Return a list of archives

+
+
+
+
Query.find(ArchiveModel.class)
+
+
+
+
+
Query.find(ApplicationReportModel.class).as(VAR_APPLICATION_REPORTS)
+
+
+
+
+
Iteration
+
+
+
ConfigurationBuilder.begin().addRule()
+    .when(
+        GraphSearchConditionBuilderGremlin.create("javaFiles", new ArrayList())
+        .V().framedType( JavaFileModel.class ).has("analyze")
+    )
+    .perform(
+        // For all java files...
+        Iteration.over("javaFiles").var("javaFile").perform(
+
+
+
+
+
Nested Iteration
+
+
+
code,java
+// For all java files...
+Iteration.over("javaFiles").var("javaFile").perform(
+    // A nested rule.
+    RuleSubset.evaluate(
+        ConfigurationBuilder.begin().addRule()
+        .when(...)
+        .perform(
+            Iteration.over("regexes").var(RegexModel.class, "regex").perform(
+                new AbstractIterationOperator<RegexModel>( RegexModel.class, "regex" ) {
+                    public void perform( GraphRewrite event, EvaluationContext context, RegexModel regex ) {
+                        //...
+                    }
+                }
+            )
+            .endIteration()
+        )// perform()
+    )
+)
+
+
+
+
+
+
+

Modify Graph Data

+
+

For more custom operations dealing with Graph data that are not covered by the Query mechanism, use the GraphService.

+
+
+
+
GraphService<FooModel> fooService = new GraphService<FooModel>(graph,FooModel.class);
+
+List<FooModel> = fooService.findAll();
+FooModel = fooService.create();
+
+// etc ...
+
+
+
+

GraphService<> can also be used to query the graph for models of the specified type:

+
+
+
+
FooModel foo = new GraphService<>(graphContext, FooModel.class).getUnique();
+
+
+
+
+
FooModel foo = new GraphService<>(graphContext, FooModel.class).getUniqueByProperty("size", 1);
+
+
+
+
+
+

Concepts & Philosophy

+
+

TO_DO: - OZIZKA: Can this topic be marked obsolete and be replaced by this one: Windup Processing Overview ?_

+
+
+

Windup is a rule-based tool that allows users to write customized rules +based on the needs, constructs, and custom APIs used in their +applications.

+
+
+

Individual rules should be decoupled, only expressing what rules should precede and follow, and "communicate" through the graph. Each rule will query +the graph database, use the results for locating the candidates of it’s +interests, process them, and then write the results to the graph +database.

+
+
+

Graph database and Models (Frames)

+
+

As a graph db implementation, we use TinkerPop +backed by Titan backed by +BerkeleyDB. For explanation of graph database concepts, see +Titan.

+
+
+

Like there’s ORM (like JPA) for JDBC, TinkerPop’s BluePrints has +Frames. This allows you to +access the graph data in form of your custom Java models (implemented as +Java Proxies to the querying).

+
+
+

We use this concept heavily. Each ruleset will likely have it’s own +models. (But you can opt to use Blueprints API if you like).

+
+
+

See also the list of Windup Models.

+
+
+
+

Examples of breaking non-trivial workflows into rules

+
+
    +
  1. +

    Finding all @Entity`s which use `org.hibernate extensions.

    +
    +

    TO_DO

    +
    +
  2. +
  3. +

    Finding MyBatis DAOs and classes using them.

    +
    +

    TO_DO

    +
    +
  4. +
+
+
+
+
+

Creating Rule Operations

+
+

An operation is a task which can be invoked from within a rule.

+
+
+

It is created by extending GraphOperation.

+
+
+
+
public class FooOperation extends GraphOperation
+{
+    @Override
+    public void perform(GraphRewrite event, EvaluationContext context)
+    {
+        ...
+    }
+}
+
+
+
+

Existing operations:

+
+
+

Existing operations

+
+
+
+

Rulesets

+
+

DRAFT

+
+
+

Example page for design decisions. Could be generated automatically in the future.

+
+
+

What is a Ruleset?

+
+

A ruleset is a Windup "plug-in" targetting a specific area of migration (e.g. Spring to Java EE 6 migration). Underhood, it is a set of rules, and everything they might need: Operations and Conditions, Report templates (if needed), and static files (e.g. images, XML or CSV files, etc.). +A ruleset may also declare metadata, like ruleset ID, dependencies on other rulesets, etc.

+
+
+

xref:Ruleset-Java-Basic-Ruleset +Forge add-on (i.e. a .jar file).

+
+
+

Groovy-based ruleset is a directory with .windup.groovy script(s) and its static files, possibly in a .zip file.

+
+
+

See ? to read about how to create your own Ruleset.

+
+
+
+

Basic tags

+
+
    +
  • +

    app - denotes the rules which help migrating applications.

    +
  • +
  • +

    server - denotes the rules which help migrating server configuration.

    +
  • +
  • +

    java - denotes the rules treating Java source code.

    +
  • +
  • +

    java-ee - denotes the rules treating Java EE applications or Java EE +containers.

    +
  • +
+
+
+

Besides that, you may use any custom tag.

+
+
+
+

Rulesets

+
+
Core rulesets
+
+

Rulesets distributed with Windup and maintained by the Windup team.

+
+
+
    +
  • +

    Java Basic Ruleset

    +
  • +
  • +

    Tags: java, app

    +
  • +
  • +

    Java EE Applications

    +
  • +
  • +

    java-ee, app

    +
  • +
  • +

    Java EE Servers

    +
  • +
  • +

    java-ee, server

    +
  • +
  • +

    Reporting

    +
    +
      +
    • +

      CreateApplicationReportIndexRuleProvider

      +
    • +
    • +

      CreateJavaApplicationOverviewReportRuleProvider

      +
    • +
    • +

      RenderSourceReportRuleProvider

      +
    • +
    +
    +
  • +
+
+
+
+
Community rulesets
+
+

Rulesets contributed by Windup users.

+
+
+
+
+
+

Java Basic Ruleset

+
+
DRAFT
+

This is an example page. Content serves for design decision.

+
+
+

Purpose of this ruleset.

+
+
+

Metadata

+
+

ID: myRuleset +Graph prefix: myRuleset

+
+
+
+

Rule providers

+
+

A definition list (dl/dt/dd) of RuleProviders of given Ruleset.

+
+
+
    +
  • +

    JDKconfigRuleProvider - Targetted towards the classes distributed with JDK, like java.lang., java.security., org.xml.*, etc.

    +
  • +
  • +

    FooRuleProvider - blah

    +
  • +
  • +

    BarRuleProvider - blah

    +
  • +
  • +

    Maven Project analysis

    +
  • +
  • +

    Seam 2.0 to CDI

    +
  • +
+
+
+
+

Models

+
+
    +
  • +

    JavaClassModel

    +
  • +
  • +

    AmbiguousJavaClassModel

    +
  • +
  • +

    AmbiguousReferenceModel<REFERENCETYPE>

    +
  • +
  • +

    ClassificationModel

    +
  • +
  • +

    EjbBeanBaseModel

    +
  • +
  • +

    EjbEntityBeanModel

    +
  • +
  • +

    EjbMessageDrivenModel

    +
  • +
  • +

    EjbSessionBeanModel

    +
  • +
  • +

    HibernateConfigurationFileModel

    +
  • +
  • +

    HibernateEntityModel

    +
  • +
  • +

    HibernateMappingFileModel

    +
  • +
  • +

    HibernateSessionFactoryModel

    +
  • +
  • +

    InlineHintModel

    +
  • +
  • +

    JarArchiveModel

    +
  • +
  • +

    JarManifestModel

    +
  • +
  • +

    JavaClassFileModel

    +
  • +
  • +

    JavaClassModel

    +
  • +
  • +

    JavaMethodModel

    +
  • +
  • +

    JavaParameterModel

    +
  • +
  • +

    JavaSourceFileModel

    +
  • +
  • +

    JavaTypeReferenceModel

    +
  • +
  • +

    LinkModel

    +
  • +
  • +

    MavenProjectModel

    +
  • +
  • +

    PackageModel

    +
  • +
  • +

    ProjectDependencyModel

    +
  • +
  • +

    ProjectModel

    +
  • +
  • +

    PropertiesModel

    +
  • +
  • +

    SourceFileModel

    +
  • +
  • +

    SpringBeanModel

    +
  • +
  • +

    SpringConfigurationFileModel

    +
  • +
  • +

    WarArchiveModel

    +
  • +
  • +

    WebXmlModel

    +
  • +
+
+
+
+

Configuration

+
+
    +
  • +

    --packages - Which packages to scan.

    +
  • +
+
+
+
+

Reports

+ +
+
+
+

Ruleset Java Classifications and Inline Hints

+
+
DRAFT
+

Some of the most important rules are classifications and inline hints.

+
+
+

Classifications

+
+

Classifications are important because they tell developers very quickly +what the resource is, so that they can quickly identify resources of +importance. For example, say you are responsible for migrating an +application from Weblogic to JBoss…​ wouldn’t it be nice to know that +project is a Spring project? Wouldn’t it be nice to have the Weblogic +descriptors identified and called out to us? This is what classifiers +do. They identify resources, and add a classification to the resource.

+
+
+

Classifications are displayed both at the 10,000 foot view, main report +and also at the resource report level.

+
+
+
    +
  • +

    Java Classifications TO_DO: link

    +
  • +
  • +

    XML Classifications TO_DO: link

    +
  • +
+
+
+
+

Inline Hints

+
+

Windup takes the approach of profiling resources and providing +syntactically highlighted resource reports. The resource report will +show the resource with potentially highlighted lines that may contain +inline hints to help the developers migrate a piece of code.

+
+
+

Adding inline hints for Java and XML are as simple as adding Regular +Expressions or XPath Expressions to the Windup rules.

+
+
+
+
+

Ruleset Java EE Apps

+
+
DRAFT
+

TBD?

+
+
+
DRAFT
+

TBD ?

+
+
+
+

Ruleset Reporting

+
+
DRAFT
+

TBD?

+
+
+
+

XML Ruleset

+
+
DRAFT
+
    +
  • +

    XPathMatch

    +
  • +
  • +

    XsltTransformation

    +
  • +
+
+
+

A core ruleset to provide support for XML files.

+
+
+

Metadata

+
+

ID: xml +Graph prefix: xml

+
+
+
+

Rule providers

+
+

A definition list (dl/dt/dd) of RuleProviders of given Ruleset with brief descriptions.

+
+
+

TO_DO: Not sure if all the Xml* really belong here - maybe rather to Java or Java EE?

+
+
+
    +
  • +

    DiscoverXmlFilesRuleProvider -

    +
  • +
  • +

    XmlBaseConfig -

    +
  • +
  • +

    XmlGlassfishConfig -

    +
  • +
  • +

    XmlJbossConfig -

    +
  • +
  • +

    XmlJbossEsbConfig -

    +
  • +
  • +

    XmlJonasConfig -

    +
  • +
  • +

    XmlJppConfig -

    +
  • +
  • +

    XmlJrunConfig -

    +
  • +
  • +

    XmlKnowHowConfig -

    +
  • +
  • +

    XmlOrionConfig -

    +
  • +
  • +

    XmlPersistanceConfig -

    +
  • +
  • +

    XmlResinConfig -

    +
  • +
  • +

    XmlSoa5Config -

    +
  • +
  • +

    XmlSonicEsbConfig -

    +
  • +
  • +

    XmlSpringConfig -

    +
  • +
  • +

    XmlWeblogicConfig -

    +
  • +
  • +

    XmlWebserviceConfig -

    +
  • +
  • +

    XmlWebsphereConfig -

    +
  • +
+
+
+
+

Models

+
+

_Subclasses of WindupVertexFrame.

+
+
+
    +
  • +

    DoctypeMetaModel

    +
  • +
  • +

    XmlFileModel

    +
  • +
  • +

    XmlTypeReferenceModel

    +
  • +
  • +

    XsltTransformationModel

    +
  • +
+
+
+
+

Configuration

+
+

_Subclasses of TO_DO

+
+
+
+

Reports

+
+

Report files or report parts created by this ruleset.

+
+
+
+
+

Windup Models

+
+

Windup models are the classes extending WindupVertexFrame. +They are used to model the data in the graph database to Java objects.

+
+
+

This is an overview of the most important models. +The complete and up-to-date list of models is in Javadoc.

+
+
+

Windup Models Graphic

+
+
+

Meta Models

+
+
    +
  • +

    User input

    +
  • +
  • +

    Rules and Rule Providers metadata

    +
  • +
+
+
+
+

Core Models

+
+

FileModel ArchiveModel

+
+
+
+

Reporting Models

+ +
+
+

Custom Models (coming from add-ons)

+
+

See respective ruleset’s documentation.

+
+
+
+
+

Create Java Queries

+
+

Query for all frames of some Model

+
+
+
Query.find(FileModel.class).as("result")
+
+
+
+
+

Query by property

+
+
+
Query.find(FileModel.class)
+    .withProperty(FileModel.PROPERTY_IS_DIRECTORY, true)
+    .as("res")
+
+
+
+
+

Gremlin query

+
+
+
code,java
+Query.find(FileModel.class).piped(new QueryGremlinCriterion() {
+    public void query( GraphRewrite event, GremlinPipeline<Vertex, Vertex> pipeline ) {
+       throw new UnsupportedOperationException( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates.
+    }
+})
+.withProperty(FileModel.PROPERTY_IS_DIRECTORY, true)
+.as("res")
+
+
+
+
+

Custom query

+
+

The Query API is just a convenience implementation. For a custom +query, implement your own GraphCondition:

+
+
+
+
.when(
+    new GraphCondition() {
+        public boolean evaluate( GraphRewrite event, EvaluationContext context ) {
+            event.getGraphContext(); //...
+        }
+    }
+)
+
+
+
+
+
+

Rules Metadata

+
+

Overview

+
+
Draft
+

Rules metadata are used for ordering, filtering, debugging and performance reasons.

+
+
+
+

Metadata used by Windup

+
+

To control ordering, override getExecuteAfter() and getExecuteBefore().

+
+
+
+
public class MyRules extends WindupRuleProvider
+{
+    public List<Class<? extends WindupRuleProvider>> getExecuteAfter() {
+        return asClassList(UpdateVictimsDbRules.class, ComputeArchivesSHA512.class);
+    }
+
+
+
+

To specify the rule ID, use .withId("…​").

+
+
+
+
            .addRule()
+            .perform(...)
+            .withId("CheckArchivesWithVictims")
+
+
+
+

For other metadata, either use .withMetadata() or override enhanceMetadata(). +To provide categorization for filtering, use CATEGORY.

+
+
+

For its metadata, Windup uses the keys defined in RuleMetadata:

+
+
+
    +
  • +

    CATEGORY (String): Define which category the rule belongs to, which can be then used to filter the rules to execute (plus all those they depend on). Not implemented yet.

    +
  • +
  • +

    ORIGIN (String): The rule origin. Typically a class name.

    +
  • +
  • +

    AUTO_COMMIT (boolean): Whether to call database commit() after the rule executes.

    +
  • +
  • +

    TREAT_EXCEPTIONS_AS_FATAL (boolean): Whether all Exceptions from this Rule are to be treated as fatal. The default is non-fatal.

    +
  • +
  • +

    RULE_PROVIDER: The WindupRuleProvider that originated the rule. This is used internally, not to be specified by rule author.

    +
  • +
+
+
+

You can find out more information about rule metadata here: RuleMetadata Javadoc.

+
+
+
+

How to define rule metadata

+
+

The RuleMetadata is defined using the .withMetadata(Object key, Object value).

+
+
+
+
            .addRule()
+            .when(...)
+            .perform(...)
+            .withId("CheckArchivesWithVictims")
+            .withMetadata(RuleMetadata.CATEGORY, ...)
+
+
+
+

In case you want to apply the same metadata to all rules in some RuleProvider, override it’s enhanceMetadata() method. The default implementations sets CATEGORY to "Uncategorized", ORIGIN to it’s class’es name, and RULE_PROVIDER to the RuleProvider object:

+
+
+
+
public class MyRules extends WindupRuleProvider
+{
+    public void enhanceMetadata(Context context) {
+        if( ! context.containsKey(RuleMetadata.CATEGORY) )
+            context.put(RuleMetadata.CATEGORY, "Uncategorized");
+        if( ! context.containsKey(RuleMetadata.ORIGIN) )
+            context.put(RuleMetadata.ORIGIN, this.getClass().getName());
+        if( ! context.containsKey(RuleMetadata.RULE_PROVIDER) )
+            context.put(RuleMetadata.RULE_PROVIDER, this);
+    }
+
+
+
+
Why a Map?
+
+

For the rules definition, Windup uses the OCPsoft Rewrite library. Whenever there is something Windup specific which can’t be pulled to the upstream implementation, Windup resorts to putting data into a metadata map.

+
+
+

This map is typically not used by rule authors, unless they use a custom Windup extension (don’t confuse that with custom Ruleset).

+
+
+
+
+

Ruleset metadata

+
+

Ruleset metadata cover the whole Ruleset, not individual rules. +For ruleset metadata, unlike rules, Windup uses a type-safe interface WindupRulesetMetadata +(see javadoc).

+
+
+

Currently, it only defines Ruleset ID.

+
+
+
+
+

Rules Operations

+
+

A list of high-level operations across rulesets.

+
+
+
    +
  • +

    JavaClass

    +
  • +
  • +

    Classification

    +
    +
      +
    • +

      Hint

      +
    • +
    • +

      Link

      +
    • +
    +
    +
  • +
+
+
+

TBD.

+
+
+

For the implementation of the operation, see +here.

+
+
+

TBD

+
+
+

Rules Ops Reporting Hint

+
+
+
DRAFT
+

TBD

+
+
+
+

Ops Reporting TypeReference

+
+

TBD

+
+
+

Different for Java and XML. +Contains Line, Column

+
+
+

DRAFT: TBD?

+
+
+
+
+
+

Debugging and Troubleshooting

+
+
+

Debugging and Profiling

+
+

Debug the Windup Distribution Runtime

+
+

You can debug the Windup distribution using one of the following approaches.

+
+
+
    +
  1. +

    Pass the --debug argument on the command line when you execute Windup.

    +
    +
    +
    For Linux:    WINDUP_HOME/bin $ ./windup --debug
    +For Windows:  C:\WINDUP_HOME\bin> windup --debug
    +
    +
    +
  2. +
  3. +

    Configure the FORGE_OPTS for debugging.

    +
    +
    +
    export FORGE_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
    +
    +
    +
  4. +
+
+
+
+

Debug a Test Using NetBeans

+
+

Click the Debug Test File button, or choose MenuDebugDebug Test File.

+
+
+
+

Profile a Test Using NetBeans

+
+
    +
  1. +

    Profiling requires a lot of memory, so be sure to increase the NetBeans memory settings.

    +
    +
      +
    • +

      Open the NETBEANS_HOME/etc/netbeans.conf file

      +
    • +
    • +

      Find the line with netbeans_default_options=

      +
    • +
    • +

      Add the following option

      +
      +
      +
      -J-Xmx5200m -J-XX:MaxPermSize=1024m
      +
      +
      +
    • +
    • +

      Restart NetBeans.

      +
    • +
    +
    +
  2. +
  3. +

    Click Menu > Profile > Profile Test File.

    +
  4. +
  5. +

    In the resulting dialog, enter the following.

    +
    +
    +
    exec.args=-Djboss.modules.system.pkgs=org.netbeans
    +
    +
    +
  6. +
+
+
+
+

Profile Forge Runtime Using YourKit

+
+
    +
  1. +

    Download and unzip YourKit. Be sure to get the trial license.

    +
  2. +
  3. +

    Configure the FORGE_OPTS for Yourkit:

    +
    +
    +
    export YOURKIT_HOME=/home/ondra/sw/prog/YourKit-b14092
    +export FORGE_OPTS="-Djboss.modules.system.pkgs=com.yourkit -agentpath:$YOURKIT_HOME/bin/linux-x86-64/libyjpagent.so=sampling,onexit=snapshot,delay=0"
    +
    +
    +
  4. +
  5. +

    Run forge. For details, see Profiling +Forge, but skip the first 2 points that direct you to copy the YourKit module and JAR into the Forge installation. Forge 2 already contains the YourKit module and JAR>.

    +
  6. +
  7. +

    Run windup-analyze-app.

    +
    +
    +
    forge -e windup-migrate-app
    +
    +
    +
  8. +
+
+
+
+
+

Troubleshoot Windup Issues

+
+

Logging

+
+

Logging is currently broken and will not be fixed any time soon.

+
+
+

See Known Issues and WINDUP-73 for the current status.

+
+
+
+

Debugging Exceptions

+
+

Exceptions in Surefire reports are broken due to the way Forge wraps +exceptions and the way Surefire handles them. You need to +debug or rewrap exceptions using TestUtil.rewrap(ex).

+
+
+

See Known Issues and WINDUP-197 for the current status..

+
+
+
+

Classloading Problems

+
+

Configuring dependencies in a Forge-based project can be a little tricky. +See Dependencies for some hints.

+
+
+
+
Caused by: java.lang.IllegalArgumentException: Type value for model 'org.jboss.windup.rules.files.model.FileReferenceModel' is already registered with model org.jboss.windup.rules.files.model.FileReferenceModel
+
+
+
+

This means that the model class is loaded twice. I.e. the module containing it is loaded twice. Or, in tests, you may be (accidentally) adding the class to the deployment. +This may especially happen after Maven coordinates of some module are changed.

+
+
+
+
+
+
+

Wiki Information

+
+
+

About the Windup Wiki

+
+

Purpose

+
+

This wiki is a place to create Windup documentation in a collaborative manner, a bit wildly, and on the fly. It is intended to reflect the state of the Windup source code master branch, however pages may become obsolete as the master changes quickly.

+
+
+
+

Areas of Interest

+
+

The Wiki pages are divided into the following main areas of interest, which may often overlap. The page names use these prefixes:

+
+
+
    +
  • +

    Dev-: …​: These pages are of interest to Windup core developers.

    +
  • +
  • +

    Rules- …​: These pages are of interest to rules developers.

    +
  • +
  • +

    User- …​: These pages that are of interest to Windup users.

    +
  • +
  • +

    no prefix: These pages that are also of interest to Windup users.

    +
  • +
+
+
+
+

Markdown, AsciiDoc, or…​?

+
+

This Wiki uses AsciiDoc because it is capable of handling the publishing requirements and structural elements needed to create technical books. If you would like to contribute to the documentation, feel free to use your favorite Wiki language, however, it will ultimately be converted to AsciiDoc.

+
+
+
+

Contributor Guidelines

+
+

Please see the Contributing Guidelines for details about how to name pages and use the correct AsciiDoc syntax to make the transition to the final documentation go more smoothly.

+
+
+

The following is a brief overview.

+
+
+
    +
  • +

    Name wiki pages using only letters, numbers and dashes. Do not include spaces, colons, or other special characters in page names.

    +
  • +
  • +

    Be sure to add a level 3 page heading (===) at the top of each page. When compiled in a book, the Guide name is the top level, chapters are level 2, and the page is level 3. This is the title that appears in the table of contents for the page.

    +
    +
    +
    === Build Windup from Source
    +
    +
    +
  • +
  • +

    At the beginning of each new Wiki page, add an anchor with the exact page name, including the dashes. This generates the correct anchors that are needed when the pages are combined into a book.

    +
    +
    +
    [[Page-Name]]
    +=== Page Name
    +
    +
    +
  • +
  • +

    Wiki generates anchors using dashes for spaces. AsciiDoctor generates a leading underscore and underscores for spaces.When referring to another section within the same page, do not use the [section-title-anchor] syntax. Instead, create an anchor and use the 'xref:' syntax to provide the link. Replace spaces in the section title with dashes.

    +
    +
      +
    • +

      Create the anchor at the top of the section using double brackets to force the generation of dashes instead of underscores.

      +
      +
      +
      [[section-header]]
      +==== Section Header
      +
      +
      +
    • +
    • +

      Then use the xref to create the link.

      +
      +
      +
      See xref:section-header[Section Header] for more information.
      +
      +
      +
    • +
    +
    +
  • +
+
+
+
+
+

Add Images to the Windup Wiki

+
+
    +
  • +

    Fork https://github.com/windup/windup/wiki

    +
  • +
  • +

    Clone the Windup Wiki into a windup.wiki/ directory using the SSH clone URL:

    +
    +
    +
    git clone git@github.com:USER_NAME/windup.git windup.wiki
    +
    +
    +
  • +
  • +

    Navigate to the new windup.wiki/ directory.

    +
  • +
  • +

    Add the upstream repository.

    +
    +
    +
    git remote add -f upstream git@github.com:windup/windup.wiki.git
    +
    +
    +
  • +
  • +

    Check out a branch to work in.

    +
    +
    +
    git checkout -b BRANCH_NAME upstream/master
    +
    +
    +
  • +
  • +

    Copy the image into the windup.wiki/images directory

    +
    +
    +
    cp IMAGE_NAME.png images/
    +
    +
    +
  • +
  • +

    Add the new image to Git

    +
    +
    +
    git add images/IMAGE_NAME.png
    +
    +
    +
  • +
  • +

    Commit the change

    +
    +
    +
    git commit -m "Add new image"
    +
    +
    +
  • +
  • +

    Push the change to your Windup Wiki repository.

    +
    +
    +
    git push origin HEAD:master
    +
    +
    +
  • +
  • +

    Test the new image in a page on your own Wiki. Don’t forget to add the :imagesdir: images directive to the beginning of the page to point to the images directory.

    +
    +
    +
    image:IMAGE_NAME.png[New Image]
    +
    +
    +
    +

    For example:

    +
    +
    +

    ==== My Image

    +
    +
  • +
+
+
+

Windup Logo

+
+
+
    +
  • +

    If it works, push the image to the upstream repository

    +
    +
    +
    git push upstream HEAD:master
    +
    +
    +
  • +
+
+
+
+
+
+

Windup Product Release and Documentation Process

+
+
+

Windup Release Process

+
+

Windup consists of artifacts from multiple GitHub repositories. Use the following procedure to create a Windup release.

+
+
+
    +
  1. +

    Release http://github.com/windup/nexus-indexer

    +
    +
    +
    mvn release:prepare release:perform -DreleaseVersion=X -Dtag=Y -DdevelopmentVersion=Z
    +
    +
    +
  2. +
  3. +

    Release http://github.com/windup/windup primary reactor

    +
  4. +
  5. +

    Release http://github.com/windup/windup-rulesets

    +
  6. +
  7. +

    Release http://github.com/windup/windup-distribution

    +
  8. +
+
+
+
+

Create Windup JavaDoc

+
+

The most recent Windup JavaDoc build is located here: http://windup.github.io/windup/docs/javadoc/latest/index.html

+
+
+

If you want to build an updated version, use the following procedure to create JavaDoc for Windup.

+
+
+
    +
  1. +

    In Windup project root directory, type the following Maven command:

    +
    +
    +
    mvn validate -PjavadocDist
    +
    +
    +
  2. +
  3. +

    The JavaDoc is created in the Windup target/site/apidocs subdirectory.

    +
  4. +
+
+ +
+
+

Windup Documentation Process

+
+

Wiki Documentation

+
+
    +
  • +

    Name wiki pages using only letters, numbers and dashes. Do not include spaces, colons, or other special characters in page names.

    +
  • +
  • +

    Use AsciiDoc rather than Markdown for the syntax.

    +
  • +
+
+
+
+

Product Documentation

+
+

Windup product documentation is stored here: https://github.com/windup/windup-documentation

+
+
+

See the CONTRIBUTING guide for AsciiDoc syntax rules regarding headers and links to make this process easier.

+
+
+
+

Update the Windup Documentation with the Latest Wiki Changes

+
+
Summary
+
+

The Windup guides are located in the windup-documentation/docs directory. They are named the same as the guides in the Wiki but have a 'Windup-' prefix. The windup-documentation/docs guides should kept synchronized with the versions in the windup.wiki.

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Wiki GuideWindup Docs Guide

User-Guide.asciidoc

Windup-User-Guide.adoc

Rules-Development-Guide.asciidoc

Windup-Rules-Development-Guide.adoc

Core-Development-Guide.asciidoc

Windup-Core-Development-Guide.adoc

Migration-Planning-Guide

Windup-Migration-Planning-Guide.adoc

+
+
Documentation Update Scripts
+
+

The https://github.com/windup/windup-documentation/tree/master/scripts/windupDocUpdate.sh script copies the pages from the Windup wiki to the windup-documentation repository, makes minor modifications, and generates each guide in a single HTML page book format. The resulting guides are created in the WINDUP_DOCUMENTATION_HOME/html/ directory.

+
+
+

The script performs the following steps.

+
+
+
    +
  1. +

    Copies the Windup wiki pages to the WINDUP_DOCUMENTATION_HOME/docs/ directory, renaming them with the .adoc extension.

    +
  2. +
  3. +

    Makes sure each guide includes all pages that are referenced by pages within it. Scripts are provided to search for links within each individual guide. They navigate to the WINDUP_DOCUMENTATION_HOME/docs/ directory and search using the following command:

    +
    +
    +
    grep 'xref:[A-Z]' `find . -name '*.adoc'`.
    +
    +
    +
  4. +
  5. +

    Replaces each xref: to external pages with an xref: using the following command.

    +
    +
    +
    find . -name '*.adoc' -print | xargs sed -i 's/xref:/xref:/g'
    +
    +
    +
  6. +
  7. +

    Navigates to the WINDUP_DOCUMENTATION_HOME/ directory and builds the books. The single page HTML files are created in the WINDUP_DOCUMENTATION_HOME/html/ directory.

    + ++++ + + + + + + + + + + + + + + + + + + + + +
    Windup GuideCommand

    Windup User Guide

    asciidoctor -t -dbook -a toc -o html/WindupUserGuide.html docs/Windup-User-Guide.adoc

    Windup Rules Development Guide

    asciidoctor -t -dbook -a toc -o html/WindupRulesDevelopmentGuide.html docs/Windup-Rules-Development-Guide.adoc

    Windup Core Development Guide

    asciidoctor -t -dbook -a toc -o html/WindupCoreDevelopmentGuide.html docs/Windup-Core-Development-Guide.adoc

    +
  8. +
+
+
+
+
+
+

Publish the HTML Docs for Access at GitHub IO

+
+

The https://github.com/windup/windup-documentation/tree/master/scripts/windupPublish.sh script copies the pages from the Windup wiki to the windup-documentation repository, makes minor modifications, and generates each guide in a single HTML page book format. The resulting guides are created in the WINDUP_DOCUMENTATION_HOME/html/ directory.

+
+
+

The script performs the following steps.

+
+
+
    +
  • +

    The first time, you must fork and clone the windup GitHub repository. After that, just fetch the latest upstream.

    +
    +
    +
    git clone https://github.com/windup/windup.git
    +git fetch upstream
    +
    +
    +
  • +
  • +

    Navigate to the local WINDUP_HOME/ directory.

    +
    +
    +
    cd windup
    +
    +
    +
  • +
  • +

    Checkout the gh-pages from the WINDUP_HOME repository

    +
    +
    +
    git checkout -b gh-pages windup/gh-pages
    +
    +
    +
  • +
  • +

    If the WINDUP_HOME/docs/WINDUP_RELEASE/ directory does not yet exist, create a docs/WINDUP_RELEASE/html/images/

    +
    +
    +
    mkdir -p docs/WINDUP_RELEASE/html/images (if it doesn't exist!)
    +
    +
    +
  • +
  • +

    Copy any the images, stylesheets, and html files from windup-documentation:

    +
    +
    +
    cp WINDUP_DOCUMENTATION_HOME/html/*.html WINDUP_HOME/docs/WINDUP_RELEASE/html/
    +cp WINDUP_DOCUMENTATION_HOME/*.css WINDUP_HOME/docs/WINDUP_RELEASE/html/
    +cp WINDUP_DOCUMENTATION_HOME/images/* WINDUP_HOME/docs/WINDUP_RELEASE/html/images/
    +
    +
    +
  • +
  • +

    Add the updated files to GitHub.

    +
    +
    +
    git add docs
    +
    +
    +
  • +
  • +

    Commit the changes.

    +
    +
    +
    git commit -m "Update message..."
    +
    +
    +
  • +
  • +

    Push the changes to GitHub.

    +
    +
    +
    git push upstream gh-pages
    +
    +
    +
  • +
  • +

    View the documentation at http://windup.github.io/windup/docs/WINDUP_RELEASE/html/WindupUserGuide.html

    +
  • +
  • +

    Update the symlink for latest to point to the new version.

    +
    +
      +
    • +

      Navigate to the WINDUP_HOME/docs directory.

      +
    • +
    • +

      Remove the existing symlink for "latest".

      +
      +
      +
      unlink latest
      +
      +
      +
    • +
    • +

      Create a symlink to the new documentation.

      +
      +
      +
      Syntax: ln -s WINDUP_RELEASE latest
      +Example: ln -s 2.0.0.Final latest
      +
      +
      +
    • +
    • +

      Add the modified "latest" directory to Git.

      +
      +
      +
      git add latest
      +
      +
      +
    • +
    • +

      Commit the change.

      +
      +
      +
      git commit -m 'Replace symlink for latest to point to 2.0.0.Final'
      +
      +
      +
    • +
    • +

      Push the changes to your own git repository, verify and issue a pull.

      +
      +
      +
      git push origin HEAD
      +
      +
      +
    • +
    • +

      Push the changes upstream

      +
      +
      +
      git push upstream gh-pages
      +
      +
      +
    • +
    • +

      View the documentation at http://windup.github.io/windup/docs/latest/html/WindupUserGuide.html

      +
    • +
    +
    +
  • +
+
+
+
+
+
+
+

Additional Resources

+
+
+

Review the Windup Quickstarts

+
+

The Windup quickstarts provide working examples of how to create custom Java-based rule add-ons and XML rules. You can use them as a starting point for creating your own custom rules. The quickstarts are available on GitHub here: https://github.com/windup/windup-quickstarts

+
+
+

You can fork and clone the project to have access to regular updates or you can download a ZIP file of the latest version.

+
+
+

Download the Latest ZIP

+
+

To download the latest quickstart ZIP file, browse to: https://github.com/windup/windup-quickstarts/releases

+
+
+

Click on the most recent release to download the ZIP to your local file system.

+
+
+
+

Fork and Clone the GitHub Project

+
+

If you don’t have the GitHub client (git), download it from: http://git-scm.com/

+
+
+
    +
  1. +

    Click the Fork link on the Windup quickstart GitHub page to create the project in your own Git. The forked GitHub repository URL created by the fork should look like this: https://github.com/YOUR_USER_NAME/windup-quickstarts.git

    +
  2. +
  3. +

    Clone your Windup quickstart repository to your local file system:

    +
    +
    +
    git clone https://github.com/YOUR_USER_NAME/windup-quickstarts.git
    +
    +
    +
  4. +
  5. +

    This creates and populates a windup-quickstarts directory on your local file system. Navigate to the newly created directory, for example

    +
    +
    +
    cd windup-quickstarts/
    +
    +
    +
  6. +
  7. +

    If you want to be able to retrieve the lates code updates, add the remote upstream repository so you can fetch any changes to the original forked repository.

    +
    +
    +
    git remote add upstream https://github.com/windup/windup-quickstarts.git
    +
    +
    +
  8. +
  9. +

    To get the latest files from the upstream repository.

    +
    +
    +
    git reset --hard upstream/master
    +
    +
    +
  10. +
+
+
+
+
+

Get Involved

+
+

How can you help?

+
+

To help us make Windup cover most application constructs and server configurations, including yours, you can help with any of the following items. Some items require only a few minutes of your time!

+
+
+
    +
  • +

    Let us know what Windup migration rules should cover.

    +
  • +
  • +

    Provide example applications to test migration rules.

    +
  • +
  • +

    Identify application components and problem areas that may be difficult to migrate.

    +
    +
      +
    • +

      Write a short description of these problem migration areas.

      +
    • +
    • +

      Write a brief overview describing how to solve the problem migration areas.

      +
    • +
    +
    +
  • +
  • +

    Try Windup on your application. Be sure to report any issues you encounter.

    +
  • +
  • +

    You can contribute Windup rules.

    +
    +
      +
    • +

      Write a Windup rule add-on to automate a migration process.

      +
    • +
    • +

      Create a test for the new rule.

      +
    • +
    • +

      For details, see the Windup Rules Development Guide.

      +
    • +
    +
    +
  • +
  • +

    You can also contribute to the project source code.

    +
    +
      +
    • +

      Create a core rule.

      +
    • +
    • +

      Improve performance or efficiency.

      +
    • +
    • +

      See the_Windup Core Development Guide_ for information about how to configure your environment and set up the project.

      +
    • +
    +
    +
  • +
+
+
+

Any level of involvement is greatly appreciated!

+
+
+
+ +
+ +
+
+

You can also follow us on this IRC channel: irc.freenode.net#windup.

+
+
+
+
+

Known Windup Issues

+
+

Windup known issues are tracked here: Open Windup issues

+
+
+
+

Report Issues with Windup

+
+

Windup uses JIRA as its issue tracking system. If you encounter an issue executing Windup, please file a Windup JIRA Issue.

+
+
+

Create a JIRA Account

+
+

If you do not yet have a JIRA account, create one using the following procedure.

+
+
+
    +
  1. +

    Open a browser to the following URL: https://issues.jboss.org/secure/Dashboard.jspa

    +
  2. +
  3. +

    Click the Sign Up link in the top right side of the page.

    +
  4. +
  5. +

    Enter your email address and click the Confirm address button.

    +
  6. +
  7. +

    Follow the instructions sent to your email address.

    +
  8. +
+
+
+
+

Create a JIRA Issue

+
+
    +
  1. +

    Open a browser to the following URL: https://issues.jboss.org/secure/CreateIssue!default.jspa.

    +
    +
      +
    • +

      If you have not yet logged in, click the Log In link at the top right side of the page.

      +
    • +
    • +

      Enter your credentials and click the LOGIN button.

      +
    • +
    • +

      You are then redirected back to the Create Issue page.

      +
    • +
    +
    +
  2. +
  3. +

    Choose the following options and click the Next button.

    +
    +
      +
    • +

      Project: Windup

      +
    • +
    • +

      Issue Type: Bug

      +
    • +
    +
    +
  4. +
  5. +

    On the next screen complete the following fields:

    +
    +
      +
    • +

      Summary: Enter a brief description of the problem or issue.

      +
    • +
    • +

      Environment: Provide the details of your operating system, version of Java, and any other pertinent information.

      +
    • +
    • +

      Description: Provide a detailed description of the issue. Be sure to include logs and exceptions traces.

      +
    • +
    +
    +
  6. +
  7. +

    Click the Create button to create the JIRA issue.

    +
  8. +
  9. +

    If the application or archive causing the issue does not contain sensitive information and you are comfortable sharing it with the Windup development team, attach it to the issue by choosing More → Attach Files. You are provided with an option to restrict visibility to JBoss employees.

    +
  10. +
+
+
+
+
+
+
+

Appendix

+
+
+

Glossary of Terms Used in Windup

+
+

Rules Terms

+
+
+
Rule
+
+

A piece of code that performs a single unit of work during the migration process. Depending on the complexity of the rule, it may or may not include configuration data. Extensive configuration information may be externalized into external configuration, for example, a custom XML file. The following is an example of a Java-based rule added to the JDKConfig RuleProvider class.

+
+
+
+
+
+
.addRule()
+    .when(JavaClass.references("java.lang.ClassLoader$").at(TypeReferenceLocation.TYPE))
+    .perform(Classification.as("Java Classloader, must be migrated.")
+    .with(Link.to("Red Hat Customer Portal: How to get resources via the ClassLoader in a JavaEE application in JBoss EAP",  "https://access.redhat.com/knowledge/solutions/239033"))
+     .withEffort(1))
+
+
+
+
+
RuleProvider
+
+

A class that implements one or more rules using the .addRule() method. The following are examples of legacy Java RulesProviders that are defined in rules-java-ee ruleset.

+
+
    +
  • +

    EjbConfig

    +
  • +
  • +

    JDKConfig

    +
  • +
  • +

    SeamToCDI

    +
  • +
+
+
+
Ruleset
+
+

A ruleset is a group of one or more RuleProviders that targets a specific area of migration, for example, Spring → Java EE 6 or WebLogic → JBoss EAP. A ruleset is packaged as a JAR and contains additional information needed for the migration, such as operations, conditions, report templates, static files, metadata, and relationships to other rulesets. The following Windup projects are rulesets.

+
+
    +
  • +

    rules-java-ee

    +
  • +
  • +

    rules-xml

    +
  • +
+
+
+
Rules Metadata
+
+

Information about whether a particular ruleset applies to a given situation. The metadata can include the source and target platform and frameworks.

+
+
Rules Pipeline
+
+

A collection of rules that feed information into the knowledge graph.

+
+
+
+
+
+

Reporting Terms

+
+
+
Lift and Shift (Level of effort)
+
+

The code or file is standards-based and can be ported to the new environment with no changes.

+
+
Mapped (Level of effort)
+
+

There is a standard mapping algorithm to port the code or file to the new environment.

+
+
Custom (Level of effort)
+
+

The code or file must be rewritten or modified to work in the new environment.

+
+
Story Point
+
+

A term commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

+
+
+
+
+
+
+

Windup Project Information

+
+

Github Repository

+
+

The Windup project github repository is located at https://github.com/windup/windup/.

+
+
+

See the Core-Developer-Guide for details on how to contribute to the Windup project source code.

+
+
+
+

Documentation

+
+

The Windup documentation is currently located here in the Windup project Wiki.

+
+
+

For additional information, refer to the Windup Javadoc.

+
+
+
+

Website

+
+

There is currently no website for Windup 2.0.

+
+
+

The windup.jboss.org website currently provides information primarily +for legacy Windup 1.x (legacy).

+
+
+
+

IRC chat

+
+

Server: irc.freenode.net
+Channel: #windup

+
+
+
+

Mailing lists

+
+

Subscribe to the JBoss mailing lists at +https://lists.jboss.org/mailman/listinfo/windup-dev.

+
+
+ +
+
+
+

Core development team (and IRC nicks)

+
+

Lead: Lincoln Baxter (lincolnthree)
+Members: Jess Sightler (jsightler), Matej Briskar (mbriskar), Ondrej +Zizka (ozizka)

+
+
+
+

IRC meeting bot commands (hint for the moderator)

+
+
+
#startmeeting
+#chair lincolnthree, ozizka, jsightler, mbriskar
+#addtopic Status Reports
+#addtopic Next steps
+#nexttopic
+#info ...
+#endmeeting
+Useful Commands: #action #agreed #help #info #idea #link #topic.
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/html/WindupCoreDevelopmentGuide.html b/html/WindupCoreDevelopmentGuide.html index fe905118d6..8aaeceb9aa 100644 --- a/html/WindupCoreDevelopmentGuide.html +++ b/html/WindupCoreDevelopmentGuide.html @@ -415,122 +415,122 @@

Windup Core Development Guide

Table of Contents
@@ -538,18 +538,18 @@

Windup Core Development Guide

-

Overview

+

1. Overview

This guide is for developers who plan to contribute source code updates or core rule add-ons to the Windup 2.0 project.

-

Windup Logo

+

Windup Logo


-

What is Windup?

+

1.1. What is Windup?

JBoss Windup is a rule-based tool to simplify application migrations.

@@ -560,13 +560,13 @@

What is Windup?

migrating from other containers to JBoss EAP a piece of cake.

-

Windup 2.0 vs. Windup 0.7.x

+

1.1.1. Windup 2.0 vs. Windup 0.7.x

Windup 2.0 aims to deliver the same functionality as legacy Windup, however, the internal architecture and rule structure is very different and allows for the creation of much more complex rules.

-

How Does Windup Simplify Migration?

+

1.1.2. How Does Windup Simplify Migration?

Windup looks for common resources and highlight technologies and known “trouble spots” in migrating applications. The goal of Windup is to provide a @@ -606,14 +606,14 @@

How Does Windup Simplify Migration?

-

Follow Windup on Twitter!

+

1.1.3. Follow Windup on Twitter!

Follow Windup on Twitter @JBossWindup for updates and more!

-

Features of Windup 2.0

+

1.2. Features of Windup 2.0

@@ -747,7 +747,7 @@

Features of Windup 2.0

-

About the WINDUP_HOME Variable

+

1.3. About the WINDUP_HOME Variable

This documentation uses the WINDUP_HOME replaceable value to denote the path to the Windup distribution. When you encounter this value in the documentation, be sure to replace it with the actual path to your Windup installation.

@@ -765,18 +765,18 @@

About the WINDUP_HOME Variable

-

Get Started

+

2. Get Started

Before you begin to contribute to Windup, take a quick tour to see how to use it.

-

Install and Configure Maven

+

2.1. Install and Configure Maven

If you plan to contribute to the core code base or create Java-based rule add-ons, you must first install and configure Maven to build Windup from source.

-

Download and Install Maven

+

2.1.1. Download and Install Maven

If you plan to use Eclipse Luna (4.4) to build Windup, you can skip this step and go directly to the section entitled Configure Maven to Build Windup. This version of Eclipse embeds Maven 3.2.1 so you do not need to @@ -802,7 +802,7 @@

Download and Install Maven

-

Configure the Maven Installation in Your IDE

+

2.1.2. Configure the Maven Installation in Your IDE

JBoss Developer Studio 7.1.1 is built upon Eclipse Kepler (4.3), which embeds Maven 3.0.4. If you plan to use JBoss Developer Studio 7.1.1 or @@ -836,7 +836,7 @@

Configure the Maven Insta

-

Configure Maven to Build Windup

+

2.1.3. Configure Maven to Build Windup

Windup uses artifacts located in the JBoss Nexus @@ -900,12 +900,12 @@

Configure Maven to Build Windup

-

Get the Windup Source Code

+

2.2. Get the Windup Source Code

To contribute to the Windup 2.0 project source code, you must fork the Windup repository to your own Git, clone your fork, commit your work on topic branches, and make pull requests back to the Windup repository.

-

Install the Git Client

+

2.2.1. Install the Git Client

If you don’t have the Git client (git), get it from: http://git-scm.com/

@@ -936,7 +936,7 @@

Install the Git Client

-

Fork and Clone the Windup Repository

+

2.2.2. Fork and Clone the Windup Repository

  1. @@ -978,7 +978,7 @@

    Fork and Clone the Windup Reposit

-

Build Windup from Source

+

2.3. Build Windup from Source

This information is provided for new developers who plan to contribute code to the Windup open source project. This section describes how to build Windup from source and how to extract the Windup distribution that is created during the build process.

@@ -987,7 +987,7 @@

Build Windup from Source

If you use Linux and are an experienced Windup developer looking for a quick refresher, jump to: Quick Build Review for Experienced Windup Developers.

-

System Requirements to Build Windup

+

2.3.1. System Requirements to Build Windup

  1. @@ -1043,7 +1043,7 @@

    System Requirements to Build Windu

-

Build Windup Using Maven Command Line

+

2.3.2. Build Windup Using Maven Command Line

  1. @@ -1117,7 +1117,7 @@

    Build Windup Using Maven Command

-

Build Windup Using Red Hat JBoss Developer Studio or Eclipse

+

2.3.3. Build Windup Using Red Hat JBoss Developer Studio or Eclipse

If you prefer, you can use an IDE to build Windup.

@@ -1156,7 +1156,7 @@

Build Win

-

Extract the Windup Distribution Source File

+

2.3.4. Extract the Windup Distribution Source File

The build process creates a windup-distribution-2.0.0-SNAPSHOT-offline.zip file in the Windup source dist/target/ directory.

@@ -1165,7 +1165,7 @@

Extract the Windup Distrib

-

Quick Build Review for Experienced Windup Developers

+

2.3.5. Quick Build Review for Experienced Windup Developers

git clone git@github.com:windup/windup.git windup
@@ -1181,7 +1181,7 @@ 

Quick Build Review

-

Execute Windup (Built from Windup Source)

+

2.4. Execute Windup (Built from Windup Source)

These instructions are for Windup core developers who plan to build Windup from source to test code updates.

@@ -1216,9 +1216,9 @@

Execute Windup (Built from Windup

-

Execute Windup

+

2.5. Execute Windup

-

Prerequisites

+

2.5.1. Prerequisites

Before you begin, you must gather the following information.

@@ -1283,7 +1283,7 @@

Prerequisites

-

Start Windup

+

2.5.2. Start Windup

For information about the use of WINDUP_HOME in the instructions below, see About the WINDUP_HOME Variable.

@@ -1324,24 +1324,20 @@

Start Windup

-

Run Windup

+

2.5.3. Run Windup

  1. The command to run Windup is windup-migrate-app.

  2. -

    The following is a list of the most commonly used command line arguments.

    +

    This command can take arbitrary options processed by different addons. The list of options in the core Windup distribution can be found in Javadoc. Most commonly used command line arguments are:

    --input INPUT_ARCHIVE_OR_FOLDER

    This is the fully qualified application archive or source path.

    -
    --source-mode true (optional)
    -
    -

    This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

    -
    --output OUTPUT_REPORT_DIRECTORY

    The fully qualified path to the folder that will contain the the report information produced by Windup.

    @@ -1362,6 +1358,10 @@

    Run Windup

    Specify this optional argument only if you are certain you want to force Windup to delete the existing OUTPUT_REPORT_DIRECTORY. The default value is false.

    +
    --userRulesDirectory
    +
    +

    Points to a directory to load XML rules from. (Search pattern: *.windup.groovy and *.windup.xml)

    +
    --packages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)

    This is a comma-delimited list of the packages to be evaluated by Windup.

    @@ -1370,6 +1370,10 @@

    Run Windup

    This is a comma-delimited list of the packages to be excluded by Windup.

    +
    --source-mode true (optional)
    +
    +

    This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

    +
  3. @@ -1429,7 +1433,7 @@

    Run Windup

-

Run Windup in Batch Mode

+

2.5.4. Run Windup in Batch Mode

Windup can be also executed in batch mode within a shell or batch script using the --evaluate argument as follows.

@@ -1451,7 +1455,7 @@

Run Windup in Batch Mode

-

Windup Help

+

2.5.5. Windup Help

To see the complete list of available arguments for the windup-migrate-app command, execute the following command in the Windup prompt:

@@ -1462,7 +1466,7 @@

Windup Help

-

Windup Command Examples

+

2.5.6. Windup Command Examples

The following Windup command examples report against applications located in the Windup source test-files directory.

@@ -1512,9 +1516,9 @@
Windup Quickstart Examples
-

Review the Report

+

2.6. Review the Report

-

About the Report

+

2.6.1. About the Report

When you execute Windup, the report is generated in the OUTPUT_REPORT_DIRECTORY you specify for the --output argument in the command line. This output directory contains the following files and subdirectories:

@@ -1547,7 +1551,7 @@

About the Report

-

Open the Report

+

2.6.2. Open the Report

Use your favorite browser to open the index.html file located in the output report directory. You should see something like the following:

@@ -1559,7 +1563,7 @@

Open the Report

-

Report Sections

+

2.6.3. Report Sections

Application Report Page
@@ -1675,7 +1679,7 @@
File Analysis Pages
-

Additional Reports

+

2.6.4. Additional Reports

Explore the Windup OUTPUT_REPORT_DIRECTORY/reports folder to find additional reporting information.

@@ -1708,10 +1712,10 @@
Individual File Analysis Reports
-

Developer Contributing Information

+

3. Developer Contributing Information

-

Development Guidelines and Conventions

+

3.1. Development Guidelines and Conventions

  • @@ -1726,7 +1730,7 @@

    Development Guidelines and C

-

Project Source Code Formatting

+

3.1.1. Project Source Code Formatting

All project source code contributed to Windup should be formatted using the settings defined in the Eclipse_Code_Format_Profile.xml file located in the root directory of the Windup project.

@@ -1769,7 +1773,7 @@
IntelliJ IDEA
-

Source Code Naming Conventions

+

3.1.2. Source Code Naming Conventions

Class Interface and Implementation Names
@@ -1807,7 +1811,7 @@
Standard Prefixes and Suffixes
-

Maven Project Naming Conventions

+

3.1.3. Maven Project Naming Conventions

Maven Module Names
@@ -1827,7 +1831,7 @@
Maven Module Names
-

Submit Code Updates to the Windup Project

+

3.2. Submit Code Updates to the Windup Project

To get the Windup Source Code, see Get the Windup Source Code for instructions.

@@ -1932,10 +1936,10 @@

Submit Code Updates to th

-

Understand the Windup Architecture and Structure

+

4. Understand the Windup Architecture and Structure

-

Windup Architectural Components

+

4.1. Windup Architectural Components

The following open source software, tools, and APIs are used within Windup to analyze and provide migration information. If you plan to @@ -1943,7 +1947,7 @@

Windup Architectural Components

familiar with them.

-

Forge

+

4.1.1. Forge

Forge is an open source, extendable, rapid application development tool for creating Java EE applications using Maven. For more information @@ -1951,7 +1955,7 @@

Forge

-

Forge Furnace

+

4.1.2. Forge Furnace

Forge Furnace is a modular runtime container behind Forge that provides the ability to run Forge add-ons in an embedded application. For more @@ -1960,21 +1964,21 @@

Forge Furnace

-

TinkerPop

+

4.1.3. TinkerPop

TinkerPop is an open source graph computing framework. For more information, see: TinkerPop.

-

Titan

+

4.1.4. Titan

Titan is a scalable graph database optimized for storing and querying graphs. For more information, see: Titan Distributed Graph Database and Titan Beginner’s Guide.

-

Frames

+

4.1.5. Frames

Frames represents graph data in the form of interrelated Java Objects or a collection of annotated Java Interfaces. For more information, see: @@ -1986,7 +1990,7 @@

Frames

-

Gremlin

+

4.1.6. Gremlin

Gremlin is a graph traversal language that allows you to query, analyze, and manipulate property graphs that implement the Blueprints property @@ -1995,7 +1999,7 @@

Gremlin

-

Blueprints

+

4.1.7. Blueprints

Blueprints is an industry standard API used to access graph databases. For more information about Blueprints, see: @@ -2003,7 +2007,7 @@

Blueprints

-

Pipes

+

4.1.8. Pipes

Pipes is a dataflow framework used to process graph data. It for the transformation of data from input to output. For more information, see: @@ -2011,14 +2015,14 @@

Pipes

-

Rexster

+

4.1.9. Rexster

Rexster is a graph server that exposes any Blueprints graph through HTTP/REST and a binary protocol called RexPro. Rexster makes extensive use of Blueprints, Pipes, and Gremlin. For more information, see: TinkerPop Rexster Wiki.

-

OCPsoft Rewrite

+

4.1.10. OCPsoft Rewrite

OCPsoft Rewrite is an open source routing and URL rewriting solution for Servlets, Java Web Frameworks, and Java EE. For more information about @@ -2027,7 +2031,7 @@

OCPsoft Rewrite

-

Windup Project Structure

+

4.2. Windup Project Structure

The Windup 2.0 project consists of the following subprojects.

@@ -2094,10 +2098,10 @@

Windup Project Structure

-

Rules and Rulesets

+

5. Rules and Rulesets

-

Windup Processing Overview

+

5.1. Windup Processing Overview

Windup is a rule-based migration tool that allows you to write customized rules to analyze the APIs, technologies, and architectures used by the applications you plan to migrate. The Windup tool also executes its own core rules through all phases of the migration process.

@@ -2105,7 +2109,7 @@

Windup Processing Overview

The following is a high level conceptual overview of what happens within Windup when you execute the tool against your application or archive.

-

Discovery Phase

+

5.1.1. Discovery Phase

Wnen you run the windup-migrate-app command, Windup executes its own core rules to extract files from archives, decompile classes, and analyze the application. In this phase Windup builds a data model and stores component data and relationships in a graph database, which can then be queried and updated as needed by the migration rules and for reporting purposes.

@@ -2117,7 +2121,7 @@

Discovery Phase

-

Application Migration

+

5.1.2. Application Migration

The next step in the process is the execution of the migration rules. In this phase, the rules typically do not execute against the application input files. Instead, they execute against the graph database model. Windup rules are independent and decoupled and they communicate with each other using the graph database model. Rules query the graph database to obtain information needed to test the rule condition. They also update the data model with information based on the result of the rule execution. This allows rules to easily interact with other rules and enables the creation of very complex rules.

@@ -2126,7 +2130,7 @@

Application Migration

-

Generate Findings Based on the Rule Execution Results

+

5.1.3. Generate Findings Based on the Rule Execution Results

The final step in the process is to pull data from the graph database model to generate of reports and optionally generate scripts. Again, Windup uses rules to generate the final output.

@@ -2152,9 +2156,9 @@

Generate Finding

-

Rule Execution Lifecycle

+

5.2. Rule Execution Lifecycle

-

Rule Lifecycle

+

5.2.1. Rule Lifecycle

Windup executes each rule in a sequential order. The following sections describe the phases of rule execution and how rules may specify @@ -2168,7 +2172,7 @@

Rule Lifecycle

-

Rule Phases

+

5.2.2. Rule Phases

INFO: Loaded [67] org.jboss.windup.config.WindupRuleProvider [
@@ -2268,7 +2272,7 @@ 

Rule Phases

-

Execute Before and Execute After

+

5.2.3. Execute Before and Execute After

A rule may specify that one or more rules must be executed before it is run. In this case, all named rules will be fired in the order specified @@ -2300,9 +2304,9 @@

Execute Before and Execute After

-

Rule Story Points

+

5.3. Rule Story Points

-

What are Story Points?

+

5.3.1. What are Story Points?

Story points are an abstract metric commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. They are based on a modified Fibonacci sequence.

@@ -2311,7 +2315,7 @@

What are Story Points?

-

How Story Points are Estimated in Rules

+

5.3.2. How Story Points are Estimated in Rules

Estimating story points for a rule can be tricky. The following are the general guidelines Windup uses when estimating the level of effort required for a rule.

@@ -2361,9 +2365,9 @@

How Story Points are Estimated

-

Difference Between XML-based and Java-based Rules

+

5.4. Difference Between XML-based and Java-based Rules

-

First of all, to prevent confusion:

+

5.4.1. First of all, to prevent confusion:

  1. @@ -2379,7 +2383,7 @@

    First of all, to prevent confusion:<

-

Which one to choose?

+

5.4.2. Which one to choose?

The XML rules provide a quick, simple way to create rules to analyze Java and XML files. Java rules provide the ability to create very complex rules.

@@ -2398,7 +2402,7 @@

Which one to choose?

-

Pros and cons - XML

+

5.4.3. Pros and cons - XML

Pros:

@@ -2434,7 +2438,7 @@

Pros and cons - XML

-

Pros and Cons - Java

+

5.4.4. Pros and Cons - Java

Pros:

@@ -2472,7 +2476,7 @@

Pros and Cons - Java

-

Examples

+

5.4.5. Examples

Example of a rule written in XML classifying Java code:

@@ -2546,7 +2550,7 @@

Examples

-

Summary

+

5.4.6. Summary

The following is a draft…​ it may go.

@@ -2606,15 +2610,15 @@

Summary

-

Create and Test Java Rule Add-ons

+

6. Create and Test Java Rule Add-ons

-

Install and Configure Maven

+

6.1. Install and Configure Maven

If you plan to contribute to the core code base or create Java-based rule add-ons, you must first install and configure Maven to build Windup from source.

-

Download and Install Maven

+

6.1.1. Download and Install Maven

If you plan to use Eclipse Luna (4.4) to build Windup, you can skip this step and go directly to the section entitled Configure Maven to Build Windup. This version of Eclipse embeds Maven 3.2.1 so you do not need to @@ -2640,7 +2644,7 @@

Download and Install Maven

-

Configure the Maven Installation in Your IDE

+

6.1.2. Configure the Maven Installation in Your IDE

JBoss Developer Studio 7.1.1 is built upon Eclipse Kepler (4.3), which embeds Maven 3.0.4. If you plan to use JBoss Developer Studio 7.1.1 or @@ -2674,7 +2678,7 @@

Configure the Maven Ins

-

Configure Maven to Build Windup

+

6.1.3. Configure Maven to Build Windup

Windup uses artifacts located in the JBoss Nexus @@ -2738,12 +2742,12 @@

Configure Maven to Build Windup

-

Java-based Rule Structure

+

6.2. Java-based Rule Structure

TO_DO: Add a how-to for compound rules, nested rules, rules over multiple sources, negative queries (not matched by anything).

-

Windup Rule Provider

+

6.2.1. Windup Rule Provider

Windup rules are based on OCPsoft Rewrite, an open source routing and URL rewriting solution for Servlets, Java Web Frameworks, and Java EE. The rewrite framework allows you to create rule providers and rules in an easy to read format.

@@ -2795,7 +2799,7 @@

Windup Rule Provider

-

Add Rule Code Structure

+

6.2.2. Add Rule Code Structure

Like most rule-based frameworks, Windup rules consist of the following:

@@ -2828,7 +2832,14 @@
when()

Other way to fill a when part is subclassing the GraphCondition. Actually, Query also implements it, and is only a convenient way to -create a condition.

+create a condition. +You can also use multiple conditions within one when() call using and(). +Example:

+
+
+
+
.when(Query.fromType(XmlMetaFacetModel.class).and(Query...))
+

Last noticable but important feature is the ability to use @@ -2859,7 +2870,7 @@

perform()

For that, various operations are available. These are subclasses of GraphOperation. You can also implement your own. See -Rules-Operations[Rules Operations] for more info. Again, there are +Rules Operations for more information. Again, there are several convenient implementations for constructs like iteration (Iteration).

@@ -2888,7 +2899,22 @@
Iteration
Nested iterations
-

TO_DO: Provide information about nested iterations

+

An iteration is also an operation, so everywhere an operation is expected, you can freely put the Iteration. If the Iteration is put inside the perform method of another Iteration, we speak about nested iterations. +An example of such nested iteration may be:

+
+
+
+
.addRule()
+     .when(...)
+     .perform(
+     Iteration.over("list_variable").as("single_var")
+       .perform(
+         Iteration.over("single_var") //second iteration
+           .perform(...).endIteration()
+     )
+     .endIteration()
+);
+
@@ -2917,7 +2943,18 @@
otherwise
Where
-

TO_DO: Provide information about the where clause

+

The where clause is used to provide information about used parameters within the rule. So for example if you have used a parameter in some condition like for example JavaClass.references("{myMatch}"), you may use the where clause to specify what the myMatch is like .where("myMatch").matches("java.lang.String.toString\(.*\)").

+
+
+
+
.when(JavaClass.references("{myMatch}").at(TypeReferenceLocation.METHOD))
+.perform(...)
+.where("myMatch").matches("java.lang.String.toString\(.*\)")
+
+
+
+

+ +Please note that within the where clause the regex is used in contrast to JavaClass.references() where a windup specific syntax is expected.

@@ -2938,44 +2975,80 @@
Metadata
-

Available utilities

+

6.2.3. Available utilities

For a list of what key services and constructs can be used in the rule, see Available Rules Utilities.

+
+
Variable stack
+
+

The communication between the conditions and operations is done using the variable stack that is filled with the output of the condition/s and then given to the Iteration to be processed. +Within conditions, you can specify the name of the result iterable that is saved in the stack using as() method, the iteration can specify the iterable to iterate over using the over() method and even specify the name of for each processed single model of the result being processed. +Example:

+
+
+
+
.addRule()
+     .when(Query...as("result_list"))
+     .perform(
+     Iteration.over("result_list").as("single_var")
+          ...
+     )
+);
-
-

Basic Rule Execution Flow Patterns

-

TO_DO: Need some links to github to the respective example files.

+

The varstack may be accesed even from the second condition in order to narrow the result of the previous one. After that the iteration may choose which result it wants to iterate over (it is even possible to have multiple iterations listed in the perform, each of which may access different result saved in the variable stack).

+
+
+
+
.addRule()
+     .when(Query...as("result_list").and(Query.from("result_list")....as("second_result_list")))
+     .perform(
+     Iteration.over("second_result_list")
+          ...
+     )
+);
+
+
+
-
-

operation(); - single operation

-
-

When no iteration or condition is needed.

+
+

6.3. Basic Rule Execution Flow Patterns

+
+

6.3.1. Single Operation - operation();

-

Example: [CopyJavaConfigToGraphRuleProvider](rules-java/src/main/java/org/jboss/windup/rules/apps/java/config/CopyJavaConfigToGraphRuleProvider.java)

+

No condition or iteration is needed. The following is an example of a single operation.

-
return ConfigurationBuilder.begin()
+
return ConfigurationBuilder.begin()
     .addRule()
     .perform(new GraphOperation(){
         @Override
         public void perform(GraphRewrite event, EvaluationContext context){
             ...
         }
-    });
+ });
+
+
+ +
+

The copyConfigToGraph GraphOperation used in the perform() above is defined before the rule.

-

if( …​ ){ operation(); } - single conditional operation

+

6.3.2. Single Conditional Operation - if( …​ ){ operation()}

+
+

A single condition must be met. The following is an example of a single conditional operation.

+
-
return ConfigurationBuilder.begin()
+
return ConfigurationBuilder.begin()
     .addRule()
     .when( ... )
     .perform(new GraphOperation(){
@@ -2983,14 +3056,17 @@ 

if( …​ ){ operat public void perform(GraphRewrite event, EvaluationContext context){ ... } - });

+ });
+
-

for( FooModel.class ){ …​ } - Single iteration

+

6.3.3. Single Iteration - for( FooModel.class ){ …​ }

-

For simple iterations, IteratingRuleProvider can be used, which makes the perform a bit less verbose:

+

For simple iterations, you can extend the IteratingRuleProvider class to simplify the perform code.

@@ -3017,9 +3093,12 @@

for( FooModel.class ){ …R }

+
-

if( …​ ){ for( …​ ) } - conditional iteration

+

6.3.4. Conditional Iteration - if( …​ ){ for( …​ ) }

return ConfigurationBuilder.begin()
@@ -3032,12 +3111,15 @@ 

if( …​ ){ for( …​ )

+
-

for( …​ ){ if( …​ ){ …​ } } - iteration with a condition

+

6.3.5. Iteration With a Condition - for( …​ ){ if( …​ ){ …​ } }

-
return ConfigurationBuilder.begin()
+
return ConfigurationBuilder.begin()
 .addRule()
     .when(
         // Stores all ArchiveModel's into variables stack, under that type.
@@ -3056,26 +3138,41 @@ 

for( …​ ){ if( …&# return "ProjectModel == null"; } }) - .perform( ... )

+ .perform( ... )
+
-

for( …​ ){ for( …​ ) { …​ } } - nested iterations

+

6.3.6. Nested Iterations - for( …​ ){ for( …​ ) { …​ } }

-
+
.addRule()
+     .when(...)
+     .perform(Iteration //first iteration
+     .over("list_variable").as("single_var")
+     .perform(
+         Iteration.over("single_var") //second iteration
+         .perform(...).endIteration()
+     )
+     .endIteration()
+);
+
+
-

Create a Basic Java-based Rule Add-on

+

6.4. Create a Basic Java-based Rule Add-on

You can create a rule using Java or XML. This topic describes how to create a rule add-on using Java.

-

Prerequisites

+

6.4.1. Prerequisites

  • @@ -3113,7 +3210,7 @@

    Prerequisites

-

Create a Rule Add-on

+

6.4.2. Create a Rule Add-on

Create a Maven Project
@@ -3394,7 +3491,7 @@
Create the Java RuleProvider
-

Install the Java-based Rule Add-on

+

6.4.3. Install the Java-based Rule Add-on

The easiest and fastest way to build the rule add-on, install it into the local Maven repository, and install it into Windup as a rule add-on is to use the Windup addon-build-and-install command.

@@ -3423,7 +3520,7 @@

Install the Java-based Rule Add-on<

-

Test the Java-based Rule Add-on

+

6.4.4. Test the Java-based Rule Add-on

Test the Java-based rule add-on against your application file by running the windup-migrate-app command in the Windup console prompt.

@@ -3448,7 +3545,7 @@

Test the Java-based Rule Add-on

-

Review the Output Report

+

6.4.5. Review the Output Report

  1. @@ -3520,15 +3617,15 @@

    Review the Output Report

-

Create and Test XML Rules

+

7. Create and Test XML Rules

-

Create a Basic XML Rule

+

7.1. Create a Basic XML Rule

You can create a Windup rule using Java, XML, or Groovy. This topic describes how to create a rule using XML.

-

Prerequisites

+

7.1.1. Prerequisites

  • @@ -3554,13 +3651,13 @@

    Prerequisites

-

File Naming Convention for XML Rules

+

7.1.2. File Naming Convention for XML Rules

You must name the file containing an XML rule with the .windup.xml extension. Windup identifies files with this extension as XML-base rules, so be sure to use this naming convention, otherwise the rule will not be evaluated!

-

Basic XML Rule Template

+

7.1.3. Basic XML Rule Template

XML rules consist of conditions and actions and follow the familiar "if/then/else" construct:

@@ -3600,20 +3697,20 @@

Basic XML Rule Template

-

Create the Rule When Condition

+

7.1.4. Create the Rule When Condition

The syntax is dependent on whether you are creating a rule to evaluate Java class, an XML file, a project, or file content and is described in more detail here: XML Rule - When Condition Syntax

-

Create the Rule Perform Action

+

7.1.5. Create the Rule Perform Action

Operations allowed in the perform section of the rule include the classification of application resources, in-line hints for migration steps, links to migration information, and project lineitem reporting. The syntax is described in detail here: XML Rule - Perform Action Syntax.

-

XML Rule - When Condition Syntax

+

7.2. XML Rule - When Condition Syntax

Conditions allowed in the when portion of a rule must extend GraphOperaton and currently include evaluation of Java classes, XML files, projects, and file content. Because XML rules are modeled after the Java-based rule add-ons, links to JavaDocs for the related Java classes are provided for a better understanding of how they behave.

@@ -3640,7 +3737,7 @@

XML Rule - When Condition Syntax

-

javaclass Syntax

+

7.2.1. javaclass Syntax

Summary
@@ -3729,7 +3826,7 @@
JavaClass Element Child Elements
-

xmlfile Syntax

+

7.2.2. xmlfile Syntax

Summary
@@ -3839,27 +3936,25 @@
xmlfile Element: Child Elements
-

project Syntax

+

7.2.3. project Syntax

Summary
-

Use the project element to find information in project files. For a better understanding of the project condition, see the JavaDoc for the Project class.

+

Use the project element to query for the project charateristics. For a better understanding of the project condition, see the JavaDoc for the Project class.

-

The following is an example of a rule that tests for an xmlfile.

+

The following is an example of a rule that checks a rule is dependent on the junit in the version between 2.0.0.Final and 2.2.0.Final.

<rule>
     <when>
         <project>
-            <artifact groupId="junit" artifactId="junit" from="MyEjbRule" to="???"/>
+            <artifact groupId="junit" artifactId="junit" from="2.0.0.Final" to="2.2.0.Final"/>
         </project>
     </when>
     <perform>
-        <hint title="Title for Hint for Project">
-            <message>Descriptive message</message>
-        </hint>
+        <lineitem message="The project uses junit with the version between 2.0.0.Final and 2.2.0.Final"/>
     </perform>
 </rule>
@@ -3870,7 +3965,7 @@
Construct a project Element
project Element Attributes
-

The project element does not have any attributes.

+

The project element is used to match against the project as a whole. You can use this condition to query for dependencies of the project. It does not have any attributes itself.

@@ -3879,27 +3974,30 @@
project Element Child Elements
artifact
-

The namespace to referenced in XML files. This element contains the following attributes:

+

Subcondition used within project to query against project dependencies. This element contains the following attributes:

  • groupId="PROJECT_GROUP_ID"

    -

    Match on the project <groupId>

    +

    Match on the project <groupId> of the dependency

  • artifactId="PROJECT_ARTIFACT_ID" -Match on the project <artifactId>

    +Match on the project <artifactId> of the dependency

  • -

    from="VARIABLE_NAME"

    +

    fromVersion="FROM_VERSION"

    -

    Begin the search query with the filtered result from a previous search identified by its as VARIABLE_NAME.

    +

    Specify the lower version bound of the artifact. For example 2.0.0.Final

  • -

    to = TO_DO: complete the project artifact 'to' element syntax

    +

    toVersion="TO_VERSION"

    +
    +

    Specify the upper version bound of the artifact. For example 2.2.0.Final

    +
@@ -3910,20 +4008,14 @@
project Element Child Elements
-

filecontent Syntax

-
-

TO_DO: complete the filecontent element syntax

-
-
-

Use the filecontent element to find information in file content.For a better understanding of the filecontent condition, see the JavaDoc for the FileContent class.

-
+

7.2.4. filecontent Syntax

-

Use the filecontent element to test for content within files. The following is an example of a rule that tests for filecontent.

+

Use the filecontent element to find strings or text within files, for example, a line in a Properties file. For a better understanding of the filecontent condition, see the JavaDoc for the FileContent class.

-

XML Rule - Perform Action Syntax

+

7.3. XML Rule - Perform Action Syntax

Operations allowed in the perform section of the rule include the classification of application resources, in-line hints for migration steps, links to migration information, and project lineitem reporting. Because XML rules are modeled after the Java-based rule add-ons, links to JavaDocs for the related Java classes are provided for a better understanding of how they behave.

@@ -3956,7 +4048,7 @@

XML Rule - Perform Action Syntax

-

classification Syntax

+

7.3.1. classification Syntax

Summary
@@ -4042,7 +4134,7 @@
classification Element Child Ele
- +
Summary
@@ -4110,7 +4202,7 @@
-

hint Syntax

+

7.3.3. hint Syntax

Summary
@@ -4196,7 +4288,7 @@
hint Element: Child Elements
-

xslt Syntax

+

7.3.4. xslt Syntax

Summary
@@ -4303,7 +4395,7 @@
xslt Element: Child Elements
-

lineitem Syntax

+

7.3.5. lineitem Syntax

Summary
@@ -4357,7 +4449,7 @@
lineitem Element: Attributes
-

iteration Syntax

+

7.3.6. iteration Syntax

Summary
@@ -4425,24 +4517,27 @@
iteration Element: Child Elements
-

Test an XML Rule in Windup

+

7.4. Test an XML Rule in Windup

-

Add the Rule to Windup

+

7.4.1. Add the Rule to Windup

-

A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations:

+

A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations for files ending with .windup.groovy and .windup.xml:

  • -

    The WINDUP_HOME/rules/ folder.

    +

    The directory specified in the --userRulesDirectory option to the windup-migrate-app.

    +
  • +
  • +

    The WINDUP_HOME/rules/ directory.

    -

    This is the folder where you run the Windup executable. See About the WINDUP_HOME Variable for details.

    +

    WINDUP_HOME is the directory where you run the Windup executable (see here).

  • -

    The ${user.home}/.windup/rules/ folder.

    +

    The ${user.home}/.windup/rules/ directory.

    -

    This folder is created by Windup the first time you execute Windup. It used to track rules and add-ons and to contains the Windup log.

    +

    The ${user.home}/.windup is a directory created by Windup at first run and contains rules, add-ons, and the Windup log.

    @@ -4455,7 +4550,7 @@

    Add the Rule to Windup

    -

    Test the XML Rule

    +

    7.4.2. Test the XML Rule

    1. @@ -4484,7 +4579,7 @@

      Test the XML Rule

    -

    Additional Resources

    +

    7.4.3. Additional Resources

    • @@ -4500,16 +4595,16 @@

      Additional Resources

    -

    Core Developer topics

    +

    8. Core Developer topics

    -

    Windup Bootstrap

    +

    8.1. Windup Bootstrap

    DRAFT

    This section describes how Windup starts up, finds the resources, loads the rules, and executes them.

    -

    Boot

    +

    8.1.1. Boot

    1. @@ -4545,15 +4640,15 @@

      Boot

    -

    GraphContext

    +

    8.1.2. GraphContext

    -

    RuleSubset

    +

    8.1.3. RuleSubset

    -

    Frames creation

    +

    8.1.4. Frames creation

    In the GraphContextImpl constructor. For additonal method Handlers, see

    @@ -4578,7 +4673,7 @@

    Frames creation

    -

    Classloading Notes

    +

    8.2. Classloading Notes

    DRAFT

    Page contains temporary notes, to be edited.

    @@ -4587,7 +4682,7 @@

    Classloading Notes

    This covers the specific situations when the Windup core developer needs to look up certain runtime classes. Does not relate to rules authoring.

    -

    Forge add-ons transitive dependencies

    +

    8.2.1. Forge add-ons transitive dependencies

    Let A depend on B depend on C. Depending on scope of C in B’s POM:

    @@ -4620,7 +4715,7 @@

    Forge add-ons transitive depende

    -

    Finding classes

    +

    8.2.2. Finding classes

    AddonRegistry.getServices(MyServiceInterface.class)
    @@ -4639,19 +4734,19 @@ 

    Finding classes

    -

    Instantiating

    +

    8.2.3. Instantiating

    If you want something from the current add-on, you can simply @Inject the type you wish to use. Alternately you can @Inject an Imported<T> instance, or also @Inject the AddonRegistry itself.

    -

    Which ClassLoader is used? Always the one of the current code?

    +

    8.2.4. Which ClassLoader is used? Always the one of the current code?

    Depends, if you are in a Furnace Service, then yes, it will use the current code’s add-on ClassLoader.

    -

    Reading annotations from classes

    +

    8.2.5. Reading annotations from classes

    Since classes can be proxied by Forge/Furnace, it’s safer to read annotations using Annotations API:

    @@ -4673,7 +4768,7 @@

    Reading annotations from classes

    -

    How do I know if I am in a Furnace service?

    +

    8.2.6. How do I know if I am in a Furnace service?

    Every furnace service is wrapped in a proxy. If it came from another add-on (not your current add-on) and was not instantiated with new Blah(), @@ -4723,7 +4818,7 @@

    How do I know if I am in a

    -

    Resources loading

    +

    8.2.7. Resources loading

    (16:48:30) ozizka-FN: lincolnthree:  Just a note - the potential collisions caused  by add-on's CL span is not considered as a risk?
    @@ -4758,20 +4853,20 @@ 
    Furnace Proxies:
    -

    What classloader is used by Freemarker to load resources?

    +

    8.2.8. What classloader is used by Freemarker to load resources?

    org.jboss.windup.reporting.freemarker.FurnaceFreeMarkerTemplateLoader

    -

    Connect to the Graph via Rexster

    +

    8.3. Connect to the Graph via Rexster

    There is a specific add-on for running Rexster along your graph with groupId org.jboss.windup.rexster and artifactId Rexster.

    -

    Running Rexster Within Your Test

    +

    8.3.1. Running Rexster Within Your Test

    Deploy the Rexster add-on by adding the Rexster add-on to the dependencies.

    @@ -4790,7 +4885,7 @@

    Running Rexster Within Your Test

    -

    Run Rexster within Windup

    +

    8.3.2. Run Rexster within Windup

    Make sure the Rexster add-on is deployed in Furnace and is accessible on http://localhost:8182/.

    @@ -4803,9 +4898,9 @@

    Run Rexster within Windup

    -

    Decompiling

    +

    8.4. Decompiling

    -

    The Decompiler API

    +

    8.4.1. The Decompiler API

    DRAFT
      @@ -4835,7 +4930,7 @@

      The Decompiler API

    -

    Procyon

    +

    8.4.2. Procyon

    Config
    @@ -4887,7 +4982,7 @@
    ITypeLoader
    -

    Dependencies (Forge add-ons)

    +

    8.5. Dependencies (Forge add-ons)

    DRAFT

    Based on @@ -4895,7 +4990,7 @@

    Dependencies (Forge add-ons)

    discussion.

    -

    Maven Add-on Structure

    +

    8.5.1. Maven Add-on Structure

    The following is the typical structure of Maven add-on modules.

    @@ -4945,7 +5040,7 @@

    Maven Add-on Structure

    -

    Add-on sub-parts

    +

    8.5.2. Add-on sub-parts

    Add-on sub-parts declare dependency preferably on forge add-on APIs, not on the add-ons themselves, wherever possible (wherever an add-on has an @@ -5003,7 +5098,7 @@

    Add-on sub-parts

    -

    Test dependencies

    +

    8.5.3. Test dependencies

    For test dependencies on add-ons: Any add-on/sub-part requiring an add-on for testing purposes should use <scope>test</scope>.

    @@ -5021,7 +5116,7 @@

    Test dependencies

    -

    Dependencies between sub-parts within the same add-on

    +

    8.5.4. Dependencies between sub-parts within the same add-on

    Subpart may declare dependency on other subpart. E.g. impl typically depends on api. In that case, the scope should be set appropriately @@ -5039,18 +5134,18 @@

    Dependencies bet

    -

    Frames Extensions

    +

    8.6. Frames Extensions

    Windup has several Frames extensions to satisfy its needs.

    -

    Multiple Types in a Vertex

    +

    8.6.1. Multiple Types in a Vertex

    Frames stores only one type in the type property. To specify multiple types, use the '|' separator. All sub-parts are indexed.

    -

    Map Handler

    +

    8.6.2. Map Handler

    TBD

    @@ -5059,7 +5154,7 @@

    Map Handler

    -

    Map

    +

    8.6.3. Map

    To store a map in as adjacent vertices.

    @@ -5078,7 +5173,7 @@

    Map

    -

    List handler.

    +

    8.6.4. List handler.

    TBD.

    @@ -5088,7 +5183,7 @@

    List handler.

    -

    List

    +

    8.6.5. List

    WindupVertexListModel offers a generic model for lists of other models, which are stored as adjacent vertices.

    @@ -5096,9 +5191,9 @@

    List

    -

    Internal API Features

    +

    8.7. Internal API Features

    -

    Find the RuleProvider that provided a Rule

    +

    8.7.1. Find the RuleProvider that provided a Rule

    A Rule implements Context, which stores metadata. The following example gets the RuleProvider from the Rule context.

    @@ -5113,7 +5208,7 @@

    Find the RuleProvider that

    -

    In-memory Frames

    +

    8.7.2. In-memory Frames

    GraphService<FooModel> fooModelService = context.getService(FooModel.class);
    @@ -5122,7 +5217,7 @@ 

    In-memory Frames

    -

    Performance measurement

    +

    8.7.3. Performance measurement

    ExecutionStatistics.get().begin("Process-01");
    @@ -5136,13 +5231,13 @@ 

    Performance measurement

    -

    Logging

    +

    8.8. Logging

    DRAFT

    This page describes how to log from the Java-based rules.

    -

    Textual logging

    +

    8.8.1. Textual logging

    Windup uses java.util.logging. Convenient way to get the logger is:

    @@ -5153,7 +5248,7 @@

    Textual logging

    -

    Displaying Progress

    +

    8.8.2. Displaying Progress

    IterationProgress

    @@ -5170,13 +5265,13 @@

    Displaying Progress

    -

    Variables Stack

    +

    8.9. Variables Stack

    DRAFT

    The Variables class stores the variables which are available in rules, EL expressions, and FreeMarker and XSLT templates.

    -

    Accessing variables

    +

    8.9.1. Accessing variables

    From a Java-based rule
    @@ -5209,19 +5304,19 @@
    From XSLT template
    -

    Accessing variables as a flat Map

    +

    8.9.2. Accessing variables as a flat Map

    TO_DO: Describe how to access variables from a Map.

    -

    Git Rebasing

    +

    8.10. Git Rebasing

    This section describes a few ways you can pull in the code to rebase to the latest code base.

    -

    Approach Suggested on GitHub

    +

    8.10.1. Approach Suggested on GitHub

    This is the approach suggested on GitHub.

    @@ -5258,7 +5353,7 @@

    Approach Suggested on GitHub

    -

    Script Provided by the Windup Development Team

    +

    8.10.2. Script Provided by the Windup Development Team

    Ondra Zizka wrote the following script to bring down a series of pull requests into a single branch. It then pushes that branch to upstream master-ignore.

    @@ -5313,12 +5408,12 @@

    Script Provided by the

    -

    Rules topics

    +

    9. Rules topics

    -

    Available Rule Utilities

    +

    9.1. Available Rule Utilities

    -

    Programmatically Access the Graph

    +

    9.1.1. Programmatically Access the Graph

    Note: Needs update. This is out of date!

    @@ -5412,7 +5507,7 @@
    Nested Iteration
    -

    Modify Graph Data

    +

    9.1.2. Modify Graph Data

    For more custom operations dealing with Graph data that are not covered by the Query mechanism, use the GraphService.

    @@ -5442,7 +5537,7 @@

    Modify Graph Data

    -

    Concepts & Philosophy

    +

    9.2. Concepts & Philosophy

    TO_DO: - OZIZKA: Can this topic be marked obsolete and be replaced by this one: Windup Processing Overview ?_

    @@ -5458,7 +5553,7 @@

    Concepts & Philosophy

    database.

    -

    Graph database and Models (Frames)

    +

    9.2.1. Graph database and Models (Frames)

    As a graph db implementation, we use TinkerPop backed by Titan backed by @@ -5480,7 +5575,7 @@

    Graph database and Models (Frames)

    -

    Examples of breaking non-trivial workflows into rules

    +

    9.2.2. Examples of breaking non-trivial workflows into rules

    1. @@ -5500,7 +5595,7 @@

      Examples of brea

    -

    Creating Rule Operations

    +

    9.3. Creating Rule Operations

    An operation is a task which can be invoked from within a rule.

    @@ -5514,7 +5609,6 @@

    Creating Rule Operations

    @Override public void perform(GraphRewrite event, EvaluationContext context) { - ... } }
    @@ -5528,7 +5622,7 @@

    Creating Rule Operations

    -

    Rulesets

    +

    9.4. Rulesets

    DRAFT

    @@ -5536,7 +5630,7 @@

    Rulesets

    Example page for design decisions. Could be generated automatically in the future.

    -

    What is a Ruleset?

    +

    9.4.1. What is a Ruleset?

    A ruleset is a Windup "plug-in" targetting a specific area of migration (e.g. Spring to Java EE 6 migration). Underhood, it is a set of rules, and everything they might need: Operations and Conditions, Report templates (if needed), and static files (e.g. images, XML or CSV files, etc.). A ruleset may also declare metadata, like ruleset ID, dependencies on other rulesets, etc.

    @@ -5553,7 +5647,7 @@

    What is a Ruleset?

    -

    Basic tags

    +

    9.4.2. Basic tags

    • @@ -5576,7 +5670,7 @@

      Basic tags

    -

    Rulesets

    +

    9.4.3. Rulesets

    Core rulesets
    @@ -5630,7 +5724,7 @@
    Community rulesets
    -

    Java Basic Ruleset

    +

    9.5. Java Basic Ruleset

    DRAFT

    This is an example page. Content serves for design decision.

    @@ -5639,14 +5733,14 @@

    Java Basic Ruleset

    Purpose of this ruleset.

    -

    Metadata

    +

    9.5.1. Metadata

    ID: myRuleset Graph prefix: myRuleset

    -

    Rule providers

    +

    9.5.2. Rule providers

    A definition list (dl/dt/dd) of RuleProviders of given Ruleset.

    @@ -5671,7 +5765,7 @@

    Rule providers

    -

    Models

    +

    9.5.3. Models

    • @@ -5774,7 +5868,7 @@

      Models

    -

    Configuration

    +

    9.5.4. Configuration

    • @@ -5784,18 +5878,18 @@

      Configuration

    -

    Reports

    +

    9.5.5. Reports

    -

    Ruleset Java Classifications and Inline Hints

    +

    9.6. Ruleset Java Classifications and Inline Hints

    DRAFT

    Some of the most important rules are classifications and inline hints.

    -

    Classifications

    +

    9.6.1. Classifications

    Classifications are important because they tell developers very quickly what the resource is, so that they can quickly identify resources of @@ -5821,7 +5915,7 @@

    Classifications

    -

    Inline Hints

    +

    9.6.2. Inline Hints

    Windup takes the approach of profiling resources and providing syntactically highlighted resource reports. The resource report will @@ -5835,7 +5929,7 @@

    Inline Hints

    -

    Ruleset Java EE Apps

    +

    9.7. Ruleset Java EE Apps

    DRAFT

    TBD?

    @@ -5846,14 +5940,14 @@

    Ruleset Java EE Apps

    -

    Ruleset Reporting

    +

    9.8. Ruleset Reporting

    DRAFT

    TBD?

    -

    XML Ruleset

    +

    9.9. XML Ruleset

    DRAFT
      @@ -5869,14 +5963,14 @@

      XML Ruleset

      A core ruleset to provide support for XML files.

    -

    Metadata

    +

    9.9.1. Metadata

    ID: xml Graph prefix: xml

    -

    Rule providers

    +

    9.9.2. Rule providers

    A definition list (dl/dt/dd) of RuleProviders of given Ruleset with brief descriptions.

    @@ -5943,7 +6037,7 @@

    Rule providers

    -

    Models

    +

    9.9.3. Models

    _Subclasses of WindupVertexFrame.

    @@ -5965,20 +6059,20 @@

    Models

    -

    Configuration

    +

    9.9.4. Configuration

    _Subclasses of TO_DO

    -

    Reports

    +

    9.9.5. Reports

    Report files or report parts created by this ruleset.

    -

    Windup Models

    +

    9.10. Windup Models

    Windup models are the classes extending WindupVertexFrame. They are used to model the data in the graph database to Java objects.

    @@ -5991,7 +6085,7 @@

    Windup Models

    Windup Models Graphic

    -

    Meta Models

    +

    9.10.1. Meta Models

    • @@ -6004,26 +6098,26 @@

      Meta Models

    -

    Core Models

    +

    9.10.2. Core Models

    FileModel ArchiveModel

    -

    Reporting Models

    +

    9.10.3. Reporting Models

    -

    Custom Models (coming from Addons)

    +

    9.10.4. Custom Models (coming from add-ons)

    See respective ruleset’s documentation.

    -

    Create Java Queries

    +

    9.11. Create Java Queries

    -

    Query for all frames of some Model

    +

    9.11.1. Query for all frames of some Model

    Query.find(FileModel.class).as("result")
    @@ -6031,7 +6125,7 @@

    Query for all frames of some Model<

    -

    Query by property

    +

    9.11.2. Query by property

    Query.find(FileModel.class)
    @@ -6041,7 +6135,7 @@ 

    Query by property

    -

    Gremlin query

    +

    9.11.3. Gremlin query

    code,java
    @@ -6056,7 +6150,7 @@ 

    Gremlin query

    -

    Custom query

    +

    9.11.4. Custom query

    The Query API is just a convenience implementation. For a custom query, implement your own GraphCondition:

    @@ -6075,16 +6169,16 @@

    Custom query

    -

    Rules Metadata

    +

    9.12. Rules Metadata

    -

    Overview

    +

    9.12.1. Overview

    Draft

    Rules metadata are used for ordering, filtering, debugging and performance reasons.

    -

    Metadata used by Windup

    +

    9.12.2. Metadata used by Windup

    To control ordering, override getExecuteAfter() and getExecuteBefore().

    @@ -6138,7 +6232,7 @@

    Metadata used by Windup

    -

    How to define rule metadata

    +

    9.12.3. How to define rule metadata

    The RuleMetadata is defined using the .withMetadata(Object key, Object value).

    @@ -6179,7 +6273,7 @@
    Why a Map?
    -

    Ruleset metadata

    +

    9.12.4. Ruleset metadata

    Ruleset metadata cover the whole Ruleset, not individual rules. For ruleset metadata, unlike rules, Windup uses a type-safe interface WindupRulesetMetadata @@ -6191,7 +6285,7 @@

    Ruleset metadata

    -

    Rules Operations

    +

    9.13. Rules Operations

    A list of high-level operations across rulesets.

    @@ -6234,7 +6328,7 @@

    Rules Operations

    -

    Ops Reporting TypeReference

    +

    9.14. Ops Reporting TypeReference

    TBD

    @@ -6249,12 +6343,12 @@

    Ops Reporting TypeReference

    -

    Debugging and Troubleshooting

    +

    10. Debugging and Troubleshooting

    -

    Debugging and Profiling

    +

    10.1. Debugging and Profiling

    -

    Debug the Windup Distribution Runtime

    +

    10.1.1. Debug the Windup Distribution Runtime

    You can debug the Windup distribution using one of the following approaches.

    @@ -6281,13 +6375,13 @@

    Debug the Windup Distribution Ru

    -

    Debug a Test Using NetBeans

    +

    10.1.2. Debug a Test Using NetBeans

    Click the Debug Test File button, or choose MenuDebugDebug Test File.

    -

    Profile a Test Using NetBeans

    +

    10.1.3. Profile a Test Using NetBeans

    1. @@ -6329,7 +6423,7 @@

      Profile a Test Using NetBeans

    -

    Profile Forge Runtime Using YourKit

    +

    10.1.4. Profile Forge Runtime Using YourKit

    1. @@ -6361,9 +6455,9 @@

      Profile Forge Runtime Using YourKi

    -

    Troubleshoot Windup Issues

    +

    10.2. Troubleshoot Windup Issues

    -

    Logging

    +

    10.2.1. Logging

    Logging is currently broken and will not be fixed any time soon.

    @@ -6372,7 +6466,7 @@

    Logging

    -

    Debugging Exceptions

    +

    10.2.2. Debugging Exceptions

    Exceptions in Surefire reports are broken due to the way Forge wraps exceptions and the way Surefire handles them. You need to @@ -6383,7 +6477,7 @@

    Debugging Exceptions

    -

    Classloading Problems

    +

    10.2.3. Classloading Problems

    Configuring dependencies in a Forge-based project can be a little tricky. See Dependencies for some hints.

    @@ -6402,18 +6496,18 @@

    Classloading Problems

    -

    Wiki Information

    +

    11. Wiki Information

    -

    About the Windup Wiki

    +

    11.1. About the Windup Wiki

    -

    Purpose

    +

    11.1.1. Purpose

    This wiki is a place to create Windup documentation in a collaborative manner, a bit wildly, and on the fly. It is intended to reflect the state of the Windup source code master branch, however pages may become obsolete as the master changes quickly.

    -

    Areas of Interest

    +

    11.1.2. Areas of Interest

    The Wiki pages are divided into the following main areas of interest, which may often overlap. The page names use these prefixes:

    @@ -6435,13 +6529,13 @@

    Areas of Interest

    -

    Markdown, AsciiDoc, or…​?

    +

    11.1.3. Markdown, AsciiDoc, or…​?

    This Wiki uses AsciiDoc because it is capable of handling the publishing requirements and structural elements needed to create technical books. If you would like to contribute to the documentation, feel free to use your favorite Wiki language, however, it will ultimately be converted to AsciiDoc.

    -

    Contributor Guidelines

    +

    11.1.4. Contributor Guidelines

    Please see the Contributing Guidelines for details about how to name pages and use the correct AsciiDoc syntax to make the transition to the final documentation go more smoothly.

    @@ -6499,7 +6593,7 @@

    Contributor Guidelines

    -

    Add Images to the Windup Wiki

    +

    11.2. Add Images to the Windup Wiki

    • @@ -6565,19 +6659,26 @@

      Add Images to the Windup Wiki

  • -

    Test the new image in a page on your own Wiki.

    +

    Test the new image in a page on your own Wiki. Don’t forget to add the :imagesdir: images directive to the beginning of the page to point to the images directory.

    -
    image:images/IMAGE_NAME.png[New Image]
    +
    image:IMAGE_NAME.png[New Image]

    For example:

    -

    Windup Logo

    +

    ==== My Image

  • +
+
+
+

Windup Logo

+
+
+
  • If it works, push the image to the upstream repository

    @@ -6592,10 +6693,10 @@

    Add Images to the Windup Wiki

-

Windup Product Release and Documentation Process

+

12. Windup Product Release and Documentation Process

-

Windup Release Process

+

12.1. Windup Release Process

Windup consists of artifacts from multiple GitHub repositories. Use the following procedure to create a Windup release.

@@ -6622,7 +6723,7 @@

Windup Release Process

-

Create Windup JavaDoc

+

12.2. Create Windup JavaDoc

The most recent Windup JavaDoc build is located here: http://windup.github.io/windup/docs/javadoc/latest/index.html

@@ -6658,9 +6759,9 @@

Create Windup JavaDoc

-

Windup Documentation Process

+

12.3. Windup Documentation Process

-

Wiki Documentation

+

12.3.1. Wiki Documentation

  • @@ -6673,7 +6774,7 @@

    Wiki Documentation

-

Product Documentation

+

12.3.2. Product Documentation

Windup product documentation is stored here: https://github.com/windup/windup-documentation

@@ -6682,7 +6783,7 @@

Product Documentation

-

Update the Windup Documentation with the Latest Wiki Changes

+

12.3.3. Update the Windup Documentation with the Latest Wiki Changes

Summary
@@ -6782,7 +6883,7 @@
Documentation Update Scripts
-

Publish the HTML Docs for Access at GitHub IO

+

12.3.4. Publish the HTML Docs for Access at GitHub IO

The https://github.com/windup/windup-documentation/tree/master/scripts/windupPublish.sh script copies the pages from the Windup wiki to the windup-documentation repository, makes minor modifications, and generates each guide in a single HTML page book format. The resulting guides are created in the WINDUP_DOCUMENTATION_HOME/html/ directory.

@@ -6930,10 +7031,10 @@

Publish the HTML Docs fo

-

Additional Resources

+

13. Additional Resources

-

Review the Windup Quickstarts

+

13.1. Review the Windup Quickstarts

The Windup quickstarts provide working examples of how to create custom Java-based rule add-ons and XML rules. You can use them as a starting point for creating your own custom rules. The quickstarts are available on GitHub here: https://github.com/windup/windup-quickstarts

@@ -6941,7 +7042,7 @@

Review the Windup Quickstarts

You can fork and clone the project to have access to regular updates or you can download a ZIP file of the latest version.

-

Download the Latest ZIP

+

13.1.1. Download the Latest ZIP

To download the latest quickstart ZIP file, browse to: https://github.com/windup/windup-quickstarts/releases

@@ -6950,7 +7051,7 @@

Download the Latest ZIP

-

Fork and Clone the GitHub Project

+

13.1.2. Fork and Clone the GitHub Project

If you don’t have the GitHub client (git), download it from: http://git-scm.com/

@@ -6996,9 +7097,9 @@

Fork and Clone the GitHub Project

-

Get Involved

+

13.2. Get Involved

-

How can you help?

+

13.2.1. How can you help?

To help us make Windup cover most application constructs and server configurations, including yours, you can help with any of the following items. Some items require only a few minutes of your time!

@@ -7065,7 +7166,7 @@

How can you help?

- +
  • @@ -7116,18 +7217,18 @@
-

Known Windup Issues

+

13.3. Known Windup Issues

Windup known issues are tracked here: Open Windup issues

-

Report Issues with Windup

+

13.4. Report Issues with Windup

Windup uses JIRA as its issue tracking system. If you encounter an issue executing Windup, please file a Windup JIRA Issue.

-

Create a JIRA Account

+

13.4.1. Create a JIRA Account

If you do not yet have a JIRA account, create one using the following procedure.

@@ -7149,7 +7250,7 @@

Create a JIRA Account

-

Create a JIRA Issue

+

13.4.2. Create a JIRA Issue

  1. @@ -7210,12 +7311,12 @@

    Create a JIRA Issue

-

Appendix

+

14. Appendix

-

Glossary of Terms Used in Windup

+

14.1. Glossary of Terms Used in Windup

-

Rules Terms

+

14.1.1. Rules Terms

Rule
@@ -7278,7 +7379,7 @@

Rules Terms

-

Reporting Terms

+

14.1.2. Reporting Terms

Lift and Shift (Level of effort)
@@ -7302,9 +7403,9 @@

Reporting Terms

-

Windup Project Information

+

14.2. Windup Project Information

-

Github Repository

+

14.2.1. Github Repository

The Windup project github repository is located at https://github.com/windup/windup/.

@@ -7313,7 +7414,7 @@

Github Repository

-

Documentation

+

14.2.2. Documentation

The Windup documentation is currently located here in the Windup project Wiki.

@@ -7322,7 +7423,7 @@

Documentation

-

Website

+

14.2.3. Website

There is currently no website for Windup 2.0.

@@ -7332,14 +7433,14 @@

Website

-

IRC chat

+

14.2.4. IRC chat

Server: irc.freenode.net
Channel: #windup

-

Mailing lists

+

14.2.5. Mailing lists

Subscribe to the JBoss mailing lists at https://lists.jboss.org/mailman/listinfo/windup-dev.

@@ -7356,7 +7457,7 @@

Mailing lists

-

Core development team (and IRC nicks)

+

14.2.6. Core development team (and IRC nicks)

Lead: Lincoln Baxter (lincolnthree)
Members: Jess Sightler (jsightler), Matej Briskar (mbriskar), Ondrej @@ -7364,7 +7465,7 @@

Core development team (and IRC nic

-

IRC meeting bot commands (hint for the moderator)

+

14.2.7. IRC meeting bot commands (hint for the moderator)

#startmeeting
@@ -7384,7 +7485,7 @@ 

IRC meeting bot comman

diff --git a/html/WindupRulesDevelopmentGuide-NO-TOC.html b/html/WindupRulesDevelopmentGuide-NO-TOC.html new file mode 100644 index 0000000000..d028a448d9 --- /dev/null +++ b/html/WindupRulesDevelopmentGuide-NO-TOC.html @@ -0,0 +1,4483 @@ + + + + + + + +Windup Rules Development Guide + + + + + +
+
+

1. Overview

+
+
+

This guide is for engineers, consultants, and others who plan to create +custom rules for Windup 2.0.

+
+
+

Windup Logo

+
+
+
+

1.1. What is Windup?

+
+

JBoss Windup is a rule-based tool to simplify application migrations.

+
+
+

Running from a Forge environment, the tool examines EAR, WAR, and +JAR deployments (or a project source directory) and produces an HTML report detailing the inner workings of +the Java application to simplify migration efforts. It seeks to make +migrating from other containers to JBoss EAP a piece of cake.

+
+
+

1.1.1. Windup 2.0 vs. Windup 0.7.x

+
+

Windup 2.0 aims to deliver the same functionality as legacy Windup, however, the internal architecture and rule structure is very different and allows for the creation of much more complex rules.

+
+
+
+

1.1.2. How Does Windup Simplify Migration?

+
+

Windup looks for common resources and highlight technologies and known “trouble +spots” in migrating applications. The goal of Windup is to provide a +high level view into relevant technologies in use within the +application, and provide a consumable report for organizations to +estimate, document, and migrate enterprise applications to Java EE and JBoss EAP.

+
+
+

These are some of the of the areas targetted by current core Windup rulesets:

+
+
++++ + + + + + + + + + + + + + + + + + + + + +
RulesetDescription

Java code

Reads compiled Java files, determines if blacklisted classes are imported, and if so, continues to profile the resource.

JSP code

Reads JSP files, extracts the JSP imports and taglibs, and continues to +profile the resource

XML configuration

Reads XML files into a DOM objects and continues to profile the resource.

+
+
+

1.1.3. Follow Windup on Twitter!

+
+

Follow Windup on Twitter @JBossWindup for updates and more!

+
+
+
+
+

1.2. Features of Windup 2.0

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Shared Data Model + +

Windup 2.0 creates a shared data model graph that provides the following benefits.

+
+
    +
  • +

    It enables complex rule interaction, allowing rules to pass findings to other rules.

    +
  • +
  • +

    It enables 3rd-party plug-ins to interact with other plugins, rules and reports.

    +
  • +
  • +

    The data graph organizes the findings to be searchable and queryable.

    +
  • +
+
+
+Extensibility + +

Windup 2.0 can be extended by developers, users, and 3rd-parties.

+
+
    +
  • +

    It provides a plug-in API to inject other applications into Windup.

    +
  • +
  • +

    It enables 3rd-parties to create simple POJO plug-ins that can interact with the data graph.

    +
  • +
  • +

    Means we don’t have to invent everything. Users with domain knowledge can implement their own rules.

    +
  • +
+
+
+Better Rules + +

Windup 2.0 provides more powerful and complex rules.

+
+
    +
  • +

    XML-based rules are simple to write and and easy to implement.

    +
  • +
  • +

    Java-based rule add-ons are based on OCPsoft Rewrite and provide greater flexibility and power creating when rules.

    +
  • +
  • +

    Rules can now be nested to handle more complex situations. This means you can nest simple statements rather than use complex XPATH or REGEX expressions. +*Rules can be linked using and/or statements

    +
  • +
+
+
+Automation + +

Windup 2.0 has the ability to automate some of the migration processes.

+
+
    +
  • +

    Windup is integrated with Forge 2.0, meaning it can generate projects, libraries, and configuration files.

    +
  • +
  • +

    Rules can create Forge inputs and put them into the data graph.

    +
  • +
  • +

    During the automation phase, the data graph inputs can be processed to generate a new project.

    +
  • +
+
+
+Work Estimation + +

Estimates for the level of effort is based on the skills required and the classification of migration work needed.

+
+
    +
  • +

    Lift and Shift - The code or file is standards-based and can be ported to the new environment with no changes.

    +
  • +
  • +

    Mapped - There is a standard mapping algorithm to port the code or file to the new environment.

    +
  • +
  • +

    Custom – The code or file must be rewritten or modified to work in the new environment.

    +
  • +
+
+
+Better Reporting + +

Windup 2.0 reports are now targeted for specific audiences.

+
+
    +
  • +

    IT Management - Applications are ranked by cost of migration.

    +
  • +
  • +

    Project Management - Reports detail the type of work and estimation of effort to complete the tasks.

    +
  • +
  • +

    Developers - An Eclipse plug-in provides hints and suggested code changes within the IDE.

    +
  • +
+
+
+
+
+
+

1.3. About the WINDUP_HOME Variable

+
+

This documentation uses the WINDUP_HOME replaceable value to denote the path to the Windup distribution. When you encounter this value in the documentation, be sure to replace it with the actual path to your Windup installation.

+
+
+
    +
  • +

    If you download and install the latest distribution of Windup from the JBoss Nexus repository, WINDUP_HOME refers to the windup-distribution-2.0.0.VERSION folder extracted from the downloaded ZIP file.

    +
  • +
  • +

    If you build Windup from GitHub source, WINDUP_HOME refers to the windup-distribution-2.0.0-VERSION folder extracted from the Windup source dist/target/windup-distribution-2.0.0-VERSION.zip file.

    +
  • +
+
+
+
+
+
+

2. Get Started

+
+
+

2.1. Install Windup

+
+

2.1.1. Minimum System Requirements

+
+
    +
  • +

    Java Platform, Enterprise Edition 7

    +
  • +
  • +

    A minimum of 4 GB RAM. For better performance, a 4-core processor with 8 GB RAM is recommended. This allows 3 - 4 GB RAM for use by the JVM.

    +
  • +
  • +

    A minimum of 4 GB of free disk space. A fast disk, especially a Solid State Drive (SSD), will improve performance.

    +
  • +
  • +

    Windup is tested on Linux (Fedora), Mac OS X, and Windows. Other Operating Systems with Java 7 support should work equally well.

    +
  • +
+
+
+
+

2.1.2. Download and Install Windup

+
+
    +
  1. +

    Download the latest Windup ZIP distribution.

    +
  2. +
  3. +

    Extract the ZIP file in to a directory of your choice.

    +
  4. +
+
+
+ + + + + +
+
Note
+
+If you used previous versions of Windup, delete the ${user.home}/.windup/ directory. Otherwise you may see errors like the following when you execute Windup: + Command: windup-migrate-app was not found +
+
+
+
+
+

2.2. Execute Windup

+
+

2.2.1. Prerequisites

+
+

Before you begin, you must gather the following information.

+
+
+
    +
  1. +

    The fully qualified path of the application archive or folder you plan to migrate.

    +
  2. +
  3. +

    The fully qualified path to a folder that will contain the resulting report information.

    +
    +
      +
    • +

      If the folder does not exist, it is created by Windup.

      +
    • +
    • +

      If the folder exists, you are prompted with the message:

      +
      +
      +
      Overwrite all contents of <OUTPUT_DIRECTORY> (anything already in the directory will be deleted)? [y/N]
      +
      +
      +
      +

      Choose "y" if you want Windup to delete and recreate the directory.

      +
      +
    • +
    • +

      If you are confident you want to overwrite the output directory, you can specify --overwrite on the command line to automatically delete and recreate the directory.

      +
      + + + + + +
      +
      Note
      +
      +Be careful not to specify a directory that contains important information! +
      +
      +
    • +
    +
    +
  4. +
  5. +

    You must also provide a list of the application packages to be evaluated.

    +
    +
      +
    • +

      In most cases, you are interested only in evaluating the custom application class packages and not the standard Java EE or 3rd party packages. For example, if the MyCustomApp application uses the package com.mycustomapp, you provide that package using the --packages argument on the command line. It is not necessary to provide the standard Java EE packages, like java.util or javax.ejb.

      +
    • +
    • +

      While you can provide package names for standard Java EE 3rd party software like org.apache, it is usually best not to include them as they should not impact the migration effort.

      +
    • +
    • +

      If you omit the --packages argument, every package in the application is scanned, resulting in very slow performance. It is best to provide the argument with one or more packages.

      +
    • +
    +
    +
  6. +
+
+
+
+

2.2.2. Start Windup

+
+

For information about the use of WINDUP_HOME in the instructions below, see About the WINDUP_HOME Variable.

+
+
+
    +
  1. +

    Open a terminal and navigate to the WINDUP_HOME/bin directory

    +
  2. +
  3. +

    Type the following command to start Windup:

    +
    +
    +
    For Linux:    WINDUP_HOME/bin $ ./windup
    +For Windows:  C:\WINDUP_HOME\bin> windup
    +
    +
    +
  4. +
  5. +

    You are presented with the following prompt.

    +
    +
    +
    Using Windup at WINDUP_HOME
    +
    + _       ___           __
    +| |     / (_)___  ____/ /_  ______
    +| | /| / / / __ \/ __  / / / / __ \
    +| |/ |/ / / / / / /_/ / /_/ / /_/ /
    +|__/|__/_/_/ /_/\__,_/\__,_/ .___/
    +                          /_/
    +
    +JBoss Windup, version [ 2.0.0-VERSION ] - JBoss, by Red Hat, Inc. [ http://windup.jboss.org ]
    +
    +[windup-distribution-2.0.0-VERSION]$
    +
    +
    +
  6. +
+
+
+
+

2.2.3. Run Windup

+
+
    +
  1. +

    The command to run Windup is windup-migrate-app.

    +
  2. +
  3. +

    This command can take arbitrary options processed by different addons. The list of options in the core Windup distribution can be found in Javadoc. Most commonly used command line arguments are:

    +
    +
    +
    --input INPUT_ARCHIVE_OR_FOLDER
    +
    +

    This is the fully qualified application archive or source path.

    +
    +
    --output OUTPUT_REPORT_DIRECTORY
    +
    +

    The fully qualified path to the folder that will contain the the report information produced by Windup.

    +
    + + + + + +
    +
    Note
    +
    +If the OUTPUT_REPORT_DIRECTORY directory exists and you do not specify the --overwrite argument, you are prompted to overwrite the contents. If you respond "y", it is deleted and recreated by Windup, so be careful not to specify an output directory that contains important information! +
    +
    +
    +
    --overwrite (optional)
    +
    +

    Specify this optional argument only if you are certain you want to force Windup to delete the existing OUTPUT_REPORT_DIRECTORY. The default value is false.

    +
    +
    --userRulesDirectory
    +
    +

    Points to a directory to load XML rules from. (Search pattern: *.windup.groovy and *.windup.xml)

    +
    +
    --packages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)
    +
    +

    This is a comma-delimited list of the packages to be evaluated by Windup.

    +
    +
    --excludePackages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)
    +
    +

    This is a comma-delimited list of the packages to be excluded by Windup.

    +
    +
    --source-mode true (optional)
    +
    +

    This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

    +
    +
    +
    +
  4. +
  5. +

    To evaluate an application archive, use the following syntax:

    +
    +
    +
    windup-migrate-app --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
    +
    +
    +
    +

    To run Windup against application source code, you must add the --sourceMode true argument:

    +
    +
    +
    +
    windup-migrate-app --sourceMode true --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
    +
    +
    +
    +

    See Windup Command Examples below for concrete examples of commands that use source code directories and archives located in the Windup GitHub repository.

    +
    +
  6. +
  7. +

    You should see the following result upon completion of the command:

    +
    +
    +
    ***SUCCESS*** Windup execution successful!
    +
    +
    +
  8. +
  9. +

    To exit Windup, type:

    +
    +
    +
    exit
    +
    +
    +
  10. +
  11. +

    Open the OUTPUT_REPORT_DIRECTORY/index.html file in a browser to access the report. +The following subdirectories in the OUTPUT_REPORT_DIRECTORY contain the supporting information for the report:

    +
    +
    +
    OUTPUT_REPORT_DIRECTORY/
    +    graph/
    +    renderedGraph/
    +    reports/
    +    stats/
    +    index.html
    +
    +
    +
  12. +
  13. +

    For details on how to evaluate the report data, see Review the Report.

    +
  14. +
+
+
+
+

2.2.4. Run Windup in Batch Mode

+
+

Windup can be also executed in batch mode within a shell or batch script using the --evaluate argument as follows.

+
+
+
    +
  1. +

    Open a terminal and navigate to the WINDUP_HOME directory.

    +
  2. +
  3. +

    Type the following command to run Windup in batch mode:

    +
    +
    +
    For Linux:     $ bin/windup --evaluate "windup-migrate-app --input INPUT_ARCHIVE --output OUTPUT_REPORT --packages PACKAGE_1 PACKAGE_2 PACKAGE_N"
    +For Windows:   > bin\windup.bat --evaluate "windup-migrate-app --input INPUT_ARCHIVE --output OUTPUT_REPORT --packages PACKAGE_1 PACKAGE_2 PACKAGE_N"
    +
    +
    +
  4. +
+
+
+
+

2.2.5. Windup Help

+
+

To see the complete list of available arguments for the windup-migrate-app command, execute the following command in the Windup prompt:

+
+
+
+
man windup-migrate-app
+
+
+
+
+

2.2.6. Windup Command Examples

+
+

The following Windup command examples report against applications located in the Windup source test-files directory.

+
+
+
Source Code Example
+
+

The following command runs against the seam-booking-5.2 application source code. It evaluates all org.jboss.seam packages and creates a folder named 'seam-booking-report' in the /home/username/windup-reports/ directory to contain the reporting output.

+
+
+
+
windup-migrate-app --sourceMode true --input /home/username/windup-source/test-files/seam-booking-5.2/ --output /home/username/windup-reports/seam-booking-report --packages org.jboss.seam
+
+
+
+
+
Archive Example
+
+

The following command runs against the jee-example-app-1.0.0.ear EAR archive. It evaluates all com.acme and org.apache packages and creates a folder named 'jee-example-app-1.0.0.ear-report' in the /home/username/windup-reports/ directory to contain the reporting output.

+
+
+
+
windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache
+
+
+
+
+
Windup Batch Example
+
+

The following Windup batch command runs against the jee-example-app-1.0.0.ear EAR archive. It evaluates all com.acme and org.apache packages and creates a folder named 'jee-example-app-1.0.0.ear-report' in the /home/username/windup-reports/ directory to contain the reporting output.

+
+
+
+
For Linux: $ bin/windup --evaluate "windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache"
+For Windows: > bin\windup.bat --evaluate "windup-migrate-app --input \windup-source\test-files\jee-example-app-1.0.0.ear --output \windup-reports\jee-example-app-1.0.0.ear-report --packages com.acme org.apache
+
+
+
+
+
Windup Quickstart Examples
+
+

For more concrete examples, see the Windup quickstarts located on GitHub here: https://github.com/windup/windup-quickstarts. If you prefer, you can download the 2.0.0.Alpha1 release ZIP or TAR distribution of the quickstarts.

+
+
+

The quickstarts provide examples of Java-based and XML-based rules you can run and test using Windup. The README instructions provide a step-by-step guide to run the quickstart example. You can also look through the code examples and use them as a starting point for creating your own rules.

+
+
+
+
+
+

2.3. Review the Report

+
+

2.3.1. About the Report

+
+

When you execute Windup, the report is generated in the OUTPUT_REPORT_DIRECTORY you specify for the --output argument in the command line. This output directory contains the following files and subdirectories:

+
+
+
    +
  • +

    index.html: This is the landing page for the report.

    +
  • +
  • +

    archives/: Contains the archives extracted from the application

    +
  • +
  • +

    graph/: Contains binary graph database files

    +
  • +
  • +

    reports/: This directory contains the generated HTML report files

    +
  • +
  • +

    stats/: Contains Windup performance statistics

    +
  • +
+
+
+

The examples below use the test-files/jee-example-app-1.0.0.ear located in the Windup GitHub source repository for input and specify the com.acme and org.apache package name prefixes to scan. For example:

+
+
+
+
windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache
+
+
+
+
+

2.3.2. Open the Report

+
+

Use your favorite browser to open the index.html file located in the output report directory. You should see something like the following:

+
+
+

Report Index Page

+
+
+

Click on the link under the Name column to view the Windup application report page.

+
+
+
+

2.3.3. Report Sections

+
+
Application Report Page
+
+

The first section of the application report page summarizes the migration effort. It provides the total Story Points and a graphically displays the effort by technology. A Story Point is a term commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

+
+
+
    +
  • +

    The migration of the JEE Example App EAR is assigned a total of 42 story points. A pie chart shows the breakdown of story points by package.

    +
  • +
  • +

    This is followed by a section for each of the archives contained in the EAR. It provides the total of the story points assigned to the archive and lists the files contained in archive along with the warnings and story point assigned to each file.

    +
  • +
+
+
+

The following is an example of a Windup Application Report.

+
+
+

Report Summary Page

+
+
+
+
Archive Analysis Sections
+
+

Each archive summary begins with a total of the story points assigned to its migration, followed by a table detailing the changes required for each file in the archive. The report contains the following columns.

+
+
+
+
Name
+
+

The name of the file being analyzed

+
+
Technology
+
+

The type of file being analyzed. For example:

+
+
    +
  • +

    Java Source

    +
  • +
  • +

    Decompiled Java File

    +
  • +
  • +

    Manifest

    +
  • +
  • +

    Properties

    +
  • +
  • +

    EJB XML

    +
  • +
  • +

    Spring XML

    +
  • +
  • +

    Web XML

    +
  • +
  • +

    Hibernate Cfg

    +
  • +
  • +

    Hibernate Mapping

    +
  • +
+
+
+
Issues
+
+

Warnings about areas of code that need review or changes.

+
+
Estimated Story Points
+
+

Level of effort required for migrating the file.

+
+
+
+
+

The following is an example of the archive analysis summary section of a Windup Report. In this example, it’s the analysis of the WINDUP_SOURCE/test-files/jee-example-app-1.0.0.ear/jee-example-services.jar.

+
+
+

Report Archive Page

+
+
+
+
File Analysis Pages
+
+

The analysis of the jee-example-services.jar lists the files in the JAR and the warnings and story points assigned to each one. Notice the com.acme.anvil.listener.AnvilWebLifecycleListener file has 5 warnings and is assigned 7 story points. Click on the file to see the detail.

+
+
+
    +
  • +

    The Information section provides a summary of the story points and notes that the file was decompiled by Windup.

    +
  • +
  • +

    This is followed by the file source code listing. Warnings appear in the file at the point where migration is required.

    +
  • +
+
+
+

In this example, warnings appear at the import of weblogic.application.ApplicationLifecycleEvent and report that the class is proprietary to WebLogic and must be removed.

+
+
+

File Detail - Part 1

+
+
+

Later in the code, warnings appear for the creation of the InitialContext and for the object name when registering and unregistering an MBeans

+
+
+

File Detail - Part 2

+
+
+
+
+

2.3.4. Additional Reports

+
+

Explore the Windup OUTPUT_REPORT_DIRECTORY/reports folder to find additional reporting information.

+
+
+
Rule Provider Execution Report
+
+

The OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html page provides the list of rule providers that executed when running the Windup migration command against the application.

+
+
+

RuleProvider Report

+
+
+
+
Rule Provider Execution Report
+
+

The OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html page provides the list of rule providers that executed when running the Windup migration command against the application.

+
+
+
+
Individual File Analysis Reports
+
+

You can directly access the the file analysis report pages described above by browsing for them by name in the OUTPUT_REPORT_DIRECTORY/reports/ directory. Because the same common file names can exist in multiple archives, for example "manifest.mf" or "web.xml", Windup adds a unique numeric suffix to each report file name.

+
+
+

Report Directory File List

+
+
+
+
+
+
+
+

3. Understand the Rule Processing

+
+
+

3.1. Windup Processing Overview

+
+

Windup is a rule-based migration tool that allows you to write customized rules to analyze the APIs, technologies, and architectures used by the applications you plan to migrate. The Windup tool also executes its own core rules through all phases of the migration process.

+
+
+

The following is a high level conceptual overview of what happens within Windup when you execute the tool against your application or archive.

+
+
+

3.1.1. Discovery Phase

+
+

Wnen you run the windup-migrate-app command, Windup executes its own core rules to extract files from archives, decompile classes, and analyze the application. In this phase Windup builds a data model and stores component data and relationships in a graph database, which can then be queried and updated as needed by the migration rules and for reporting purposes.

+
+
+

For more information about the phases of rule execution and how to control rule dependencies, see Rule Execution Lifecycle.

+
+
+

For more information about the graph database components, see Windup Architectural Components.

+
+
+
+

3.1.2. Application Migration

+
+

The next step in the process is the execution of the migration rules. In this phase, the rules typically do not execute against the application input files. Instead, they execute against the graph database model. Windup rules are independent and decoupled and they communicate with each other using the graph database model. Rules query the graph database to obtain information needed to test the rule condition. They also update the data model with information based on the result of the rule execution. This allows rules to easily interact with other rules and enables the creation of very complex rules.

+
+
+

The Windup distribution contains a large number of migration rules, but in some cases, you may need to create additional custom rules for your specific implementation. Windup’s architecture allows you to create Java-based rule addons or XML rules and add easily add them to Windup. Custom rule creation is covered in the Windup Rules Development Guide.

+
+
+
+

3.1.3. Generate Findings Based on the Rule Execution Results

+
+

The final step in the process is to pull data from the graph database model to generate of reports and optionally generate scripts. Again, Windup uses rules to generate the final output.

+
+
+

By default, Windup generates the following reports at the end of the application migration process. The reports are located in the reports/ subdirectory of the output report path specified when you execute Windup:

+
+
+
    +
  • +

    Application Report: This report provides a summary of the total estimated effort, or story points, that are required for the migration. It also provides a detailed list of issues and suggested changes, broken down by archive or folder.

    +
  • +
  • +

    RuleProvider report: This is a detailed listing of the rule providers that fired when running Windup and whether any errors occurred.

    +
  • +
  • +

    Additional reports are generated that provide detailed line-by-line migration tips for individual files.

    +
  • +
+
+
+

Windup can also generate scripts to automate migration processes based on the findings. For example, some configuration files are easily mapped and can be automatically generated as part of the migration process.

+
+
+
+
+

3.2. Rule Execution Lifecycle

+
+

3.2.1. Rule Lifecycle

+
+

Windup executes each rule in a sequential order. The following +sections describe the phases of rule execution and how rules may specify +that one or more other rules must be executed before or after they are +run.

+
+
+

For a graphical overview of rule processing, see +this +diagram.

+
+
+
+

3.2.2. Rule Phases

+
+
+
INFO: Loaded [67] org.jboss.windup.config.WindupRuleProvider [
+org.jboss.windup.config.phase.Implicit
+org.jboss.windup.config.phase.Initialization
+org.jboss.windup.config.phase.Discovery
+org.jboss.windup.config.phase.ArchiveExtraction
+org.jboss.windup.config.phase.ArchiveMetadataExtraction
+org.jboss.windup.config.phase.ClassifyFileTypes
+org.jboss.windup.config.phase.DiscoverProjectStructure
+org.jboss.windup.config.phase.Decompilation
+org.jboss.windup.config.phase.InitialAnalysis
+org.jboss.windup.config.phase.MigrationRules
+org.jboss.windup.config.phase.PostMigrationRules
+org.jboss.windup.config.phase.PreReportGeneration
+org.jboss.windup.config.phase.ReportGeneration
+org.jboss.windup.config.phase.PostReportGeneration
+org.jboss.windup.config.phase.ReportRendering
+org.jboss.windup.config.phase.PostReportRendering
+org.jboss.windup.config.phase.Finalize
+org.jboss.windup.config.phase.PostFinalize
+]
+
+
+
+

By default, a rule runs during the MIGRATION_RULES phase. However, a +rule may require certain processing or actions to occur before it +executes, such as the extraction of archives and scanning of java or XML +files.

+
+
+

Rule phases provide a way for rule authors to specify and control in +which phase of the rule lifecycle the rule should execute. This is done +by overriding the WindupRuleProvider.getPhase() method. The following +example specifies this rule should execute during the INITIAL_ANALYSIS rule phase.

+
+
+
+
@Override
+public RulePhase getPhase() {
+    return InitialAnalysis.class;
+}
+
+
+
+

The following is the list of rule phases as defined in the RulePhase +enum class. Note that there are also PRE_ processing and POST_ +processing phases for each of the following rule phases.

+
+
+
+
DISCOVERY
+
+

This phase is called during resource discovery. Static files are scanned +by their basic properties, for example, the name, extension, location, +and fully qualified Java class name. Archives are unzipped in this +phase. Typically, any rule that only puts data into the graph is +executed during this phase.

+
+
INITIAL_ANALYSIS
+
+

This phase is called to perform a basic analysis of the files content. +It extracts all method names from class files, extracts metadata, such +as the XML namespace and root element, from XML files.

+
+
COMPOSITION
+
+

This phase is called to perform high-level composition operations on the +graph. For example, it may link items found in XML files to the related +Java classes or references to server resources in Java classes.

+
+
MIGRATION_RULES
+
+

This phase is the default phase for all rules unless overridden. +During this phase, migration rules attach data to the graph associated +with migration. This could include: - Hints to migrators for manual +migration - Automated migration of schemas or source segments - +Blacklists to indicate vendor specific APIs.

+
+
REPORT_GENERATION
+
+

During this phase, reporting visitors produce report data in the graph +that will later be used by the report rendering phase.

+
+
REPORT_RENDERING
+
+

This is the phase that renders the report.

+
+
FINALIZE
+
+

This phase is called to clean up resources and close streams.

+
+
+
+
+

For more information about rule phases, see the RulePhase Javadoc.

+
+
+
+

3.2.3. Execute Before and Execute After

+
+

A rule may specify that one or more rules must be executed before it is +run. In this case, all named rules will be fired in the order specified +before executing the the current rule.

+
+
+
+
@Override
+public List<Class<? extends WindupRuleProvider>> getExecuteBefore()
+{
+   return asClassList(RuleToFireBefore.class);
+}
+
+
+
+

A rule may also specify that one or more rules must be executed after it +is run. In this case, all named rules will be fired in the order +specified after executing the the current rule.

+
+
+
+
@Override
+public List<Class<? extends WindupRuleProvider>> getExecuteAfter()
+{
+    return asClassList(RuleToFireAfter.class);
+}
+
+
+
+
+
+

3.3. Rule Story Points

+
+

3.3.1. What are Story Points?

+
+

Story points are an abstract metric commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. They are based on a modified Fibonacci sequence.

+
+
+

In a similar manner, Windup uses story points to express the level of effort needed to migrate particular application constructs, and in a sum, the application as a whole. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

+
+
+
+

3.3.2. How Story Points are Estimated in Rules

+
+

Estimating story points for a rule can be tricky. The following are the general guidelines Windup uses when estimating the level of effort required for a rule.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Level of EffortStory PointsDescription

Lift and Shift

0

The code or file is standards-based and requires no effort.

Mapped

1- 2 per file

There is a standard mapping algorithm to port the code or file. The number of story points required is small, but is dependent on the number of files to port.

Custom

5 - 20 per change or component

+

The number of story points required to modify and rewrite code depends on the complexity of the change, the number of unknown imports, the size of the files, and the number of components. The following are examples of how to estimate story points.

+
+
+
    +
  • +

    Port MyBatis to JPA: '20' story points per query.

    +
  • +
  • +

    Port a web page from one web framework to another depends on the complexity and the number of components involved in the migration. You could estimate '20' story points per component.

    +
  • +
+
+
+
+
+

3.4. Difference Between XML-based and Java-based Rules

+
+

3.4.1. First of all, to prevent confusion:

+
+
    +
  1. +

    Rules can be written using XML or the Java API. We call them XML-based and Java-based Rules.

    +
  2. +
  3. +

    Independent of the syntax, the rules may inspect (classify) XML or Java code.

    +
  4. +
+
+
+

See the examples below.

+
+
+
+

3.4.2. Which one to choose?

+
+

The XML rules provide a quick, simple way to create rules to analyze Java and XML files. Java rules provide the ability to create very complex rules.

+
+
+
    +
  • +

    If you simply need to highlight a specific section of Java code or XML file content and provide hints for it, it is recommended that you create the rule using XML.

    +
  • +
  • +

    If you need to create a new custom report, you need to create the reporting rules using Java.

    +
  • +
  • +

    If you need to extend functionality beyond what the XML rules provide, you need to create the rule using Java.

    +
  • +
+
+
+
+

3.4.3. Pros and cons - XML

+
+

Pros:

+
+
+
    +
  • +

    XML rules are fairly easy to write and require less code.

    +
  • +
  • +

    You do not need to configure Maven to build from source because there is no need for compilation of +XML rules.

    +
  • +
  • +

    Deployment is simple. You simply drop the XML rule into the appropriate path and Windup automatically scans the new rule.

    +
  • +
+
+
+

Cons:

+
+
+
    +
  • +

    XML rules only support a simple subset of conditions and operations.

    +
  • +
  • +

    XML rules do not provide for direct custom graph data manipulation.

    +
  • +
  • +

    XML rules do not support the ability to create custom reports.

    +
  • +
+
+
+
+

3.4.4. Pros and Cons - Java

+
+

Pros:

+
+
+
    +
  • +

    Java rule add-ons allow you to write custom rules and provide a lot of flexibility.

    +
  • +
  • +

    You can set breakpoints and test Java rule add-ons using a debugger.

    +
  • +
  • +

    IDEs provide code completion for the Windup API.

    +
  • +
+
+
+

Cons:

+
+
+
    +
  • +

    You must configure Maven to compile the Windup Java rule add-ons.

    +
  • +
  • +

    Java rule add-ons that are not included in the Windup core code base must be a full Forge add-on.

    +
  • +
  • +

    Java rule add-ons require writing a lot of Java code/

    +
  • +
  • +

    Writing Java rule add-ons are complex and required knowledge of Windup internals.

    +
  • +
+
+
+
+

3.4.5. Examples

+
+

Example of a rule written in XML classifying Java code:

+
+
+
+
<?xml version="1.0"?>
+<ruleset xmlns="http://windup.jboss.org/v1/xml" id="EjbRules">
+    <rules>
+        <rule id="EjbRules_2fmb">
+            <when>
+                <javaclass references="javax.persistence.Entity" as="default">
+                    <location>TYPE</location>
+                </javaclass>
+            </when>
+            <perform>
+                <iteration>
+                    <classification classification="JPA Entity" effort="0"/>
+                </iteration>
+            </perform>
+        </rule>
+    </rules>
+</ruleset>
+
+
+
+

Example of a rule written in Java classifying Java code:

+
+
+
+
/**
+ * Scans for classes with EJB related annotations, and adds EJB related metadata for these.
+ */
+public class DiscoverEjbAnnotationsRuleProvider extends WindupRuleProvider
+{
+    @Override
+    public Configuration getConfiguration(GraphContext context) {
+        return ConfigurationBuilder.begin()
+        .addRule()
+        .when(JavaClass.references("javax.ejb.{annotationType}").at(TypeReferenceLocation.ANNOTATION))
+        .perform(new AbstractIterationOperation<JavaTypeReferenceModel>()
+        {
+            public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload)
+            {
+                extractEJBMetadata(event, payload);
+            };
+        })
+        .where("annotationType").matches("Stateless|Stateful")
+        .withId(ruleIDPrefix + "_StatelessAndStatefulRule")
+        .addRule()
+        .when(JavaClass.references("javax.ejb.MessageDriven").at(TypeReferenceLocation.ANNOTATION))
+        .perform(new AbstractIterationOperation<JavaTypeReferenceModel>() {
+            @Override
+            public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) {
+                extractMessageDrivenMetadata(event, payload);
+            }
+        })
+        .withId(ruleIDPrefix + "_MessageDrivenRule")
+        .addRule()
+        .when(JavaClass.references("javax.persistence.Entity").at(TypeReferenceLocation.ANNOTATION).as(ENTITY_ANNOTATIONS)
+                    .or(JavaClass.references("javax.persistence.Table").at(TypeReferenceLocation.ANNOTATION).as(TABLE_ANNOTATIONS_LIST)))
+        .perform(Iteration.over(ENTITY_ANNOTATIONS).perform(new AbstractIterationOperation<JavaTypeReferenceModel>() {
+            @Override public void perform(GraphRewrite event, EvaluationContext context, JavaTypeReferenceModel payload) {
+                extractEntityBeanMetadata(event, payload);
+            }
+        }).endIteration())
+        .withId(ruleIDPrefix + "_EntityBeanRule");
+    }
+    ...
+}
+
+
+
+
+

3.4.6. Summary

+
+

The following is a draft…​ it may go.

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RequirementXML RuleJava Rule Add-on

Easy to write?

Yes

Depends on the complexity of the rule

Requires that you configure Maven?

No

Yes

Requires that you compile the rule?

No

Yes

Simple deployment?

No

Yes

Supports custom reports?

No

Yes

Ability to create complex conditions and operations?

No

Yes

Ability to directly manipulate the graph data?

No

Yes

+
+
+
+
+
+

4. Create and Test Java Rule Addons

+
+
+

4.1. Install and Configure Maven

+
+

If you plan to contribute to the core code base or create Java-based rule add-ons, you must first install and configure Maven to build Windup from source.

+
+
+

4.1.1. Download and Install Maven

+
+

If you plan to use Eclipse Luna (4.4) to build Windup, you can skip this +step and go directly to the section entitled Configure Maven to Build Windup. This version of Eclipse embeds Maven 3.2.1 so you do not need to +install it separately.

+
+
+

If you plan to run Maven using the command line or plan to use Red Hat +JBoss Developer Studio 7.1.1 or an older version of Eclipse, you must +install Maven 3.1.1. or later.

+
+
+
    +
  1. +

    Go to Apache Maven Project - +Download Maven and download the latest distribution for your operating +system.

    +
  2. +
  3. +

    See the Maven documentation for information on how to download and +install Apache Maven for your operating system.

    +
  4. +
+
+
+
+

4.1.2. Configure the Maven Installation in Your IDE

+
+

JBoss Developer Studio 7.1.1 is built upon Eclipse Kepler (4.3), which +embeds Maven 3.0.4. If you plan to use JBoss Developer Studio 7.1.1 or +an Eclipse version earier than Eclipse Luna (4.4), you must replace the +embedded 3.0.4 version of Maven with this newer version.

+
+
+
    +
  1. +

    From the menu, choose Window -→ Preferences.

    +
  2. +
  3. +

    Expand Maven and click on Installations.

    +
  4. +
  5. +

    Uncheck Embedded (3.0.4/1.4.0.20130531-2315)

    +
  6. +
  7. +

    Click Add and navigate to your Maven install directory. Select it +and click OK.

    +
  8. +
  9. +

    Make sure the new external Maven installation is checked and click +OK to return to JBoss Developer Studio.

    +
  10. +
+
+
+

Note: If you use another IDE, refer to the product documentation to +update the Maven installation.

+
+
+
+

4.1.3. Configure Maven to Build Windup

+
+

Windup uses artifacts located in the +JBoss Nexus +repository. You must configure Maven to use this repository before you +build Windup.

+
+
+
    +
  1. +

    Open your ${user.home}/.m2/settings.xml file for editing.

    +
  2. +
  3. +

    Copy the following jboss-nexus-repository profile XML prior to the +ending </profiles> element.

    +
    +
    +
    <profile>
    +  <id>jboss-nexus-repository</id>
    +  <repositories>
    +    <repository>
    +      <id>jboss-nexus-repository</id>
    +      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    +      <releases>
    +        <enabled>true</enabled>
    +      </releases>
    +      <snapshots>
    +        <enabled>true</enabled>
    +      </snapshots>
    +    </repository>
    +  </repositories>
    +  <pluginRepositories>
    +    <pluginRepository>
    +      <id>jboss-nexus-plugin-repository</id>
    +      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    +      <releases>
    +        <enabled>true</enabled>
    +      </releases>
    +      <snapshots>
    +        <enabled>true</enabled>
    +      </snapshots>
    +    </pluginRepository>
    +  </pluginRepositories>
    +</profile>
    +
    +
    +
  4. +
  5. +

    Copy the following XML prior to the ending </activeprofiles> +element to make the profile active.

    +
    +
    +
    <activeProfile>jboss-nexus-repository</activeProfile>
    +
    +
    +
  6. +
+
+
+

You are now configured to build Windup.

+
+
+
+
+

4.2. Java-based Rule Structure

+
+

TO_DO: Add a how-to for compound rules, nested rules, rules over multiple sources, negative queries (not matched by anything).

+
+
+

4.2.1. Windup Rule Provider

+
+

Windup rules are based on OCPsoft Rewrite, an open source routing and URL rewriting solution for Servlets, Java Web Frameworks, and Java EE. The rewrite framework allows you to create rule providers and rules in an easy to read format.

+
+
+

Windup rule add-ons must extend the WindupRuleProvider class.

+
+
+
    +
  • +

    If the rule should run in a phase other than the default MIGRATION_PHASE, you must implement the getPhase() method and specify in which Windup lifecycle phase the rule should be executed. For more information about rule phases, see Rule Execution Lifecycle.

    +
  • +
  • +

    Rules are added using the getConfiguration(GraphContext context) method. This method is inherited from the OCPsoft Rewrite interface org.ocpsoft.rewrite.config.ConfigurationProvider. Rules are discussed in more detail later.

    +
  • +
  • +

    If other rules must execute after or before the rules in this provider, you must provide the list of WindupRuleProvider classes using the getExecuteAfter() or getExecuteAfter() methods.

    +
  • +
+
+
+

The following is an example of a simple Java-based rule add-on.

+
+
+
+
public class ExampleRuleProvider extends WindupRuleProvider
+{
+    @Override public RulePhase getPhase(){
+        return RulePhase.DISCOVERY;
+    }
+
+    // @formatter:off
+    @Override
+    public Configuration getConfiguration(GraphContext context)
+    {
+        return ConfigurationBuilder.begin()
+        .addRule()
+        .when(
+            // Some implementation of GraphCondition.
+            Query.find(...)....
+        )
+       .perform(
+            ...
+       );
+    }
+    // @formatter:on
+    // (@formatter:off/on prevents Eclipse from formatting the rules.)
+}
+
+
+
+
+

4.2.2. Add Rule Code Structure

+
+

Like most rule-based frameworks, Windup rules consist of the following:

+
+
+
    +
  • +

    Condition: This is the when(condition) that determines if the rule should execute.

    +
  • +
  • +

    Operation: This defines what to perform() if the condition is met.

    +
  • +
+
+
+

Rules consist of the when part, the perform, the otherwise part, +and some others, all of which are optional.

+
+
+
when()
+
+
+
.when(Query.fromType(XmlMetaFacetModel.class))
+
+
+
+

In the .when() part, the rule typically queries the graph, using the +Query API. Results of the query are put on variables stack +(Variables), many times indirectly through the querying API.

+
+
+

Other way to fill a when part is subclassing the GraphCondition. +Actually, Query also implements it, and is only a convenient way to +create a condition. +You can also use multiple conditions within one when() call using and(). +Example:

+
+
+
+
.when(Query.fromType(XmlMetaFacetModel.class).and(Query...))
+
+
+
+

Last noticable but important feature is the ability to use +Gremlin queries. See +Gremlin docs for reference manual.

+
+
+
+
perform()
+
+
+
.perform(
+   new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml")
+   {
+      public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel model)
+      {
+         // for each model, do something
+      }
+   }
+)
+
+
+
+

In the .perform() part, the rule typically iterates over the items of interest +(Java files, XML files, querying services, …​), processes them, and +writes the findings into the graph.

+
+
+

For that, various operations are available. These are subclasses of +GraphOperation. You can also implement your own. See +Rules Operations for more information. Again, there are +several convenient implementations for constructs like iteration +(Iteration).

+
+
+
Iteration
+
+
+
.perform(
+    Iteration.over(XmlMetaFacetModel.class, "xmlModels").as("xml")
+    .when(...)
+    .perform(
+        new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml"){
+            public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel xmlFacetModel)
+            {
+            }
+        })
+    .otherwise(
+        new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml"){
+            public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel payload)
+                { ... }
+        })
+    .endIteration()
+
+
+
+
+
Nested iterations
+
+

An iteration is also an operation, so everywhere an operation is expected, you can freely put the Iteration. If the Iteration is put inside the perform method of another Iteration, we speak about nested iterations. +An example of such nested iteration may be:

+
+
+
+
.addRule()
+     .when(...)
+     .perform(
+     Iteration.over("list_variable").as("single_var")
+       .perform(
+         Iteration.over("single_var") //second iteration
+           .perform(...).endIteration()
+     )
+     .endIteration()
+);
+
+
+
+
+
otherwise
+
+

Windup rules inherit the rule constructs from OCP Rewrite. For example, +.otherwise() Gives you a chance to perform something in case the +conditions in .when() return false (e.g. they do not match anything). +For more information, see OCP Rewrite web.

+
+
+
+
.otherwise(
+   new AbstractIterationOperation<XmlMetaFacetModel>(XmlMetaFacetModel.class, "xml")
+   {
+      public void perform(GraphRewrite event, EvaluationContext context, XmlMetaFacetModel model)
+      {
+         // for each model, do something altenate
+      }
+   }
+)
+
+
+
+
+
+
Where
+
+

The where clause is used to provide information about used parameters within the rule. So for example if you have used a parameter in some condition like for example JavaClass.references("{myMatch}"), you may use the where clause to specify what the myMatch is like .where("myMatch").matches("java.lang.String.toString\(.*\)").

+
+
+
+
.when(JavaClass.references("{myMatch}").at(TypeReferenceLocation.METHOD))
+.perform(...)
+.where("myMatch").matches("java.lang.String.toString\(.*\)")
+
+
+
+

+ +Please note that within the where clause the regex is used in contrast to JavaClass.references() where a windup specific syntax is expected.

+
+
+
+
Metadata
+
+

Rules can specify metadata. Currently, the only appearing in some rules, +and not actually used, is RuleMetadata.CATEGORY.

+
+
+
+
.withMetadata(RuleMetadata.CATEGORY, "Basic")
+
+
+
+

.withMetadata() is basically putting key/value to a +Map<Object, Object>.

+
+
+
+
+

4.2.3. Available utilities

+
+

For a list of what key services and constructs can be used in the rule, +see Available Rules Utilities.

+
+
+
Variable stack
+
+

The communication between the conditions and operations is done using the variable stack that is filled with the output of the condition/s and then given to the Iteration to be processed. +Within conditions, you can specify the name of the result iterable that is saved in the stack using as() method, the iteration can specify the iterable to iterate over using the over() method and even specify the name of for each processed single model of the result being processed. +Example:

+
+
+
+
.addRule()
+     .when(Query...as("result_list"))
+     .perform(
+     Iteration.over("result_list").as("single_var")
+          ...
+     )
+);
+
+
+
+

The varstack may be accesed even from the second condition in order to narrow the result of the previous one. After that the iteration may choose which result it wants to iterate over (it is even possible to have multiple iterations listed in the perform, each of which may access different result saved in the variable stack).

+
+
+
+
.addRule()
+     .when(Query...as("result_list").and(Query.from("result_list")....as("second_result_list")))
+     .perform(
+     Iteration.over("second_result_list")
+          ...
+     )
+);
+
+
+
+
+
+
+

4.3. Basic Rule Execution Flow Patterns

+
+

4.3.1. Single Operation - operation();

+
+

No condition or iteration is needed. The following is an example of a single operation.

+
+
+
+
return ConfigurationBuilder.begin()
+    .addRule()
+    .perform(new GraphOperation(){
+        @Override
+        public void perform(GraphRewrite event, EvaluationContext context){
+            ...
+        }
+    });
+
+
+ +
+

The copyConfigToGraph GraphOperation used in the perform() above is defined before the rule.

+
+
+
+

4.3.2. Single Conditional Operation - if( …​ ){ operation()}

+
+

A single condition must be met. The following is an example of a single conditional operation.

+
+
+
+
return ConfigurationBuilder.begin()
+    .addRule()
+    .when( ... )
+    .perform(new GraphOperation(){
+        @Override
+        public void perform(GraphRewrite event, EvaluationContext context){
+            ...
+        }
+    });
+
+
+ +
+
+

4.3.3. Single Iteration - for( FooModel.class ){ …​ }

+
+

For simple iterations, you can extend the IteratingRuleProvider class to simplify the perform code.

+
+
+
+
public class ComputeArchivesSHA512 extends IteratingRuleProvider<ArchiveModel>
+{
+    public ConditionBuilder when() {
+        return Query.find(ArchiveModel.class);
+    }
+
+    // @formatter:off
+    public void perform( GraphRewrite event, EvaluationContext context, ArchiveModel archive ){
+        try( InputStream is = archive.asInputStream() ){
+            String hash = DigestUtils.sha512Hex(is);
+            archive.asVertex().setProperty(KEY_SHA512, hash);
+        }
+        catch( IOException e ){
+            throw new WindupException("Failed to read archive: " + archive.getFilePath() +
+                "\n    Due to: " + e.getMessage(), e);
+        }
+    }
+    // @formatter:on
+
+    @Override public String toStringPerform() { return this.getClass().getSimpleName(); }
+}
+
+
+ +
+
+

4.3.4. Conditional Iteration - if( …​ ){ for( …​ ) }

+
+
+
return ConfigurationBuilder.begin()
+    .addRule()
+    .when(
+        new GraphCondition(){ ... }
+    ).perform(
+        Iteration.over(ArchiveModel.class)
+            .perform( ... )
+    )
+
+
+ +
+
+

4.3.5. Iteration With a Condition - for( …​ ){ if( …​ ){ …​ } }

+
+
+
return ConfigurationBuilder.begin()
+.addRule()
+    .when(
+        // Stores all ArchiveModel's into variables stack, under that type.
+        Query.find(ArchiveModel.class)
+    ).perform(
+        Iteration.over(ArchiveModel.class) // Picks up ArchiveModel's from the varstack.
+            .when(new AbstractIterationFilter<ArchiveModel>(){
+                @Override
+                public boolean evaluate(GraphRewrite event, EvaluationContext context, ArchiveModel payload)
+                {
+                    return payload.getProjectModel() == null;
+                }
+                @Override
+                public String toString()
+                {
+                    return "ProjectModel == null";
+                }
+            })
+            .perform( ... )
+
+
+ +
+
+

4.3.6. Nested Iterations - for( …​ ){ for( …​ ) { …​ } }

+
+
+
.addRule()
+     .when(...)
+     .perform(Iteration //first iteration
+     .over("list_variable").as("single_var")
+     .perform(
+         Iteration.over("single_var") //second iteration
+         .perform(...).endIteration()
+     )
+     .endIteration()
+);
+
+
+ +
+
+
+

4.4. Create a Basic Java-based Rule Add-on

+
+

You can create a rule using Java or XML. This topic describes how to create a rule add-on using Java.

+
+
+

4.4.1. Prerequisites

+
+ +
+
+ + + + + +
+
Note
+
+Working examples of Java-based rules can be found in the Windup quickstarts GitHub repository located here: https://github.com/windup/windup-quickstarts +
+
+
+
+

4.4.2. Create a Rule Add-on

+
+
Create a Maven Project
+
+

Create a new Maven Java Project. These instructions will refer to the project folder location with the replaceable variable 'RULE_PROJECT_HOME'. Modify the project pom.xml file as follows

+
+
+
    +
  1. +

    Add the following properties:

    +
    +
    +
    <properties>
    +    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    +    <maven.compiler.source>1.7</maven.compiler.source>
    +    <maven.compiler.target>1.7</maven.compiler.target>
    +    <version.windup>2.0.0.VERSION</version.windup>
    +    <version.forge>2.12.1.Final</version.forge>
    +</properties>
    +
    +
    +
  2. +
  3. +

    Add a dependency management section for the Windup BOM.

    +
    +
    +
    <dependencyManagement>
    +    <dependencies>
    +        <!-- Windup BOM -->
    +        <dependency>
    +            <groupId>org.jboss.windup</groupId>
    +            <artifactId>windup-bom</artifactId>
    +            <version>${version.windup}</version>
    +            <type>pom</type>
    +               <scope>import</scope>
    +         </dependency>
    +    </dependencies>
    +</dependencyManagement>
    +
    +
    +
  4. +
  5. +

    Add a <dependencies> section to include Windup, rulesets, and test dependencies required by your rule add-on. Windup is a Forge/Furnace based application and has a modular design, so the dependencies will vary depending on the Windup APIs used by the rule. For more information on Windup dependencies, see Windup Dependencies.

    +
    +

    The following are examples of some dependencies you may need for your rule add-on.

    +
    +
    +
    +
    <!-- Windup API dependencies -->
    +<dependency>
    +    <groupId>org.jboss.windup.graph</groupId>
    +    <artifactId>windup-graph</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.config</groupId>
    +    <artifactId>windup-config</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.ext</groupId>
    +    <artifactId>windup-config-groovy</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.utils</groupId>
    +    <artifactId>utils</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.windup.reporting</groupId>
    +    <artifactId>windup-reporting</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +
    +<!-- Dependencies on other rulesets -->
    +<dependency>
    +    <groupId>org.jboss.windup.rules.apps</groupId>
    +    <artifactId>rules-java</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.container</groupId>
    +    <artifactId>cdi-api</artifactId>
    +    <scope>provided</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.container</groupId>
    +    <artifactId>cdi</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>provided</scope>
    +</dependency>
    +
    +<!-- Test dependencies -->
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.test</groupId>
    +    <artifactId>furnace-test-harness</artifactId>
    +    <scope>test</scope>
    +</dependency>
    +<dependency>
    +    <groupId>org.jboss.forge.furnace.test</groupId>
    +    <artifactId>arquillian-furnace-classpath</artifactId>
    +    <scope>test</scope>
    +</dependency>
    +<dependency>
    +    <groupId>junit</groupId>
    +    <artifactId>junit</artifactId>
    +    <version>4.11</version>
    +    <type>jar</type>
    +</dependency>
    +
    +<dependency>
    +    <groupId>org.jboss.windup.exec</groupId>
    +    <artifactId>windup-exec</artifactId>
    +    <classifier>forge-addon</classifier>
    +    <scope>test</scope>
    +</dependency>
    +
    +
    +
  6. +
  7. +

    Add the <plugins> section to make it a Forge add-on.

    +
    +
    +
    <plugins>
    +    <!-- The following plugins make this artifact a Forge add-on. -->
    +    <plugin>
    +        <groupId>org.jboss.forge.furnace</groupId>
    +        <artifactId>furnace-maven-plugin</artifactId>
    +        <version>${version.forge}</version>
    +        <executions>
    +            <execution>
    +                <id>generate-dot</id>
    +                <phase>prepare-package</phase>
    +                <goals> <goal>generate-dot</goal> </goals>
    +                <configuration> <attach>true</attach> </configuration>
    +            </execution>
    +        </executions>
    +    </plugin>
    +    <plugin>
    +        <artifactId>maven-jar-plugin</artifactId>
    +        <executions>
    +            <execution>
    +                <id>create-forge-addon</id>
    +                <phase>package</phase>
    +                <goals> <goal>jar</goal> </goals>
    +                <configuration>
    +                    <classifier>forge-addon</classifier>
    +                </configuration>
    +            </execution>
    +        </executions>
    +    </plugin>
    +</plugins>
    +
    +
    +
  8. +
+
+
+
+
Create the Java RuleProvider
+
+
    +
  1. +

    Add beans.xml file to META-INF/ dir in resources - typically, $project-dir/src/main/resources/META-INF/beans.xml. This file can be empty. It tells CDI to scan your add-on for CDI beans.

    +
  2. +
  3. +

    Within your Maven project, create a Java class that extends the WindupRuleProvider class. It is suggested that you end the name of the class with RuleProvider. For example:

    +
    +
    +
    public class MyCustomRuleProvider extends WindupRuleProvider
    +{
    +}
    +
    +
    +
  4. +
  5. +

    If the rule provider must run in a phase other than the default MIGRATION_RULES phase, override the phase using the getPhase() method. For example, you may want the rule provider to perform a task during the initial DISCOVERY phase, for example, to ignore files with a specific name or extension.

    +
    +
    +
        @Override
    +    public RulePhase getPhase() {
    +        return RulePhase.DISCOVERY;
    +    }
    +
    +
    +
    +

    For more information about rule phases, see Rules Execution Lifecycles.

    +
    +
  6. +
  7. +

    To control the order in which the rule is executed, implement the getExecuteBefore() or getExecuteAfter() method.

    +
    +
    +
    List<Class<? extends WindupRuleProvider>> executeBeforeList = new ArrayList<>();
    +
    +@Override
    +public List<Class<? extends WindupRuleProvider>> getExecuteBefore()
    +{
    +   return executeBeforeList.add(RuleToFireBefore.class);
    +}
    +
    +
    +
    +
    +
    List<Class<? extends WindupRuleProvider>> executeAfterList = new ArrayList<>();
    +
    +@Override
    +public List<Class<? extends WindupRuleProvider>> getExecuteAfter()
    +{
    +    return executeAfterList.add(RuleToFireAfter.class);
    +}
    +
    +
    +
  8. +
  9. +

    Finally, add the rule or rules to the rule provider.

    +
    +
      +
    • +

      High-level Conditions and Operations

      +
      +

      The following is a specific high-level rule which uses high-level conditions (JavaClass) and operations (Classification). See the documentation of those conditions and operations for the details.

      +
      +
      +
      +
      @Override
      +public Configuration getConfiguration(GraphContext context)
      +{
      +    return ConfigurationBuilder.begin()
      +        .addRule()
      +        .when(
      +            JavaClass.references("weblogic.servlet.annotation.WLServlet").at(TypeReferenceLocation.ANNOTATION)
      +        )
      +        .perform(
      +            Classification.as("WebLogic @WLServlet")
      +               .with(Link.to("Java EE 6 @WebServlet", "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/index.html"))
      +               .withEffort(0)
      +               .and(Hint.withText("Migrate to Java EE 6 @WebServlet.").withEffort(8))
      +        );
      +}
      +
      +
      +
      +

      For more examples of rule providers, see the +BaseConfig.java +rule.

      +
      +
    • +
    • +

      Low-level Conditions and Operations

      +
      +

      As you can see, the conditions and operations above are Java-specific. +They come with the Java Basic ruleset. The list of existing rulesets +will be part of the project documentation. Each ruleset will be +accompanied with a documentation for its `Condition`s and `Operation`s +(and also `Model`s).

      +
      +
      +

      These high-level elements provided by rulesets may cover majority of +cases, but not all. Then, you will need to dive into the mid-level +Windup building elements.

      +
      +
    • +
    • +

      Mid-level Conditions and Operations

      +
    • +
    +
    +
  10. +
+
+
+
+
+

4.4.3. Install the Java-based Rule Add-on

+
+

The easiest and fastest way to build the rule add-on, install it into the local Maven repository, and install it into Windup as a rule add-on is to use the Windup addon-build-and-install command.

+
+
+
    +
  • +

    If you have not started Windup, follow the instructions to Execute Windup.

    +
  • +
  • +

    At the Windup console prompt, enter the addon-build-and-install command:

    +
    +
    +
    addon-build-and-install --projectRoot RULE_PROJECT_HOME
    +
    +
    +
  • +
  • +

    You should see the following result.

    +
    +
    +
    ***SUCCESS*** Addon MyCustomRuleProvider:::2.0.0.VERSION was installed successfully.
    +
    +
    +
  • +
+
+
+
+

4.4.4. Test the Java-based Rule Add-on

+
+

Test the Java-based rule add-on against your application file by running the windup-migrate-app command in the Windup console prompt.

+
+
+

The command uses this syntax:

+
+
+
+
windup-migrate-app [--sourceMode true] --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
+
+
+
+

You should see the following result:

+
+
+
+
***SUCCESS*** Windup report created: QUICKSTART_HOME/windup-reports-java/index.html
+
+
+
+

For more information and examples of how to run Windup, see: Execute Windup

+
+
+
+

4.4.5. Review the Output Report

+
+
    +
  1. +

    Open OUTPUT_REPORT_DIRECTORY /index.html file in a browser.

    +
  2. +
  3. +

    You are presented with an Overview page containing the application profiles.

    +
  4. +
  5. +

    Click on the application link to review the detail page. Check to be sure the warning messages, links, and story points match what you expect to see.

    +
  6. +
+
+
+

TBD.

+
+
+ +
+
+
+
+
+
+

5. Create and Test XML Rules

+
+
+

5.1. Create a Basic XML Rule

+
+

You can create a Windup rule using Java, XML, or Groovy. This topic describes how to create a rule using XML.

+
+
+

5.1.1. Prerequisites

+
+ +
+
+
+

5.1.2. File Naming Convention for XML Rules

+
+

You must name the file containing an XML rule with the .windup.xml extension. Windup identifies files with this extension as XML-base rules, so be sure to use this naming convention, otherwise the rule will not be evaluated!

+
+
+
+

5.1.3. Basic XML Rule Template

+
+

XML rules consist of conditions and actions and follow the familiar "if/then/else" construct:

+
+
+
+
when(condition)
+    perform(action)
+otherwise
+    perform(action)
+
+
+
+

The following is the basic syntax for XML rules.

+
+
+
+
<?xml version="1.0"?>
+<ruleset xmlns="http://windup.jboss.org/v1/xml" id="XmlFileMappings">
+    <phase>
+        <!-- The phase in which to run the rules -->
+    </phase>
+    <rules>
+        <rule>
+            <when>
+                <!-- Test a condition... -->
+            </when>
+            <perform>
+                <!-- Perform this action when condition is satisfied -->
+            </perform>
+            <otherwise>
+                <!-- Perform this action when condition is not satisfied -->
+            </otherwise>
+        </rule>
+      <rules>
+    </ruleset>
+
+
+
+
+

5.1.4. Create the Rule When Condition

+
+

The syntax is dependent on whether you are creating a rule to evaluate Java class, an XML file, a project, or file content and is described in more detail here: XML Rule - When Condition Syntax

+
+
+
+

5.1.5. Create the Rule Perform Action

+
+

Operations allowed in the perform section of the rule include the classification of application resources, in-line hints for migration steps, links to migration information, and project lineitem reporting. The syntax is described in detail here: XML Rule - Perform Action Syntax.

+
+
+
+
+

5.2. XML Rule - When Condition Syntax

+
+

Conditions allowed in the when portion of a rule must extend GraphOperaton and currently include evaluation of Java classes, XML files, projects, and file content. Because XML rules are modeled after the Java-based rule add-ons, links to JavaDocs for the related Java classes are provided for a better understanding of how they behave.

+
+
+

The complete XML rule schema is located here: https://github.com/windup/windup/blob/master/config-xml/rule-schema.xsd.

+
+
+

The following sections describe the more common XML when rule conditions.

+
+ +
+

5.2.1. javaclass Syntax

+
+
Summary
+
+

Use the javaclass element to find imports, methods, variable declarations, annotations, class implementations, and other items related to Java classes. For a better understanding of the javaclass condition, see the JavaDoc for the JavaClass class.

+
+
+

The following is an example of a rule that tests for a javaclass.

+
+
+
+
<rule>
+    <when>
+        <javaclass references="org.jboss.ws.api.annotation.WebContext" in="org/jboss/{*}" as="webcontextclasses">
+            <location>IMPORT</location>
+            <location>TYPE</location>
+        </javaclass>
+    </when>
+    <perform>
+        <hint message="WebContext is deprecated." effort="0"/>
+    </perform>
+</rule>
+
+
+
+
+
Construct a javaclass Element
+
+
javaclass Element Attributes
+
+
+
references="CLASS_NAME"
+
+

The package or class name to match on. Wildcard characters can be used.

+
+
+
Example: references="org.apache.commons.{*}"
+
+
+
+
as="VARIABLE_NAME"
+
+

A variable name assigned to the rule so that it can be used as a reference in later processing. See the from attribute below.

+
+
+
Example: as="MyEjbRule"
+
+
+
+
in="PATH_FILTER"
+
+

Used to filter input files matching this regex (regular expression) naming pattern. Wildcard characters can be used.

+
+
+
Example: in="{*}File1"
+
+
+
+
from="VARIABLE_NAME"
+
+

Begin the search query with the filtered result from a previous search identified by its as VARIABLE_NAME.

+
+
+
Example: from="MyEjbRule"
+
+
+
+
+
+
+
+
JavaClass Element Child Elements
+
+
+
location
+
+

The location where the reference was found in a Java class. Location can refer to annotations, field and variable declarations, imports, and methods. For the complete list of valid values, see the JavaDoc for TypeReferenceLocation.

+
+
+
Example: <location>IMPORT</location>
+
+
+
+
+
+
+
+
+
+

5.2.2. xmlfile Syntax

+
+
Summary
+
+

Use the xmlfile element to find information in XML files. For a better understanding of the xmlfile condition, see the XmlFile JavaDoc.

+
+
+

The following is an example of a rule that tests for an xmlfile.

+
+
+
+
<rule>
+    <when>
+        <xmlfile matches="/w:web-app/w:resource-ref/w:res-auth[text() = 'Container']">
+            <namespace prefix="w" uri="http://java.sun.com/xml/ns/javaee"/>
+        </xmlfile>
+    </when>
+    <perform>
+        <hint title="Title for Hint from XML">
+            <message>Container Auth</message>
+        </hint>
+        <xslt description="Example XSLT Conversion" extension="-converted-example.xml"
+              template="/exampleconversion.xsl"/>
+    </perform>
+</rule>
+
+
+
+
+
Construct an xmlfile Element
+
+
xmlfile Element: Attributes
+
+
+
matches="XPATH"
+
+

Match on an XML file condition.

+
+
+
Example: matches="/w:web-app/w:resource-ref/w:res-auth[text() = 'Container']"
+
+
+
+
xpathResultMatch="XPATH_RESULT_STRING"
+
+

Return results that match the given regex.

+
+
+
Example: xpathResultMatch=""
+
+
+
+
as="VARIABLE_NAME"
+
+

A variable name assigned to the rule so that it can be used as a reference in later processing. See the from attribute below.

+
+
+
Example: as="MyEjbRule"
+
+
+
+
in="PATH_FILTER"
+
+

Used to filter input files matching this regex (regular expression) naming pattern. Wildcard characters can be used.

+
+
+
Example: in="{*}File1"
+
+
+
+
from="VARIABLE_NAME"
+
+

Begin the search query with the filtered result from a previous search identified by its as VARIABLE_NAME.

+
+
+
Example: from="MyEjbRule"
+
+
+
+
public-id="PUBLIC_ID"
+
+

The DTD public-id regex.

+
+
+
Example: public-id="public"
+
+
+
+
+
+
+
+
xmlfile Element: Child Elements
+
+
+
namespace
+
+

The namespace to referenced in XML files. This element contains 2 attributes: The prefix and the uri.

+
+
+
Example: <namespace prefix="abc" uri="http://maven.apache.org/POM/4.0.0"/>
+
+
+
+
+
+
+
+
+
+

5.2.3. project Syntax

+
+
Summary
+
+

Use the project element to query for the project charateristics. For a better understanding of the project condition, see the JavaDoc for the Project class.

+
+
+

The following is an example of a rule that checks a rule is dependent on the junit in the version between 2.0.0.Final and 2.2.0.Final.

+
+
+
+
<rule>
+    <when>
+        <project>
+            <artifact groupId="junit" artifactId="junit" from="2.0.0.Final" to="2.2.0.Final"/>
+        </project>
+    </when>
+    <perform>
+        <lineitem message="The project uses junit with the version between 2.0.0.Final and 2.2.0.Final"/>
+    </perform>
+</rule>
+
+
+
+
+
Construct a project Element
+
+
project Element Attributes
+
+

The project element is used to match against the project as a whole. You can use this condition to query for dependencies of the project. It does not have any attributes itself.

+
+
+
+
project Element Child Elements
+
+
+
artifact
+
+

Subcondition used within project to query against project dependencies. This element contains the following attributes:

+
+
    +
  • +

    groupId="PROJECT_GROUP_ID"

    +
    +

    Match on the project <groupId> of the dependency

    +
    +
  • +
  • +

    artifactId="PROJECT_ARTIFACT_ID" +Match on the project <artifactId> of the dependency

    +
  • +
  • +

    fromVersion="FROM_VERSION"

    +
    +

    Specify the lower version bound of the artifact. For example 2.0.0.Final

    +
    +
  • +
  • +

    toVersion="TO_VERSION"

    +
    +

    Specify the upper version bound of the artifact. For example 2.2.0.Final

    +
    +
  • +
+
+
+
+
+
+
+
+
+

5.2.4. filecontent Syntax

+
+

Use the filecontent element to find strings or text within files, for example, a line in a Properties file. For a better understanding of the filecontent condition, see the JavaDoc for the FileContent class.

+
+
+
+
+

5.3. XML Rule - Perform Action Syntax

+
+

Operations allowed in the perform section of the rule include the classification of application resources, in-line hints for migration steps, links to migration information, and project lineitem reporting. Because XML rules are modeled after the Java-based rule add-ons, links to JavaDocs for the related Java classes are provided for a better understanding of how they behave.

+
+
+

The complete XML rule schema is located here: https://github.com/windup/windup/blob/master/config-xml/rule-schema.xsd.

+
+
+

The following sections describe the more common XML rule perform actions.

+
+ +
+

5.3.1. classification Syntax

+
+
Summary
+
+

The classification element is used to identify or classify application resources. It provides a level of effort and can also provide links to additional information about how to migrate this resource classification. For a better understanding of the classification action, see the JavaDoc for the Classification class.

+
+
+

The following is an example of a rule that classifies a resource as a WebLogic EAR application deployment descriptor file.

+
+
+

Example:

+
+
+
+
<rule id="XmlWebLogicRules_10vvyf">
+    <when>
+        <xmlfile as="default" matches="/*[local-name()='weblogic-application']">
+        </xmlfile>
+    </when>
+    <perform>
+        <iteration>
+            <classification classification="Weblogic EAR Application Descriptor" effort="3"/>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+
Construct a classification Element
+
+
classification Element Attributes
+
+
+
classification="STRING"
+
+

Classify the resource as the specified string.

+
+

Example:

+
+
+
+
classification="JBoss Seam Components"
+
+
+
+
effort="NUMBER"
+
+

The level of effort assigned to this resource.

+
+

Example:

+
+
+
+
effort="2"
+
+
+
+
+
+
+
+
classification Element Child Elements
+
+
+
xref
+
+

Provides a link URI and text description for additional information.

+
+

Example:

+
+
+
+
<classification classification="Websphere Startup Service" effort="4">
+    <link href="http://docs.oracle.com/javaee/6/api/javax/ejb/Singleton.html" description="EJB3.1 Singleton Bean"/>
+    <link href="http://docs.oracle.com/javaee/6/api/javax/ejb/Startup.html" description="EJB3.1 Startup Bean"/>
+ </classification>
+
+
+
+
+
+
+
+
+
+ +
+
Summary
+
+

The link element is used in classifications or hints to identify or classify links to informational content. For a better understanding of the link action, see the JavaDoc for the Link class.

+
+
+

The following is an example of a rule that creates links to additional information.

+
+
+

Example:

+
+
+
+
<rule id="SeamToCDIRules_2fmb">
+    <when>
+        <javaclass references="org.jboss.seam.{*}" as="default"/>
+    </when>
+    <perform>
+        <iteration>
+            <classification classification="SEAM Component" effort="1">
+                <link href="http://www.seamframework.org/Seam3/Seam2ToSeam3MigrationNotes" description="Seam 2 to Seam 3 Migration Notes"/>
+                <link href="http://docs.jboss.org/weld/reference/latest/en-US/html/example.html" description="JSF Web Application Example"/>
+                <link href="http://docs.jboss.org/weld/reference/latest/en-US/html/contexts.html" description="JBoss Context Documentation"/>
+                <link href="http://www.andygibson.net/blog/tutorial/cdi-conversations-part-2/" description="CDI Conversations Blog Post"/>
+            </classification>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+ +
+ +
+
+
href="URI"
+
+

The URI for the referenced link/.

+
+

Example:

+
+
+
+
href="https://access.redhat.com/articles/1249423"
+
+
+
+
description="URI_DESCRIPTION"
+
+

A description for the link.

+
+

Example:

+
+
+
+
description="Migrate WebLogic Proprietary Servlet Annotations"
+
+
+
+
+
+
+
+
+
+

5.3.3. hint Syntax

+
+
Summary
+
+

The hint element is used to provide a hint or inline information about how to migrate a section of code. For a better understanding of the hint action, see the JavaDoc for the Hint class.

+
+
+

The following is an example of a rule that creates a hint.

+
+
+

Example:

+
+
+
+
<rule id="WebLogicWebServiceRules_8jyqn">
+    <when>
+        <javaclass references="weblogic.wsee.connection.transport.http.HttpTransportInfo.setUsername({*})" as="default">
+            <location>METHOD</location>
+        </javaclass>
+    </when>
+    <perform>
+        <iteration>
+            <hint message="Replace proprietary web-service authentication with JAX-WS standards." effort="0">
+                <link href="http://java-x.blogspot.com/2009/03/invoking-web-services-through-proxy.html" description="JAX-WS Proxy Password Example"/>
+            </hint>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+
Construct a hint Element
+
+
hint Element: Attributes
+
+
+
message="MESSAGE"
+
+

A message describing the migration hint

+
+

Example:

+
+
+
+
message=""
+
+
+
+
effort="NUMBER"
+
+

The level of effort assigned to this resource.

+
+

Example:

+
+
+
+
effort="2"
+
+
+
+
+
+
+
+
hint Element: Child Elements
+
+
+
xref
+
+

Identify or classify links to informational content. See the section on link Syntax for details.

+
+

Example:

+
+
+
+
link href="http://java-x.blogspot.com/2009/03/invoking-web-services-through-proxy.html" description="JAX-WS Proxy Password Example"/>
+
+
+
+
+
+
+
+
+
+

5.3.4. xslt Syntax

+
+
Summary
+
+

The xslt element specifies how to transform an XML file. For a better understanding of the xslt action, see the JavaDoc for the XSLTTransformation class.

+
+
+

The following is an example of rule that defines an XSLT action.

+
+
+

Example:

+
+
+
+
<rule id="XmlWebLogicRules_6bcvk">
+    <when>
+        <xmlfile as="default" matches="/weblogic-ejb-jar"/>
+    </when>
+    <perform>
+        <iteration>
+            <classification classification="Weblogic EJB XML" effort="3"/>
+            <xslt description="JBoss EJB Descriptor (Windup-Generated)" template="transformations/xslt/weblogic-ejb-to-jboss.xsl" extension="-jboss.xml"/>
+        </iteration>
+    </perform>
+</rule>
+
+
+
+
+
Construct an xslt Element
+
+
xslt Element: Attributes
+
+
+
of="STRING"
+
+

Create a new transformation for the given reference.

+
+

Example:

+
+
+
+
of="testVariable_instance"
+
+
+
+
description="String"
+
+

Sets the description of this XSLTTransformation.

+
+

Example:

+
+
+
+
description="XSLT Transformed Output"
+
+
+
+
extension="String"
+
+

Sets the extension for this XSLTTransformation.

+
+

Example:

+
+
+
+
extension="-result.html"
+
+
+
+
template=String
+
+

Sets the XSL template.

+
+

Example:

+
+
+
+
template="simpleXSLT.xsl"
+
+
+
+
+
+
+
+
xslt Element: Child Elements
+
+
+
xslt-parameter=Map<String,String>
+
+

Specify XSLTTransformation parameters as property value pairs

+
+

Example:

+
+
+
+
<xslt-parameter property="title" value="EJB Transformation"/>
+
+
+
+
+
+
+
+
+
+

5.3.5. lineitem Syntax

+
+
Summary
+
+

The lineitem element is used to provide line item information about a hint on the project or application overview page. For a better understanding of the lineitem action, see the JavaDoc for the Lineitem class.

+
+
+

The following is an example of a rule that creates a lineitem message.

+
+
+

Example:

+
+
+
+
<rule>
+    <when>
+        <javaclass references="weblogic.servlet.annotation.WLServlet" as="default">
+            <location>ANNOTATION</location>
+        </javaclass>
+    </when>
+    <perform>
+        <hint message="Replace the proprietary WebLogic @WLServlet annotation with the Java EE 6 standard @WebServlet annotation." effort="1">
+            <link href="https://access.redhat.com/articles/1249423" description="Migrate WebLogic Proprietary Servlet Annotations" />
+            <lineitem message="Proprietary WebLogic @WLServlet annotation found in file."/>
+        </hint>
+    </perform>
+</rule>
+
+
+
+
+
Construct a lineitem Element
+
+
lineitem Element: Attributes
+
+
+
message="MESSAGE"
+
+

A lineitem message

+
+

Example:

+
+
+
+
message="Proprietary code found."
+
+
+
+
+
+
+
+
+
+

5.3.6. iteration Syntax

+
+
Summary
+
+

The iteration element specifies to iterate over an implicit or explicit variable defined within the rule. For a better understanding of the iteration action, see the JavaDoc for the Iteration class.

+
+
+

The following is an example of a rule that preforms an iteration.

+
+
+

Example:

+
+
+
+
<rule id="XmlWebLogicRules_14wscy">
+     <when>
+         <xmlfile as="1" matches="/wl:weblogic-webservices | /wl9:weblogic-webservices">
+             <namespace prefix="wl9" uri="http://www.bea.com/ns/weblogic/90"/>
+             <namespace prefix="wl" uri="http://www.bea.com/ns/weblogic/weblogic-webservices"/>
+         </xmlfile>
+         <xmlfile as="2" matches="//wl:webservice-type | //wl9:webservice-type" from="1">
+             <namespace prefix="wl9" uri="http://www.bea.com/ns/weblogic/90"/>
+             <namespace prefix="wl" uri="http://www.bea.com/ns/weblogic/weblogic-webservices"/>
+         </xmlfile>
+     </when>
+     <perform>
+         <iteration over="1">
+             <classification classification="Weblogic Webservice Descriptor" effort="0"/>
+         </iteration>
+         <iteration over="2">
+             <hint message="Webservice Type" effort="0"/>
+         </iteration>
+     </perform>
+ </rule>
+
+
+
+
+
Construct an iteration Element
+
+
iteration Element: Attributes
+
+
+
over="NUMBER"
+
+

??

+
+

Example:

+
+
+
+
over="2"
+
+
+
+
+
+
+
+
iteration Element: Child Elements
+
+

iteration child elements include a when condition, along with the actions iteration, classification, hint, xslt, lineitem, and otherwise.

+
+
+
+
+
+
+

5.4. Test an XML Rule in Windup

+
+

5.4.1. Add the Rule to Windup

+
+

A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations for files ending with .windup.groovy and .windup.xml:

+
+
+
    +
  • +

    The directory specified in the --userRulesDirectory option to the windup-migrate-app.

    +
  • +
  • +

    The WINDUP_HOME/rules/ directory.

    +
    +

    WINDUP_HOME is the directory where you run the Windup executable (see here).

    +
    +
  • +
  • +

    The ${user.home}/.windup/rules/ directory.

    +
    +

    The ${user.home}/.windup is a directory created by Windup at first run and contains rules, add-ons, and the Windup log.

    +
    +
    +
    +
    For Linux or Mac:   ~/.windup/rules/
    +For Windows: "\Documents and Settings\USER_NAME\.windup\rules\"  -or-  "\Users\USER_NAME\.windup\rules\"
    +
    +
    +
  • +
+
+
+
+

5.4.2. Test the XML Rule

+
+
    +
  1. +

    If you have not started Windup, follow the instructions to Execute Windup.

    +
  2. +
  3. +

    Test the XML rule against your application file by running the windup-migrate-app command in the Windup console prompt.

    +
    +

    The command uses this syntax:

    +
    +
    +
    +
    windup-migrate-app [--sourceMode true] --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
    +
    +
    +
    +

    You should see the following result:

    +
    +
    +
    +
    ***SUCCESS*** Windup report created: OUTPUT_REPORT_DIRECTORY/index.html
    +
    +
    +
  4. +
+
+
+
+

5.4.3. Additional Resources

+
+ +
+
+
+
+
+
+

6. Debugging and Troubleshooting

+
+
+

6.1. Debugging and Profiling

+
+

6.1.1. Debug the Windup Distribution Runtime

+
+

You can debug the Windup distribution using one of the following approaches.

+
+
+
    +
  1. +

    Pass the --debug argument on the command line when you execute Windup.

    +
    +
    +
    For Linux:    WINDUP_HOME/bin $ ./windup --debug
    +For Windows:  C:\WINDUP_HOME\bin> windup --debug
    +
    +
    +
  2. +
  3. +

    Configure the FORGE_OPTS for debugging.

    +
    +
    +
    export FORGE_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
    +
    +
    +
  4. +
+
+
+
+

6.1.2. Debug a Test Using NetBeans

+
+

Click the Debug Test File button, or choose MenuDebugDebug Test File.

+
+
+
+

6.1.3. Profile a Test Using NetBeans

+
+
    +
  1. +

    Profiling requires a lot of memory, so be sure to increase the NetBeans memory settings.

    +
    +
      +
    • +

      Open the NETBEANS_HOME/etc/netbeans.conf file

      +
    • +
    • +

      Find the line with netbeans_default_options=

      +
    • +
    • +

      Add the following option

      +
      +
      +
      -J-Xmx5200m -J-XX:MaxPermSize=1024m
      +
      +
      +
    • +
    • +

      Restart NetBeans.

      +
    • +
    +
    +
  2. +
  3. +

    Click Menu > Profile > Profile Test File.

    +
  4. +
  5. +

    In the resulting dialog, enter the following.

    +
    +
    +
    exec.args=-Djboss.modules.system.pkgs=org.netbeans
    +
    +
    +
  6. +
+
+
+
+

6.1.4. Profile Forge Runtime Using YourKit

+
+
    +
  1. +

    Download and unzip YourKit. Be sure to get the trial license.

    +
  2. +
  3. +

    Configure the FORGE_OPTS for Yourkit:

    +
    +
    +
    export YOURKIT_HOME=/home/ondra/sw/prog/YourKit-b14092
    +export FORGE_OPTS="-Djboss.modules.system.pkgs=com.yourkit -agentpath:$YOURKIT_HOME/bin/linux-x86-64/libyjpagent.so=sampling,onexit=snapshot,delay=0"
    +
    +
    +
  4. +
  5. +

    Run forge. For details, see Profiling +Forge, but skip the first 2 points that direct you to copy the YourKit module and JAR into the Forge installation. Forge 2 already contains the YourKit module and JAR>.

    +
  6. +
  7. +

    Run windup-analyze-app.

    +
    +
    +
    forge -e windup-migrate-app
    +
    +
    +
  8. +
+
+
+
+
+

6.2. Troubleshoot Windup Issues

+
+

6.2.1. Logging

+
+

Logging is currently broken and will not be fixed any time soon.

+
+
+

See Known Issues and WINDUP-73 for the current status.

+
+
+
+

6.2.2. Debugging Exceptions

+
+

Exceptions in Surefire reports are broken due to the way Forge wraps +exceptions and the way Surefire handles them. You need to +debug or rewrap exceptions using TestUtil.rewrap(ex).

+
+
+

See Known Issues and WINDUP-197 for the current status..

+
+
+
+

6.2.3. Classloading Problems

+
+

Configuring dependencies in a Forge-based project can be a little tricky. +See Dependencies for some hints.

+
+
+
+
Caused by: java.lang.IllegalArgumentException: Type value for model 'org.jboss.windup.rules.files.model.FileReferenceModel' is already registered with model org.jboss.windup.rules.files.model.FileReferenceModel
+
+
+
+

This means that the model class is loaded twice. I.e. the module containing it is loaded twice. Or, in tests, you may be (accidentally) adding the class to the deployment. +This may especially happen after Maven coordinates of some module are changed.

+
+
+
+
+
+
+

7. Additional Resources

+
+
+

7.1. Get Involved

+
+

7.1.1. How can you help?

+
+

To help us make Windup cover most application constructs and server configurations, including yours, you can help with any of the following items. Some items require only a few minutes of your time!

+
+
+
    +
  • +

    Let us know what Windup migration rules should cover.

    +
  • +
  • +

    Provide example applications to test migration rules.

    +
  • +
  • +

    Identify application components and problem areas that may be difficult to migrate.

    +
    +
      +
    • +

      Write a short description of these problem migration areas.

      +
    • +
    • +

      Write a brief overview describing how to solve the problem migration areas.

      +
    • +
    +
    +
  • +
  • +

    Try Windup on your application. Be sure to report any issues you encounter.

    +
  • +
  • +

    You can contribute Windup rules.

    +
    +
      +
    • +

      Write a Windup rule add-on to automate a migration process.

      +
    • +
    • +

      Create a test for the new rule.

      +
    • +
    • +

      For details, see the Windup Rules Development Guide.

      +
    • +
    +
    +
  • +
  • +

    You can also contribute to the project source code.

    +
    +
      +
    • +

      Create a core rule.

      +
    • +
    • +

      Improve performance or efficiency.

      +
    • +
    • +

      See the_Windup Core Development Guide_ for information about how to configure your environment and set up the project.

      +
    • +
    +
    +
  • +
+
+
+

Any level of involvement is greatly appreciated!

+
+
+
+ +
+ +
+
+

You can also follow us on this IRC channel: irc.freenode.net#windup.

+
+
+
+
+

7.2. Review the Windup Quickstarts

+
+

The Windup quickstarts provide working examples of how to create custom Java-based rule add-ons and XML rules. You can use them as a starting point for creating your own custom rules. The quickstarts are available on GitHub here: https://github.com/windup/windup-quickstarts

+
+
+

You can fork and clone the project to have access to regular updates or you can download a ZIP file of the latest version.

+
+
+

7.2.1. Download the Latest ZIP

+
+

To download the latest quickstart ZIP file, browse to: https://github.com/windup/windup-quickstarts/releases

+
+
+

Click on the most recent release to download the ZIP to your local file system.

+
+
+
+

7.2.2. Fork and Clone the GitHub Project

+
+

If you don’t have the GitHub client (git), download it from: http://git-scm.com/

+
+
+
    +
  1. +

    Click the Fork link on the Windup quickstart GitHub page to create the project in your own Git. The forked GitHub repository URL created by the fork should look like this: https://github.com/YOUR_USER_NAME/windup-quickstarts.git

    +
  2. +
  3. +

    Clone your Windup quickstart repository to your local file system:

    +
    +
    +
    git clone https://github.com/YOUR_USER_NAME/windup-quickstarts.git
    +
    +
    +
  4. +
  5. +

    This creates and populates a windup-quickstarts directory on your local file system. Navigate to the newly created directory, for example

    +
    +
    +
    cd windup-quickstarts/
    +
    +
    +
  6. +
  7. +

    If you want to be able to retrieve the lates code updates, add the remote upstream repository so you can fetch any changes to the original forked repository.

    +
    +
    +
    git remote add upstream https://github.com/windup/windup-quickstarts.git
    +
    +
    +
  8. +
  9. +

    To get the latest files from the upstream repository.

    +
    +
    +
    git reset --hard upstream/master
    +
    +
    +
  10. +
+
+
+
+
+

7.3. Available Rule Utilities

+
+

7.3.1. Programmatically Access the Graph

+
+

Note: Needs update. This is out of date!

+
+
+

(Lower Level API, to cover cases not provided by high level API)

+
+
+

This topic describes how to to programmatically access or update graph data when you create a Java-based rule add-on.

+
+
+
Query the graph
+
+

There are several ways - including Query API, Gremlin support, or +GraphService methods.

+
+
+
Query the Graph Within the .when() method
+
+

Building a rule contains the method when(), which is used to create a +condition. Vertices that fulfill the condition, are passed to the +perform() method.

+
+
+

For the queries in the when() method, class Query is used. There are +several methods which you can use to specify the condition. For example: +* find() specifies the Model type of the vertex * as() method +specifies the name of the final list, that is passed to the perform() +method * from(String name) starts the query not on the all vertices, +but only on the vertices already stored in the the given name (used to +begin query on the result of the other one) * withProperty() specify +the property value of the given vertex

+
+
+

The following are examples of simple queries.

+
+
+

Return a list of archives

+
+
+
+
Query.find(ArchiveModel.class)
+
+
+
+
+
Query.find(ApplicationReportModel.class).as(VAR_APPLICATION_REPORTS)
+
+
+
+
+
Iteration
+
+
+
ConfigurationBuilder.begin().addRule()
+    .when(
+        GraphSearchConditionBuilderGremlin.create("javaFiles", new ArrayList())
+        .V().framedType( JavaFileModel.class ).has("analyze")
+    )
+    .perform(
+        // For all java files...
+        Iteration.over("javaFiles").var("javaFile").perform(
+
+
+
+
+
Nested Iteration
+
+
+
code,java
+// For all java files...
+Iteration.over("javaFiles").var("javaFile").perform(
+    // A nested rule.
+    RuleSubset.evaluate(
+        ConfigurationBuilder.begin().addRule()
+        .when(...)
+        .perform(
+            Iteration.over("regexes").var(RegexModel.class, "regex").perform(
+                new AbstractIterationOperator<RegexModel>( RegexModel.class, "regex" ) {
+                    public void perform( GraphRewrite event, EvaluationContext context, RegexModel regex ) {
+                        //...
+                    }
+                }
+            )
+            .endIteration()
+        )// perform()
+    )
+)
+
+
+
+
+
+
+

7.3.2. Modify Graph Data

+
+

For more custom operations dealing with Graph data that are not covered by the Query mechanism, use the GraphService.

+
+
+
+
GraphService<FooModel> fooService = new GraphService<FooModel>(graph,FooModel.class);
+
+List<FooModel> = fooService.findAll();
+FooModel = fooService.create();
+
+// etc ...
+
+
+
+

GraphService<> can also be used to query the graph for models of the specified type:

+
+
+
+
FooModel foo = new GraphService<>(graphContext, FooModel.class).getUnique();
+
+
+
+
+
FooModel foo = new GraphService<>(graphContext, FooModel.class).getUniqueByProperty("size", 1);
+
+
+
+
+
+

7.4. Known Windup Issues

+
+

Windup known issues are tracked here: Open Windup issues

+
+
+
+

7.5. Report Issues with Windup

+
+

Windup uses JIRA as its issue tracking system. If you encounter an issue executing Windup, please file a Windup JIRA Issue.

+
+
+

7.5.1. Create a JIRA Account

+
+

If you do not yet have a JIRA account, create one using the following procedure.

+
+
+
    +
  1. +

    Open a browser to the following URL: https://issues.jboss.org/secure/Dashboard.jspa

    +
  2. +
  3. +

    Click the Sign Up link in the top right side of the page.

    +
  4. +
  5. +

    Enter your email address and click the Confirm address button.

    +
  6. +
  7. +

    Follow the instructions sent to your email address.

    +
  8. +
+
+
+
+

7.5.2. Create a JIRA Issue

+
+
    +
  1. +

    Open a browser to the following URL: https://issues.jboss.org/secure/CreateIssue!default.jspa.

    +
    +
      +
    • +

      If you have not yet logged in, click the Log In link at the top right side of the page.

      +
    • +
    • +

      Enter your credentials and click the LOGIN button.

      +
    • +
    • +

      You are then redirected back to the Create Issue page.

      +
    • +
    +
    +
  2. +
  3. +

    Choose the following options and click the Next button.

    +
    +
      +
    • +

      Project: Windup

      +
    • +
    • +

      Issue Type: Bug

      +
    • +
    +
    +
  4. +
  5. +

    On the next screen complete the following fields:

    +
    +
      +
    • +

      Summary: Enter a brief description of the problem or issue.

      +
    • +
    • +

      Environment: Provide the details of your operating system, version of Java, and any other pertinent information.

      +
    • +
    • +

      Description: Provide a detailed description of the issue. Be sure to include logs and exceptions traces.

      +
    • +
    +
    +
  6. +
  7. +

    Click the Create button to create the JIRA issue.

    +
  8. +
  9. +

    If the application or archive causing the issue does not contain sensitive information and you are comfortable sharing it with the Windup development team, attach it to the issue by choosing More → Attach Files. You are provided with an option to restrict visibility to JBoss employees.

    +
  10. +
+
+
+
+
+
+
+

8. Appendix

+
+
+

8.1. Glossary of Terms Used in Windup

+
+

8.1.1. Rules Terms

+
+
+
Rule
+
+

A piece of code that performs a single unit of work during the migration process. Depending on the complexity of the rule, it may or may not include configuration data. Extensive configuration information may be externalized into external configuration, for example, a custom XML file. The following is an example of a Java-based rule added to the JDKConfig RuleProvider class.

+
+
+
+
+
+
.addRule()
+    .when(JavaClass.references("java.lang.ClassLoader$").at(TypeReferenceLocation.TYPE))
+    .perform(Classification.as("Java Classloader, must be migrated.")
+    .with(Link.to("Red Hat Customer Portal: How to get resources via the ClassLoader in a JavaEE application in JBoss EAP",  "https://access.redhat.com/knowledge/solutions/239033"))
+     .withEffort(1))
+
+
+
+
+
RuleProvider
+
+

A class that implements one or more rules using the .addRule() method. The following are examples of legacy Java RulesProviders that are defined in rules-java-ee ruleset.

+
+
    +
  • +

    EjbConfig

    +
  • +
  • +

    JDKConfig

    +
  • +
  • +

    SeamToCDI

    +
  • +
+
+
+
Ruleset
+
+

A ruleset is a group of one or more RuleProviders that targets a specific area of migration, for example, Spring → Java EE 6 or WebLogic → JBoss EAP. A ruleset is packaged as a JAR and contains additional information needed for the migration, such as operations, conditions, report templates, static files, metadata, and relationships to other rulesets. The following Windup projects are rulesets.

+
+
    +
  • +

    rules-java-ee

    +
  • +
  • +

    rules-xml

    +
  • +
+
+
+
Rules Metadata
+
+

Information about whether a particular ruleset applies to a given situation. The metadata can include the source and target platform and frameworks.

+
+
Rules Pipeline
+
+

A collection of rules that feed information into the knowledge graph.

+
+
+
+
+
+

8.1.2. Reporting Terms

+
+
+
Lift and Shift (Level of effort)
+
+

The code or file is standards-based and can be ported to the new environment with no changes.

+
+
Mapped (Level of effort)
+
+

There is a standard mapping algorithm to port the code or file to the new environment.

+
+
Custom (Level of effort)
+
+

The code or file must be rewritten or modified to work in the new environment.

+
+
Story Point
+
+

A term commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

+
+
+
+
+
+
+

8.2. Windup Architectural Components

+
+

The following open source software, tools, and APIs are used within +Windup to analyze and provide migration information. If you plan to +contribute source code to the core Windup 2.0 project, you should be +familiar with them.

+
+
+

8.2.1. Forge

+
+

Forge is an open source, extendable, rapid application development tool +for creating Java EE applications using Maven. For more information +about Forge 2, see: JBoss Forge.

+
+
+
+

8.2.2. Forge Furnace

+
+

Forge Furnace is a modular runtime container behind Forge that provides +the ability to run Forge add-ons in an embedded application. For more +information about Forge Furnace, see: +Run Forge Embedded.

+
+
+
+

8.2.3. TinkerPop

+
+

TinkerPop is an open source graph computing framework. For more +information, see: TinkerPop.

+
+
+
+

8.2.4. Titan

+
+

Titan is a scalable graph database optimized for storing and querying graphs. +For more information, see: Titan Distributed Graph Database and Titan Beginner’s Guide.

+
+
+
+

8.2.5. Frames

+
+

Frames represents graph data in the form of interrelated Java Objects or +a collection of annotated Java Interfaces. For more information, see: +TinkerPop Frames.

+
+
+

Windup includes several Frames extensions, which are documented here: +Frames Extensions.

+
+
+
+

8.2.6. Gremlin

+
+

Gremlin is a graph traversal language that allows you to query, analyze, +and manipulate property graphs that implement the Blueprints property +graph data model. For more information, see: +TinkerPop Gremlin Wiki.

+
+
+
+

8.2.7. Blueprints

+
+

Blueprints is an industry standard API used to access graph databases. +For more information about Blueprints, see: +TinkerPop Blueprints Wiki.

+
+
+
+

8.2.8. Pipes

+
+

Pipes is a dataflow framework used to process graph data. It for the +transformation of data from input to output. For more information, see: +Tinkerpop Pipes Wiki.

+
+
+
+

8.2.9. Rexster

+
+

Rexster is a graph server that exposes any Blueprints graph through HTTP/REST and a binary protocol called RexPro. Rexster makes extensive use of Blueprints, Pipes, and Gremlin. For more information, see: +TinkerPop Rexster Wiki.

+
+
+
+

8.2.10. OCPsoft Rewrite

+
+

OCPsoft Rewrite is an open source routing and URL rewriting solution for +Servlets, Java Web Frameworks, and Java EE. For more information about +Ocpsoft Rewrite, see: OCPsoft Rewrite.

+
+
+
+
+

8.3. Windup Models

+
+

Windup models are the classes extending WindupVertexFrame. +They are used to model the data in the graph database to Java objects.

+
+
+

This is an overview of the most important models. +The complete and up-to-date list of models is in Javadoc.

+
+
+

Windup Models Graphic

+
+
+

8.3.1. Meta Models

+
+
    +
  • +

    User input

    +
  • +
  • +

    Rules and Rule Providers metadata

    +
  • +
+
+
+
+

8.3.2. Core Models

+
+

FileModel ArchiveModel

+
+
+
+

8.3.3. Reporting Models

+ +
+
+

8.3.4. Custom Models (coming from add-ons)

+
+

See respective ruleset’s documentation.

+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/html/WindupRulesDevelopmentGuide.html b/html/WindupRulesDevelopmentGuide.html index 5359371eb8..a93fde7564 100644 --- a/html/WindupRulesDevelopmentGuide.html +++ b/html/WindupRulesDevelopmentGuide.html @@ -487,7 +487,7 @@

1. Overview

custom rules for Windup 2.0.

-

Windup Logo

+

Windup Logo


@@ -873,17 +873,13 @@

2.2.3. Run Windup

The command to run Windup is windup-migrate-app.

  • -

    The following is a list of the most commonly used command line arguments.

    +

    This command can take arbitrary options processed by different addons. The list of options in the core Windup distribution can be found in Javadoc. Most commonly used command line arguments are:

    --input INPUT_ARCHIVE_OR_FOLDER

    This is the fully qualified application archive or source path.

    -
    --source-mode true (optional)
    -
    -

    This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

    -
    --output OUTPUT_REPORT_DIRECTORY

    The fully qualified path to the folder that will contain the the report information produced by Windup.

    @@ -904,6 +900,10 @@

    2.2.3. Run Windup

    Specify this optional argument only if you are certain you want to force Windup to delete the existing OUTPUT_REPORT_DIRECTORY. The default value is false.

    +
    --userRulesDirectory
    +
    +

    Points to a directory to load XML rules from. (Search pattern: *.windup.groovy and *.windup.xml)

    +
    --packages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)

    This is a comma-delimited list of the packages to be evaluated by Windup.

    @@ -912,6 +912,10 @@

    2.2.3. Run Windup

    This is a comma-delimited list of the packages to be excluded by Windup.

    +
    --source-mode true (optional)
    +
    +

    This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

    +
  • @@ -1984,7 +1988,14 @@
    when()

    Other way to fill a when part is subclassing the GraphCondition. Actually, Query also implements it, and is only a convenient way to -create a condition.

    +create a condition. +You can also use multiple conditions within one when() call using and(). +Example:

    +
    +
    +
    +
    .when(Query.fromType(XmlMetaFacetModel.class).and(Query...))
    +

    Last noticable but important feature is the ability to use @@ -2015,7 +2026,7 @@

    perform()

    For that, various operations are available. These are subclasses of GraphOperation. You can also implement your own. See -Rules-Operations[Rules Operations] for more info. Again, there are +Rules Operations for more information. Again, there are several convenient implementations for constructs like iteration (Iteration).

    @@ -2044,7 +2055,22 @@
    Iteration
    Nested iterations
    -

    TO_DO: Provide information about nested iterations

    +

    An iteration is also an operation, so everywhere an operation is expected, you can freely put the Iteration. If the Iteration is put inside the perform method of another Iteration, we speak about nested iterations. +An example of such nested iteration may be:

    +
    +
    +
    +
    .addRule()
    +     .when(...)
    +     .perform(
    +     Iteration.over("list_variable").as("single_var")
    +       .perform(
    +         Iteration.over("single_var") //second iteration
    +           .perform(...).endIteration()
    +     )
    +     .endIteration()
    +);
    +
    @@ -2073,7 +2099,18 @@
    otherwise
    Where
    -

    TO_DO: Provide information about the where clause

    +

    The where clause is used to provide information about used parameters within the rule. So for example if you have used a parameter in some condition like for example JavaClass.references("{myMatch}"), you may use the where clause to specify what the myMatch is like .where("myMatch").matches("java.lang.String.toString\(.*\)").

    +
    +
    +
    +
    .when(JavaClass.references("{myMatch}").at(TypeReferenceLocation.METHOD))
    +.perform(...)
    +.where("myMatch").matches("java.lang.String.toString\(.*\)")
    +
    +
    +
    +

    + +Please note that within the where clause the regex is used in contrast to JavaClass.references() where a windup specific syntax is expected.

    @@ -2099,39 +2136,75 @@

    4.2.3. Available utilities

    For a list of what key services and constructs can be used in the rule, see Available Rules Utilities.

    +
    +
    Variable stack
    +
    +

    The communication between the conditions and operations is done using the variable stack that is filled with the output of the condition/s and then given to the Iteration to be processed. +Within conditions, you can specify the name of the result iterable that is saved in the stack using as() method, the iteration can specify the iterable to iterate over using the over() method and even specify the name of for each processed single model of the result being processed. +Example:

    +
    +
    +
    +
    .addRule()
    +     .when(Query...as("result_list"))
    +     .perform(
    +     Iteration.over("result_list").as("single_var")
    +          ...
    +     )
    +);
    -
    -

    4.3. Basic Rule Execution Flow Patterns

    -

    TO_DO: Need some links to github to the respective example files.

    +

    The varstack may be accesed even from the second condition in order to narrow the result of the previous one. After that the iteration may choose which result it wants to iterate over (it is even possible to have multiple iterations listed in the perform, each of which may access different result saved in the variable stack).

    +
    +
    +
    +
    .addRule()
    +     .when(Query...as("result_list").and(Query.from("result_list")....as("second_result_list")))
    +     .perform(
    +     Iteration.over("second_result_list")
    +          ...
    +     )
    +);
    -
    -

    4.3.1. operation(); - single operation

    -
    -

    When no iteration or condition is needed.

    +
    +
    +
    +
    +

    4.3. Basic Rule Execution Flow Patterns

    +
    +

    4.3.1. Single Operation - operation();

    -

    Example: [CopyJavaConfigToGraphRuleProvider](rules-java/src/main/java/org/jboss/windup/rules/apps/java/config/CopyJavaConfigToGraphRuleProvider.java)

    +

    No condition or iteration is needed. The following is an example of a single operation.

    -
    return ConfigurationBuilder.begin()
    +
    return ConfigurationBuilder.begin()
         .addRule()
         .perform(new GraphOperation(){
             @Override
             public void perform(GraphRewrite event, EvaluationContext context){
                 ...
             }
    -    });
    + });
    +
    +
    + +
    +

    The copyConfigToGraph GraphOperation used in the perform() above is defined before the rule.

    -

    4.3.2. if( …​ ){ operation(); } - single conditional operation

    +

    4.3.2. Single Conditional Operation - if( …​ ){ operation()}

    +
    +

    A single condition must be met. The following is an example of a single conditional operation.

    +
    -
    return ConfigurationBuilder.begin()
    +
    return ConfigurationBuilder.begin()
         .addRule()
         .when( ... )
         .perform(new GraphOperation(){
    @@ -2139,14 +2212,17 @@ 

    4.3.2. if( …​ ){ public void perform(GraphRewrite event, EvaluationContext context){ ... } - });

    + });
    +
    -

    4.3.3. for( FooModel.class ){ …​ } - Single iteration

    +

    4.3.3. Single Iteration - for( FooModel.class ){ …​ }

    -

    For simple iterations, IteratingRuleProvider can be used, which makes the perform a bit less verbose:

    +

    For simple iterations, you can extend the IteratingRuleProvider class to simplify the perform code.

    @@ -2173,9 +2249,12 @@

    4.3.3. for( FooModel.class ){ R }

    +
    -

    4.3.4. if( …​ ){ for( …​ ) } - conditional iteration

    +

    4.3.4. Conditional Iteration - if( …​ ){ for( …​ ) }

    return ConfigurationBuilder.begin()
    @@ -2188,12 +2267,15 @@ 

    4.3.4. if( …​ ){ for( … )

    +
    -

    4.3.5. for( …​ ){ if( …​ ){ …​ } } - iteration with a condition

    +

    4.3.5. Iteration With a Condition - for( …​ ){ if( …​ ){ …​ } }

    -
    return ConfigurationBuilder.begin()
    +
    return ConfigurationBuilder.begin()
     .addRule()
         .when(
             // Stores all ArchiveModel's into variables stack, under that type.
    @@ -2212,17 +2294,32 @@ 

    4.3.5. for( …​ ){ if( &# return "ProjectModel == null"; } }) - .perform( ... )

    + .perform( ... )
    +
    -

    4.3.6. for( …​ ){ for( …​ ) { …​ } } - nested iterations

    +

    4.3.6. Nested Iterations - for( …​ ){ for( …​ ) { …​ } }

    -
    +
    .addRule()
    +     .when(...)
    +     .perform(Iteration //first iteration
    +     .over("list_variable").as("single_var")
    +     .perform(
    +         Iteration.over("single_var") //second iteration
    +         .perform(...).endIteration()
    +     )
    +     .endIteration()
    +);
    +
    @@ -2999,23 +3096,21 @@

    5.2.3. project Syntax

    Summary
    -

    Use the project element to find information in project files. For a better understanding of the project condition, see the JavaDoc for the Project class.

    +

    Use the project element to query for the project charateristics. For a better understanding of the project condition, see the JavaDoc for the Project class.

    -

    The following is an example of a rule that tests for an xmlfile.

    +

    The following is an example of a rule that checks a rule is dependent on the junit in the version between 2.0.0.Final and 2.2.0.Final.

    <rule>
         <when>
             <project>
    -            <artifact groupId="junit" artifactId="junit" from="MyEjbRule" to="???"/>
    +            <artifact groupId="junit" artifactId="junit" from="2.0.0.Final" to="2.2.0.Final"/>
             </project>
         </when>
         <perform>
    -        <hint title="Title for Hint for Project">
    -            <message>Descriptive message</message>
    -        </hint>
    +        <lineitem message="The project uses junit with the version between 2.0.0.Final and 2.2.0.Final"/>
         </perform>
     </rule>
    @@ -3026,7 +3121,7 @@
    Construct a project Element
    project Element Attributes
    -

    The project element does not have any attributes.

    +

    The project element is used to match against the project as a whole. You can use this condition to query for dependencies of the project. It does not have any attributes itself.

    @@ -3035,27 +3130,30 @@
    project Element Child Elements
    artifact
    -

    The namespace to referenced in XML files. This element contains the following attributes:

    +

    Subcondition used within project to query against project dependencies. This element contains the following attributes:

    • groupId="PROJECT_GROUP_ID"

      -

      Match on the project <groupId>

      +

      Match on the project <groupId> of the dependency

    • artifactId="PROJECT_ARTIFACT_ID" -Match on the project <artifactId>

      +Match on the project <artifactId> of the dependency

    • -

      from="VARIABLE_NAME"

      +

      fromVersion="FROM_VERSION"

      -

      Begin the search query with the filtered result from a previous search identified by its as VARIABLE_NAME.

      +

      Specify the lower version bound of the artifact. For example 2.0.0.Final

    • -

      to = TO_DO: complete the project artifact 'to' element syntax

      +

      toVersion="TO_VERSION"

      +
      +

      Specify the upper version bound of the artifact. For example 2.2.0.Final

      +
    @@ -3068,13 +3166,7 @@
    project Element Child Elements

    5.2.4. filecontent Syntax

    -

    TO_DO: complete the filecontent element syntax

    -
    -
    -

    Use the filecontent element to find information in file content.For a better understanding of the filecontent condition, see the JavaDoc for the FileContent class.

    -
    -
    -

    Use the filecontent element to test for content within files. The following is an example of a rule that tests for filecontent.

    +

    Use the filecontent element to find strings or text within files, for example, a line in a Properties file. For a better understanding of the filecontent condition, see the JavaDoc for the FileContent class.

    @@ -3585,20 +3677,23 @@

    5.4. Test an XML Rule in Windup

    5.4.1. Add the Rule to Windup

    -

    A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations:

    +

    A Windup rule is installed simply by copying the rule to the appropriate Windup folder. Windup scans for rules in the following locations for files ending with .windup.groovy and .windup.xml:

    • -

      The WINDUP_HOME/rules/ folder.

      +

      The directory specified in the --userRulesDirectory option to the windup-migrate-app.

      +
    • +
    • +

      The WINDUP_HOME/rules/ directory.

      -

      This is the folder where you run the Windup executable. See About the WINDUP_HOME Variable for details.

      +

      WINDUP_HOME is the directory where you run the Windup executable (see here).

    • -

      The ${user.home}/.windup/rules/ folder.

      +

      The ${user.home}/.windup/rules/ directory.

      -

      This folder is created by Windup the first time you execute Windup. It used to track rules and add-ons and to contains the Windup log.

      +

      The ${user.home}/.windup is a directory created by Windup at first run and contains rules, add-ons, and the Windup log.

      @@ -4435,7 +4530,7 @@

      8.3.3. Reporting Models

      -

      8.3.4. Custom Models (coming from Addons)

      +

      8.3.4. Custom Models (coming from add-ons)

      See respective ruleset’s documentation.

      @@ -4446,7 +4541,7 @@

      8.3.4. Custom Models (coming from Add

      diff --git a/html/WindupUserGuide-NO-TOC.html b/html/WindupUserGuide-NO-TOC.html new file mode 100644 index 0000000000..9b67109a75 --- /dev/null +++ b/html/WindupUserGuide-NO-TOC.html @@ -0,0 +1,1928 @@ + + + + + + + +Windup User Guide + + + + + +
      +
      +

      Overview

      +
      +
      +

      This guide is for engineers, consultants, and others who plan to use +Windup 2.0 to migrate Java applications or other components.

      +
      +
      +

      Windup Logo

      +
      +
      +
      +

      What is Windup?

      +
      +

      JBoss Windup is a rule-based tool to simplify application migrations.

      +
      +
      +

      Running from a Forge environment, the tool examines EAR, WAR, and +JAR deployments (or a project source directory) and produces an HTML report detailing the inner workings of +the Java application to simplify migration efforts. It seeks to make +migrating from other containers to JBoss EAP a piece of cake.

      +
      +
      +

      Windup 2.0 vs. Windup 0.7.x

      +
      +

      Windup 2.0 aims to deliver the same functionality as legacy Windup, however, the internal architecture and rule structure is very different and allows for the creation of much more complex rules.

      +
      +
      +
      +

      How Does Windup Simplify Migration?

      +
      +

      Windup looks for common resources and highlight technologies and known “trouble +spots” in migrating applications. The goal of Windup is to provide a +high level view into relevant technologies in use within the +application, and provide a consumable report for organizations to +estimate, document, and migrate enterprise applications to Java EE and JBoss EAP.

      +
      +
      +

      These are some of the of the areas targetted by current core Windup rulesets:

      +
      + ++++ + + + + + + + + + + + + + + + + + + + + +
      RulesetDescription

      Java code

      Reads compiled Java files, determines if blacklisted classes are imported, and if so, continues to profile the resource.

      JSP code

      Reads JSP files, extracts the JSP imports and taglibs, and continues to +profile the resource

      XML configuration

      Reads XML files into a DOM objects and continues to profile the resource.

      +
      +
      +

      Follow Windup on Twitter!

      +
      +

      Follow Windup on Twitter @JBossWindup for updates and more!

      +
      +
      +
      +
      +

      Features of Windup 2.0

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      +Shared Data Model + +

      Windup 2.0 creates a shared data model graph that provides the following benefits.

      +
      +
        +
      • +

        It enables complex rule interaction, allowing rules to pass findings to other rules.

        +
      • +
      • +

        It enables 3rd-party plug-ins to interact with other plugins, rules and reports.

        +
      • +
      • +

        The data graph organizes the findings to be searchable and queryable.

        +
      • +
      +
      +
      +Extensibility + +

      Windup 2.0 can be extended by developers, users, and 3rd-parties.

      +
      +
        +
      • +

        It provides a plug-in API to inject other applications into Windup.

        +
      • +
      • +

        It enables 3rd-parties to create simple POJO plug-ins that can interact with the data graph.

        +
      • +
      • +

        Means we don’t have to invent everything. Users with domain knowledge can implement their own rules.

        +
      • +
      +
      +
      +Better Rules + +

      Windup 2.0 provides more powerful and complex rules.

      +
      +
        +
      • +

        XML-based rules are simple to write and and easy to implement.

        +
      • +
      • +

        Java-based rule add-ons are based on OCPsoft Rewrite and provide greater flexibility and power creating when rules.

        +
      • +
      • +

        Rules can now be nested to handle more complex situations. This means you can nest simple statements rather than use complex XPATH or REGEX expressions. +*Rules can be linked using and/or statements

        +
      • +
      +
      +
      +Automation + +

      Windup 2.0 has the ability to automate some of the migration processes.

      +
      +
        +
      • +

        Windup is integrated with Forge 2.0, meaning it can generate projects, libraries, and configuration files.

        +
      • +
      • +

        Rules can create Forge inputs and put them into the data graph.

        +
      • +
      • +

        During the automation phase, the data graph inputs can be processed to generate a new project.

        +
      • +
      +
      +
      +Work Estimation + +

      Estimates for the level of effort is based on the skills required and the classification of migration work needed.

      +
      +
        +
      • +

        Lift and Shift - The code or file is standards-based and can be ported to the new environment with no changes.

        +
      • +
      • +

        Mapped - There is a standard mapping algorithm to port the code or file to the new environment.

        +
      • +
      • +

        Custom – The code or file must be rewritten or modified to work in the new environment.

        +
      • +
      +
      +
      +Better Reporting + +

      Windup 2.0 reports are now targeted for specific audiences.

      +
      +
        +
      • +

        IT Management - Applications are ranked by cost of migration.

        +
      • +
      • +

        Project Management - Reports detail the type of work and estimation of effort to complete the tasks.

        +
      • +
      • +

        Developers - An Eclipse plug-in provides hints and suggested code changes within the IDE.

        +
      • +
      +
      +
      +
      +
      +
      +

      About the WINDUP_HOME Variable

      +
      +

      This documentation uses the WINDUP_HOME replaceable value to denote the path to the Windup distribution. When you encounter this value in the documentation, be sure to replace it with the actual path to your Windup installation.

      +
      +
      +
        +
      • +

        If you download and install the latest distribution of Windup from the JBoss Nexus repository, WINDUP_HOME refers to the windup-distribution-2.0.0.VERSION folder extracted from the downloaded ZIP file.

        +
      • +
      • +

        If you build Windup from GitHub source, WINDUP_HOME refers to the windup-distribution-2.0.0-VERSION folder extracted from the Windup source dist/target/windup-distribution-2.0.0-VERSION.zip file.

        +
      • +
      +
      +
      +
      +
      +
      +

      Get Started

      +
      +
      +

      Install Windup

      +
      +

      Minimum System Requirements

      +
      +
        +
      • +

        Java Platform, Enterprise Edition 7

        +
      • +
      • +

        A minimum of 4 GB RAM. For better performance, a 4-core processor with 8 GB RAM is recommended. This allows 3 - 4 GB RAM for use by the JVM.

        +
      • +
      • +

        A minimum of 4 GB of free disk space. A fast disk, especially a Solid State Drive (SSD), will improve performance.

        +
      • +
      • +

        Windup is tested on Linux (Fedora), Mac OS X, and Windows. Other Operating Systems with Java 7 support should work equally well.

        +
      • +
      +
      +
      +
      +

      Download and Install Windup

      +
      +
        +
      1. +

        Download the latest Windup ZIP distribution.

        +
      2. +
      3. +

        Extract the ZIP file in to a directory of your choice.

        +
      4. +
      +
      +
      + + + + + +
      +
      Note
      +
      +If you used previous versions of Windup, delete the ${user.home}/.windup/ directory. Otherwise you may see errors like the following when you execute Windup: + Command: windup-migrate-app was not found +
      +
      +
      +
      +
      +

      Execute Windup

      +
      +

      Prerequisites

      +
      +

      Before you begin, you must gather the following information.

      +
      +
      +
        +
      1. +

        The fully qualified path of the application archive or folder you plan to migrate.

        +
      2. +
      3. +

        The fully qualified path to a folder that will contain the resulting report information.

        +
        +
          +
        • +

          If the folder does not exist, it is created by Windup.

          +
        • +
        • +

          If the folder exists, you are prompted with the message:

          +
          +
          +
          Overwrite all contents of <OUTPUT_DIRECTORY> (anything already in the directory will be deleted)? [y/N]
          +
          +
          +
          +

          Choose "y" if you want Windup to delete and recreate the directory.

          +
          +
        • +
        • +

          If you are confident you want to overwrite the output directory, you can specify --overwrite on the command line to automatically delete and recreate the directory.

          +
          + + + + + +
          +
          Note
          +
          +Be careful not to specify a directory that contains important information! +
          +
          +
        • +
        +
        +
      4. +
      5. +

        You must also provide a list of the application packages to be evaluated.

        +
        +
          +
        • +

          In most cases, you are interested only in evaluating the custom application class packages and not the standard Java EE or 3rd party packages. For example, if the MyCustomApp application uses the package com.mycustomapp, you provide that package using the --packages argument on the command line. It is not necessary to provide the standard Java EE packages, like java.util or javax.ejb.

          +
        • +
        • +

          While you can provide package names for standard Java EE 3rd party software like org.apache, it is usually best not to include them as they should not impact the migration effort.

          +
        • +
        • +

          If you omit the --packages argument, every package in the application is scanned, resulting in very slow performance. It is best to provide the argument with one or more packages.

          +
        • +
        +
        +
      6. +
      +
      +
      +
      +

      Start Windup

      +
      +

      For information about the use of WINDUP_HOME in the instructions below, see About the WINDUP_HOME Variable.

      +
      +
      +
        +
      1. +

        Open a terminal and navigate to the WINDUP_HOME/bin directory

        +
      2. +
      3. +

        Type the following command to start Windup:

        +
        +
        +
        For Linux:    WINDUP_HOME/bin $ ./windup
        +For Windows:  C:\WINDUP_HOME\bin> windup
        +
        +
        +
      4. +
      5. +

        You are presented with the following prompt.

        +
        +
        +
        Using Windup at WINDUP_HOME
        +
        + _       ___           __
        +| |     / (_)___  ____/ /_  ______
        +| | /| / / / __ \/ __  / / / / __ \
        +| |/ |/ / / / / / /_/ / /_/ / /_/ /
        +|__/|__/_/_/ /_/\__,_/\__,_/ .___/
        +                          /_/
        +
        +JBoss Windup, version [ 2.0.0-VERSION ] - JBoss, by Red Hat, Inc. [ http://windup.jboss.org ]
        +
        +[windup-distribution-2.0.0-VERSION]$
        +
        +
        +
      6. +
      +
      +
      +
      +

      Run Windup

      +
      +
        +
      1. +

        The command to run Windup is windup-migrate-app.

        +
      2. +
      3. +

        This command can take arbitrary options processed by different addons. The list of options in the core Windup distribution can be found in Javadoc. Most commonly used command line arguments are:

        +
        +
        +
        --input INPUT_ARCHIVE_OR_FOLDER
        +
        +

        This is the fully qualified application archive or source path.

        +
        +
        --output OUTPUT_REPORT_DIRECTORY
        +
        +

        The fully qualified path to the folder that will contain the the report information produced by Windup.

        +
        + + + + + +
        +
        Note
        +
        +If the OUTPUT_REPORT_DIRECTORY directory exists and you do not specify the --overwrite argument, you are prompted to overwrite the contents. If you respond "y", it is deleted and recreated by Windup, so be careful not to specify an output directory that contains important information! +
        +
        +
        +
        --overwrite (optional)
        +
        +

        Specify this optional argument only if you are certain you want to force Windup to delete the existing OUTPUT_REPORT_DIRECTORY. The default value is false.

        +
        +
        --userRulesDirectory
        +
        +

        Points to a directory to load XML rules from. (Search pattern: *.windup.groovy and *.windup.xml)

        +
        +
        --packages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)
        +
        +

        This is a comma-delimited list of the packages to be evaluated by Windup.

        +
        +
        --excludePackages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)
        +
        +

        This is a comma-delimited list of the packages to be excluded by Windup.

        +
        +
        --source-mode true (optional)
        +
        +

        This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

        +
        +
        +
        +
      4. +
      5. +

        To evaluate an application archive, use the following syntax:

        +
        +
        +
        windup-migrate-app --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
        +
        +
        +
        +

        To run Windup against application source code, you must add the --sourceMode true argument:

        +
        +
        +
        +
        windup-migrate-app --sourceMode true --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
        +
        +
        +
        +

        See Windup Command Examples below for concrete examples of commands that use source code directories and archives located in the Windup GitHub repository.

        +
        +
      6. +
      7. +

        You should see the following result upon completion of the command:

        +
        +
        +
        ***SUCCESS*** Windup execution successful!
        +
        +
        +
      8. +
      9. +

        To exit Windup, type:

        +
        +
        +
        exit
        +
        +
        +
      10. +
      11. +

        Open the OUTPUT_REPORT_DIRECTORY/index.html file in a browser to access the report. +The following subdirectories in the OUTPUT_REPORT_DIRECTORY contain the supporting information for the report:

        +
        +
        +
        OUTPUT_REPORT_DIRECTORY/
        +    graph/
        +    renderedGraph/
        +    reports/
        +    stats/
        +    index.html
        +
        +
        +
      12. +
      13. +

        For details on how to evaluate the report data, see Review the Report.

        +
      14. +
      +
      +
      +
      +

      Run Windup in Batch Mode

      +
      +

      Windup can be also executed in batch mode within a shell or batch script using the --evaluate argument as follows.

      +
      +
      +
        +
      1. +

        Open a terminal and navigate to the WINDUP_HOME directory.

        +
      2. +
      3. +

        Type the following command to run Windup in batch mode:

        +
        +
        +
        For Linux:     $ bin/windup --evaluate "windup-migrate-app --input INPUT_ARCHIVE --output OUTPUT_REPORT --packages PACKAGE_1 PACKAGE_2 PACKAGE_N"
        +For Windows:   > bin\windup.bat --evaluate "windup-migrate-app --input INPUT_ARCHIVE --output OUTPUT_REPORT --packages PACKAGE_1 PACKAGE_2 PACKAGE_N"
        +
        +
        +
      4. +
      +
      +
      +
      +

      Windup Help

      +
      +

      To see the complete list of available arguments for the windup-migrate-app command, execute the following command in the Windup prompt:

      +
      +
      +
      +
      man windup-migrate-app
      +
      +
      +
      +
      +

      Windup Command Examples

      +
      +

      The following Windup command examples report against applications located in the Windup source test-files directory.

      +
      +
      +
      Source Code Example
      +
      +

      The following command runs against the seam-booking-5.2 application source code. It evaluates all org.jboss.seam packages and creates a folder named 'seam-booking-report' in the /home/username/windup-reports/ directory to contain the reporting output.

      +
      +
      +
      +
      windup-migrate-app --sourceMode true --input /home/username/windup-source/test-files/seam-booking-5.2/ --output /home/username/windup-reports/seam-booking-report --packages org.jboss.seam
      +
      +
      +
      +
      +
      Archive Example
      +
      +

      The following command runs against the jee-example-app-1.0.0.ear EAR archive. It evaluates all com.acme and org.apache packages and creates a folder named 'jee-example-app-1.0.0.ear-report' in the /home/username/windup-reports/ directory to contain the reporting output.

      +
      +
      +
      +
      windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache
      +
      +
      +
      +
      +
      Windup Batch Example
      +
      +

      The following Windup batch command runs against the jee-example-app-1.0.0.ear EAR archive. It evaluates all com.acme and org.apache packages and creates a folder named 'jee-example-app-1.0.0.ear-report' in the /home/username/windup-reports/ directory to contain the reporting output.

      +
      +
      +
      +
      For Linux: $ bin/windup --evaluate "windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache"
      +For Windows: > bin\windup.bat --evaluate "windup-migrate-app --input \windup-source\test-files\jee-example-app-1.0.0.ear --output \windup-reports\jee-example-app-1.0.0.ear-report --packages com.acme org.apache
      +
      +
      +
      +
      +
      Windup Quickstart Examples
      +
      +

      For more concrete examples, see the Windup quickstarts located on GitHub here: https://github.com/windup/windup-quickstarts. If you prefer, you can download the 2.0.0.Alpha1 release ZIP or TAR distribution of the quickstarts.

      +
      +
      +

      The quickstarts provide examples of Java-based and XML-based rules you can run and test using Windup. The README instructions provide a step-by-step guide to run the quickstart example. You can also look through the code examples and use them as a starting point for creating your own rules.

      +
      +
      +
      +
      +
      +

      Review the Report

      +
      +

      About the Report

      +
      +

      When you execute Windup, the report is generated in the OUTPUT_REPORT_DIRECTORY you specify for the --output argument in the command line. This output directory contains the following files and subdirectories:

      +
      +
      +
        +
      • +

        index.html: This is the landing page for the report.

        +
      • +
      • +

        archives/: Contains the archives extracted from the application

        +
      • +
      • +

        graph/: Contains binary graph database files

        +
      • +
      • +

        reports/: This directory contains the generated HTML report files

        +
      • +
      • +

        stats/: Contains Windup performance statistics

        +
      • +
      +
      +
      +

      The examples below use the test-files/jee-example-app-1.0.0.ear located in the Windup GitHub source repository for input and specify the com.acme and org.apache package name prefixes to scan. For example:

      +
      +
      +
      +
      windup-migrate-app --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --packages com.acme org.apache
      +
      +
      +
      +
      +

      Open the Report

      +
      +

      Use your favorite browser to open the index.html file located in the output report directory. You should see something like the following:

      +
      +
      +

      Report Index Page

      +
      +
      +

      Click on the link under the Name column to view the Windup application report page.

      +
      +
      +
      +

      Report Sections

      +
      +
      Application Report Page
      +
      +

      The first section of the application report page summarizes the migration effort. It provides the total Story Points and a graphically displays the effort by technology. A Story Point is a term commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

      +
      +
      +
        +
      • +

        The migration of the JEE Example App EAR is assigned a total of 42 story points. A pie chart shows the breakdown of story points by package.

        +
      • +
      • +

        This is followed by a section for each of the archives contained in the EAR. It provides the total of the story points assigned to the archive and lists the files contained in archive along with the warnings and story point assigned to each file.

        +
      • +
      +
      +
      +

      The following is an example of a Windup Application Report.

      +
      +
      +

      Report Summary Page

      +
      +
      +
      +
      Archive Analysis Sections
      +
      +

      Each archive summary begins with a total of the story points assigned to its migration, followed by a table detailing the changes required for each file in the archive. The report contains the following columns.

      +
      +
      +
      +
      Name
      +
      +

      The name of the file being analyzed

      +
      +
      Technology
      +
      +

      The type of file being analyzed. For example:

      +
      +
        +
      • +

        Java Source

        +
      • +
      • +

        Decompiled Java File

        +
      • +
      • +

        Manifest

        +
      • +
      • +

        Properties

        +
      • +
      • +

        EJB XML

        +
      • +
      • +

        Spring XML

        +
      • +
      • +

        Web XML

        +
      • +
      • +

        Hibernate Cfg

        +
      • +
      • +

        Hibernate Mapping

        +
      • +
      +
      +
      +
      Issues
      +
      +

      Warnings about areas of code that need review or changes.

      +
      +
      Estimated Story Points
      +
      +

      Level of effort required for migrating the file.

      +
      +
      +
      +
      +

      The following is an example of the archive analysis summary section of a Windup Report. In this example, it’s the analysis of the WINDUP_SOURCE/test-files/jee-example-app-1.0.0.ear/jee-example-services.jar.

      +
      +
      +

      Report Archive Page

      +
      +
      +
      +
      File Analysis Pages
      +
      +

      The analysis of the jee-example-services.jar lists the files in the JAR and the warnings and story points assigned to each one. Notice the com.acme.anvil.listener.AnvilWebLifecycleListener file has 5 warnings and is assigned 7 story points. Click on the file to see the detail.

      +
      +
      +
        +
      • +

        The Information section provides a summary of the story points and notes that the file was decompiled by Windup.

        +
      • +
      • +

        This is followed by the file source code listing. Warnings appear in the file at the point where migration is required.

        +
      • +
      +
      +
      +

      In this example, warnings appear at the import of weblogic.application.ApplicationLifecycleEvent and report that the class is proprietary to WebLogic and must be removed.

      +
      +
      +

      File Detail - Part 1

      +
      +
      +

      Later in the code, warnings appear for the creation of the InitialContext and for the object name when registering and unregistering an MBeans

      +
      +
      +

      File Detail - Part 2

      +
      +
      +
      +
      +

      Additional Reports

      +
      +

      Explore the Windup OUTPUT_REPORT_DIRECTORY/reports folder to find additional reporting information.

      +
      +
      +
      Rule Provider Execution Report
      +
      +

      The OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html page provides the list of rule providers that executed when running the Windup migration command against the application.

      +
      +
      +

      RuleProvider Report

      +
      +
      +
      +
      Rule Provider Execution Report
      +
      +

      The OUTPUT_REPORT_DIRECTORY/reports/windup_ruleproviders.html page provides the list of rule providers that executed when running the Windup migration command against the application.

      +
      +
      +
      +
      Individual File Analysis Reports
      +
      +

      You can directly access the the file analysis report pages described above by browsing for them by name in the OUTPUT_REPORT_DIRECTORY/reports/ directory. Because the same common file names can exist in multiple archives, for example "manifest.mf" or "web.xml", Windup adds a unique numeric suffix to each report file name.

      +
      +
      +

      Report Directory File List

      +
      +
      +
      +
      +
      +
      +
      +

      Additional Resources

      +
      +
      +

      Review the Windup Quickstarts

      +
      +

      The Windup quickstarts provide working examples of how to create custom Java-based rule add-ons and XML rules. You can use them as a starting point for creating your own custom rules. The quickstarts are available on GitHub here: https://github.com/windup/windup-quickstarts

      +
      +
      +

      You can fork and clone the project to have access to regular updates or you can download a ZIP file of the latest version.

      +
      +
      +

      Download the Latest ZIP

      +
      +

      To download the latest quickstart ZIP file, browse to: https://github.com/windup/windup-quickstarts/releases

      +
      +
      +

      Click on the most recent release to download the ZIP to your local file system.

      +
      +
      +
      +

      Fork and Clone the GitHub Project

      +
      +

      If you don’t have the GitHub client (git), download it from: http://git-scm.com/

      +
      +
      +
        +
      1. +

        Click the Fork link on the Windup quickstart GitHub page to create the project in your own Git. The forked GitHub repository URL created by the fork should look like this: https://github.com/YOUR_USER_NAME/windup-quickstarts.git

        +
      2. +
      3. +

        Clone your Windup quickstart repository to your local file system:

        +
        +
        +
        git clone https://github.com/YOUR_USER_NAME/windup-quickstarts.git
        +
        +
        +
      4. +
      5. +

        This creates and populates a windup-quickstarts directory on your local file system. Navigate to the newly created directory, for example

        +
        +
        +
        cd windup-quickstarts/
        +
        +
        +
      6. +
      7. +

        If you want to be able to retrieve the lates code updates, add the remote upstream repository so you can fetch any changes to the original forked repository.

        +
        +
        +
        git remote add upstream https://github.com/windup/windup-quickstarts.git
        +
        +
        +
      8. +
      9. +

        To get the latest files from the upstream repository.

        +
        +
        +
        git reset --hard upstream/master
        +
        +
        +
      10. +
      +
      +
      +
      +
      +

      Get Involved

      +
      +

      How can you help?

      +
      +

      To help us make Windup cover most application constructs and server configurations, including yours, you can help with any of the following items. Some items require only a few minutes of your time!

      +
      +
      +
        +
      • +

        Let us know what Windup migration rules should cover.

        +
      • +
      • +

        Provide example applications to test migration rules.

        +
      • +
      • +

        Identify application components and problem areas that may be difficult to migrate.

        +
        +
          +
        • +

          Write a short description of these problem migration areas.

          +
        • +
        • +

          Write a brief overview describing how to solve the problem migration areas.

          +
        • +
        +
        +
      • +
      • +

        Try Windup on your application. Be sure to report any issues you encounter.

        +
      • +
      • +

        You can contribute Windup rules.

        +
        +
          +
        • +

          Write a Windup rule add-on to automate a migration process.

          +
        • +
        • +

          Create a test for the new rule.

          +
        • +
        • +

          For details, see the Windup Rules Development Guide.

          +
        • +
        +
        +
      • +
      • +

        You can also contribute to the project source code.

        +
        +
          +
        • +

          Create a core rule.

          +
        • +
        • +

          Improve performance or efficiency.

          +
        • +
        • +

          See the_Windup Core Development Guide_ for information about how to configure your environment and set up the project.

          +
        • +
        +
        +
      • +
      +
      +
      +

      Any level of involvement is greatly appreciated!

      +
      +
      +
      + +
      + +
      +
      +

      You can also follow us on this IRC channel: irc.freenode.net#windup.

      +
      +
      +
      +
      +

      Known Windup Issues

      +
      +

      Windup known issues are tracked here: Open Windup issues

      +
      +
      +
      +

      Report Issues with Windup

      +
      +

      Windup uses JIRA as its issue tracking system. If you encounter an issue executing Windup, please file a Windup JIRA Issue.

      +
      +
      +

      Create a JIRA Account

      +
      +

      If you do not yet have a JIRA account, create one using the following procedure.

      +
      +
      +
        +
      1. +

        Open a browser to the following URL: https://issues.jboss.org/secure/Dashboard.jspa

        +
      2. +
      3. +

        Click the Sign Up link in the top right side of the page.

        +
      4. +
      5. +

        Enter your email address and click the Confirm address button.

        +
      6. +
      7. +

        Follow the instructions sent to your email address.

        +
      8. +
      +
      +
      +
      +

      Create a JIRA Issue

      +
      +
        +
      1. +

        Open a browser to the following URL: https://issues.jboss.org/secure/CreateIssue!default.jspa.

        +
        +
          +
        • +

          If you have not yet logged in, click the Log In link at the top right side of the page.

          +
        • +
        • +

          Enter your credentials and click the LOGIN button.

          +
        • +
        • +

          You are then redirected back to the Create Issue page.

          +
        • +
        +
        +
      2. +
      3. +

        Choose the following options and click the Next button.

        +
        +
          +
        • +

          Project: Windup

          +
        • +
        • +

          Issue Type: Bug

          +
        • +
        +
        +
      4. +
      5. +

        On the next screen complete the following fields:

        +
        +
          +
        • +

          Summary: Enter a brief description of the problem or issue.

          +
        • +
        • +

          Environment: Provide the details of your operating system, version of Java, and any other pertinent information.

          +
        • +
        • +

          Description: Provide a detailed description of the issue. Be sure to include logs and exceptions traces.

          +
        • +
        +
        +
      6. +
      7. +

        Click the Create button to create the JIRA issue.

        +
      8. +
      9. +

        If the application or archive causing the issue does not contain sensitive information and you are comfortable sharing it with the Windup development team, attach it to the issue by choosing More → Attach Files. You are provided with an option to restrict visibility to JBoss employees.

        +
      10. +
      +
      +
      +
      +
      +
      +
      +

      Appendix

      +
      +
      +

      Glossary of Terms Used in Windup

      +
      +

      Rules Terms

      +
      +
      +
      Rule
      +
      +

      A piece of code that performs a single unit of work during the migration process. Depending on the complexity of the rule, it may or may not include configuration data. Extensive configuration information may be externalized into external configuration, for example, a custom XML file. The following is an example of a Java-based rule added to the JDKConfig RuleProvider class.

      +
      +
      +
      +
      +
      +
      .addRule()
      +    .when(JavaClass.references("java.lang.ClassLoader$").at(TypeReferenceLocation.TYPE))
      +    .perform(Classification.as("Java Classloader, must be migrated.")
      +    .with(Link.to("Red Hat Customer Portal: How to get resources via the ClassLoader in a JavaEE application in JBoss EAP",  "https://access.redhat.com/knowledge/solutions/239033"))
      +     .withEffort(1))
      +
      +
      +
      +
      +
      RuleProvider
      +
      +

      A class that implements one or more rules using the .addRule() method. The following are examples of legacy Java RulesProviders that are defined in rules-java-ee ruleset.

      +
      +
        +
      • +

        EjbConfig

        +
      • +
      • +

        JDKConfig

        +
      • +
      • +

        SeamToCDI

        +
      • +
      +
      +
      +
      Ruleset
      +
      +

      A ruleset is a group of one or more RuleProviders that targets a specific area of migration, for example, Spring → Java EE 6 or WebLogic → JBoss EAP. A ruleset is packaged as a JAR and contains additional information needed for the migration, such as operations, conditions, report templates, static files, metadata, and relationships to other rulesets. The following Windup projects are rulesets.

      +
      +
        +
      • +

        rules-java-ee

        +
      • +
      • +

        rules-xml

        +
      • +
      +
      +
      +
      Rules Metadata
      +
      +

      Information about whether a particular ruleset applies to a given situation. The metadata can include the source and target platform and frameworks.

      +
      +
      Rules Pipeline
      +
      +

      A collection of rules that feed information into the knowledge graph.

      +
      +
      +
      +
      +
      +

      Reporting Terms

      +
      +
      +
      Lift and Shift (Level of effort)
      +
      +

      The code or file is standards-based and can be ported to the new environment with no changes.

      +
      +
      Mapped (Level of effort)
      +
      +

      There is a standard mapping algorithm to port the code or file to the new environment.

      +
      +
      Custom (Level of effort)
      +
      +

      The code or file must be rewritten or modified to work in the new environment.

      +
      +
      Story Point
      +
      +

      A term commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

      +
      +
      +
      +
      +
      +
      +

      Windup Processing Overview

      +
      +

      Windup is a rule-based migration tool that allows you to write customized rules to analyze the APIs, technologies, and architectures used by the applications you plan to migrate. The Windup tool also executes its own core rules through all phases of the migration process.

      +
      +
      +

      The following is a high level conceptual overview of what happens within Windup when you execute the tool against your application or archive.

      +
      +
      +

      Discovery Phase

      +
      +

      Wnen you run the windup-migrate-app command, Windup executes its own core rules to extract files from archives, decompile classes, and analyze the application. In this phase Windup builds a data model and stores component data and relationships in a graph database, which can then be queried and updated as needed by the migration rules and for reporting purposes.

      +
      +
      +

      For more information about the phases of rule execution and how to control rule dependencies, see Rule Execution Lifecycle.

      +
      +
      +

      For more information about the graph database components, see Windup Architectural Components.

      +
      +
      +
      +

      Application Migration

      +
      +

      The next step in the process is the execution of the migration rules. In this phase, the rules typically do not execute against the application input files. Instead, they execute against the graph database model. Windup rules are independent and decoupled and they communicate with each other using the graph database model. Rules query the graph database to obtain information needed to test the rule condition. They also update the data model with information based on the result of the rule execution. This allows rules to easily interact with other rules and enables the creation of very complex rules.

      +
      +
      +

      The Windup distribution contains a large number of migration rules, but in some cases, you may need to create additional custom rules for your specific implementation. Windup’s architecture allows you to create Java-based rule addons or XML rules and add easily add them to Windup. Custom rule creation is covered in the Windup Rules Development Guide.

      +
      +
      +
      +

      Generate Findings Based on the Rule Execution Results

      +
      +

      The final step in the process is to pull data from the graph database model to generate of reports and optionally generate scripts. Again, Windup uses rules to generate the final output.

      +
      +
      +

      By default, Windup generates the following reports at the end of the application migration process. The reports are located in the reports/ subdirectory of the output report path specified when you execute Windup:

      +
      +
      +
        +
      • +

        Application Report: This report provides a summary of the total estimated effort, or story points, that are required for the migration. It also provides a detailed list of issues and suggested changes, broken down by archive or folder.

        +
      • +
      • +

        RuleProvider report: This is a detailed listing of the rule providers that fired when running Windup and whether any errors occurred.

        +
      • +
      • +

        Additional reports are generated that provide detailed line-by-line migration tips for individual files.

        +
      • +
      +
      +
      +

      Windup can also generate scripts to automate migration processes based on the findings. For example, some configuration files are easily mapped and can be automatically generated as part of the migration process.

      +
      +
      +
      +
      +

      Windup Architectural Components

      +
      +

      The following open source software, tools, and APIs are used within +Windup to analyze and provide migration information. If you plan to +contribute source code to the core Windup 2.0 project, you should be +familiar with them.

      +
      +
      +

      Forge

      +
      +

      Forge is an open source, extendable, rapid application development tool +for creating Java EE applications using Maven. For more information +about Forge 2, see: JBoss Forge.

      +
      +
      +
      +

      Forge Furnace

      +
      +

      Forge Furnace is a modular runtime container behind Forge that provides +the ability to run Forge add-ons in an embedded application. For more +information about Forge Furnace, see: +Run Forge Embedded.

      +
      +
      +
      +

      TinkerPop

      +
      +

      TinkerPop is an open source graph computing framework. For more +information, see: TinkerPop.

      +
      +
      +
      +

      Titan

      +
      +

      Titan is a scalable graph database optimized for storing and querying graphs. +For more information, see: Titan Distributed Graph Database and Titan Beginner’s Guide.

      +
      +
      +
      +

      Frames

      +
      +

      Frames represents graph data in the form of interrelated Java Objects or +a collection of annotated Java Interfaces. For more information, see: +TinkerPop Frames.

      +
      +
      +

      Windup includes several Frames extensions, which are documented here: +Frames Extensions.

      +
      +
      +
      +

      Gremlin

      +
      +

      Gremlin is a graph traversal language that allows you to query, analyze, +and manipulate property graphs that implement the Blueprints property +graph data model. For more information, see: +TinkerPop Gremlin Wiki.

      +
      +
      +
      +

      Blueprints

      +
      +

      Blueprints is an industry standard API used to access graph databases. +For more information about Blueprints, see: +TinkerPop Blueprints Wiki.

      +
      +
      +
      +

      Pipes

      +
      +

      Pipes is a dataflow framework used to process graph data. It for the +transformation of data from input to output. For more information, see: +Tinkerpop Pipes Wiki.

      +
      +
      +
      +

      Rexster

      +
      +

      Rexster is a graph server that exposes any Blueprints graph through HTTP/REST and a binary protocol called RexPro. Rexster makes extensive use of Blueprints, Pipes, and Gremlin. For more information, see: +TinkerPop Rexster Wiki.

      +
      +
      +
      +

      OCPsoft Rewrite

      +
      +

      OCPsoft Rewrite is an open source routing and URL rewriting solution for +Servlets, Java Web Frameworks, and Java EE. For more information about +Ocpsoft Rewrite, see: OCPsoft Rewrite.

      +
      +
      +
      +
      +

      Rule Execution Lifecycle

      +
      +

      Rule Lifecycle

      +
      +

      Windup executes each rule in a sequential order. The following +sections describe the phases of rule execution and how rules may specify +that one or more other rules must be executed before or after they are +run.

      +
      +
      +

      For a graphical overview of rule processing, see +this +diagram.

      +
      +
      +
      +

      Rule Phases

      +
      +
      +
      INFO: Loaded [67] org.jboss.windup.config.WindupRuleProvider [
      +org.jboss.windup.config.phase.Implicit
      +org.jboss.windup.config.phase.Initialization
      +org.jboss.windup.config.phase.Discovery
      +org.jboss.windup.config.phase.ArchiveExtraction
      +org.jboss.windup.config.phase.ArchiveMetadataExtraction
      +org.jboss.windup.config.phase.ClassifyFileTypes
      +org.jboss.windup.config.phase.DiscoverProjectStructure
      +org.jboss.windup.config.phase.Decompilation
      +org.jboss.windup.config.phase.InitialAnalysis
      +org.jboss.windup.config.phase.MigrationRules
      +org.jboss.windup.config.phase.PostMigrationRules
      +org.jboss.windup.config.phase.PreReportGeneration
      +org.jboss.windup.config.phase.ReportGeneration
      +org.jboss.windup.config.phase.PostReportGeneration
      +org.jboss.windup.config.phase.ReportRendering
      +org.jboss.windup.config.phase.PostReportRendering
      +org.jboss.windup.config.phase.Finalize
      +org.jboss.windup.config.phase.PostFinalize
      +]
      +
      +
      +
      +

      By default, a rule runs during the MIGRATION_RULES phase. However, a +rule may require certain processing or actions to occur before it +executes, such as the extraction of archives and scanning of java or XML +files.

      +
      +
      +

      Rule phases provide a way for rule authors to specify and control in +which phase of the rule lifecycle the rule should execute. This is done +by overriding the WindupRuleProvider.getPhase() method. The following +example specifies this rule should execute during the INITIAL_ANALYSIS rule phase.

      +
      +
      +
      +
      @Override
      +public RulePhase getPhase() {
      +    return InitialAnalysis.class;
      +}
      +
      +
      +
      +

      The following is the list of rule phases as defined in the RulePhase +enum class. Note that there are also PRE_ processing and POST_ +processing phases for each of the following rule phases.

      +
      +
      +
      +
      DISCOVERY
      +
      +

      This phase is called during resource discovery. Static files are scanned +by their basic properties, for example, the name, extension, location, +and fully qualified Java class name. Archives are unzipped in this +phase. Typically, any rule that only puts data into the graph is +executed during this phase.

      +
      +
      INITIAL_ANALYSIS
      +
      +

      This phase is called to perform a basic analysis of the files content. +It extracts all method names from class files, extracts metadata, such +as the XML namespace and root element, from XML files.

      +
      +
      COMPOSITION
      +
      +

      This phase is called to perform high-level composition operations on the +graph. For example, it may link items found in XML files to the related +Java classes or references to server resources in Java classes.

      +
      +
      MIGRATION_RULES
      +
      +

      This phase is the default phase for all rules unless overridden. +During this phase, migration rules attach data to the graph associated +with migration. This could include: - Hints to migrators for manual +migration - Automated migration of schemas or source segments - +Blacklists to indicate vendor specific APIs.

      +
      +
      REPORT_GENERATION
      +
      +

      During this phase, reporting visitors produce report data in the graph +that will later be used by the report rendering phase.

      +
      +
      REPORT_RENDERING
      +
      +

      This is the phase that renders the report.

      +
      +
      FINALIZE
      +
      +

      This phase is called to clean up resources and close streams.

      +
      +
      +
      +
      +

      For more information about rule phases, see the RulePhase Javadoc.

      +
      +
      +
      +

      Execute Before and Execute After

      +
      +

      A rule may specify that one or more rules must be executed before it is +run. In this case, all named rules will be fired in the order specified +before executing the the current rule.

      +
      +
      +
      +
      @Override
      +public List<Class<? extends WindupRuleProvider>> getExecuteBefore()
      +{
      +   return asClassList(RuleToFireBefore.class);
      +}
      +
      +
      +
      +

      A rule may also specify that one or more rules must be executed after it +is run. In this case, all named rules will be fired in the order +specified after executing the the current rule.

      +
      +
      +
      +
      @Override
      +public List<Class<? extends WindupRuleProvider>> getExecuteAfter()
      +{
      +    return asClassList(RuleToFireAfter.class);
      +}
      +
      +
      +
      +
      +
      +

      Rule Story Points

      +
      +

      What are Story Points?

      +
      +

      Story points are an abstract metric commonly used in Scrum Agile software development methodology to estimate the level of effort needed to implement a feature or change. They are based on a modified Fibonacci sequence.

      +
      +
      +

      In a similar manner, Windup uses story points to express the level of effort needed to migrate particular application constructs, and in a sum, the application as a whole. It does not necessarily translate to man-hours, but the value should be consistent across tasks.

      +
      +
      +
      +

      How Story Points are Estimated in Rules

      +
      +

      Estimating story points for a rule can be tricky. The following are the general guidelines Windup uses when estimating the level of effort required for a rule.

      +
      + +++++ + + + + + + + + + + + + + + + + + + + + + + + + +
      Level of EffortStory PointsDescription

      Lift and Shift

      0

      The code or file is standards-based and requires no effort.

      Mapped

      1- 2 per file

      There is a standard mapping algorithm to port the code or file. The number of story points required is small, but is dependent on the number of files to port.

      Custom

      5 - 20 per change or component

      +

      The number of story points required to modify and rewrite code depends on the complexity of the change, the number of unknown imports, the size of the files, and the number of components. The following are examples of how to estimate story points.

      +
      +
      +
        +
      • +

        Port MyBatis to JPA: '20' story points per query.

        +
      • +
      • +

        Port a web page from one web framework to another depends on the complexity and the number of components involved in the migration. You could estimate '20' story points per component.

        +
      • +
      +
      +
      +
      +
      +
      +
      + + + \ No newline at end of file diff --git a/html/WindupUserGuide.html b/html/WindupUserGuide.html index ac75eed0d7..0be0d47f47 100644 --- a/html/WindupUserGuide.html +++ b/html/WindupUserGuide.html @@ -458,7 +458,7 @@

      1. Overview

      Windup 2.0 to migrate Java applications or other components.

      -

      Windup Logo

      +

      Windup Logo


      @@ -844,17 +844,13 @@

      2.2.3. Run Windup

      The command to run Windup is windup-migrate-app.

    • -

      The following is a list of the most commonly used command line arguments.

      +

      This command can take arbitrary options processed by different addons. The list of options in the core Windup distribution can be found in Javadoc. Most commonly used command line arguments are:

      --input INPUT_ARCHIVE_OR_FOLDER

      This is the fully qualified application archive or source path.

      -
      --source-mode true (optional)
      -
      -

      This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

      -
      --output OUTPUT_REPORT_DIRECTORY

      The fully qualified path to the folder that will contain the the report information produced by Windup.

      @@ -875,6 +871,10 @@

      2.2.3. Run Windup

      Specify this optional argument only if you are certain you want to force Windup to delete the existing OUTPUT_REPORT_DIRECTORY. The default value is false.

      +
      --userRulesDirectory
      +
      +

      Points to a directory to load XML rules from. (Search pattern: *.windup.groovy and *.windup.xml)

      +
      --packages PACKAGE_1, PACKAGE_2, PACKAGE_N (optional)

      This is a comma-delimited list of the packages to be evaluated by Windup.

      @@ -883,6 +883,10 @@

      2.2.3. Run Windup

      This is a comma-delimited list of the packages to be excluded by Windup.

      +
      --source-mode true (optional)
      +
      +

      This argument is optional and is only required if the application to be evaluated contains source files rather than compiled binaries. The default value is false.

      +
    • @@ -1953,7 +1957,7 @@

      4.5.2. How Story Points are Es

    diff --git a/html/images/.DS_Store b/html/images/.DS_Store new file mode 100644 index 0000000000..5008ddfcf5 Binary files /dev/null and b/html/images/.DS_Store differ diff --git a/html/images/2-extending-s1.png b/html/images/2-extending-s1.png new file mode 100644 index 0000000000..7596447533 Binary files /dev/null and b/html/images/2-extending-s1.png differ diff --git a/html/images/2-extending-s2.png b/html/images/2-extending-s2.png new file mode 100644 index 0000000000..902cb93c95 Binary files /dev/null and b/html/images/2-extending-s2.png differ diff --git a/html/images/5-main-menu.png b/html/images/5-main-menu.png new file mode 100644 index 0000000000..a3c6d3439f Binary files /dev/null and b/html/images/5-main-menu.png differ diff --git a/html/images/6-archive-overview.png b/html/images/6-archive-overview.png new file mode 100644 index 0000000000..e724838c1d Binary files /dev/null and b/html/images/6-archive-overview.png differ diff --git a/html/images/6-java-classification-1.png b/html/images/6-java-classification-1.png new file mode 100644 index 0000000000..72d6cabbb2 Binary files /dev/null and b/html/images/6-java-classification-1.png differ diff --git a/html/images/6-java-hint1.png b/html/images/6-java-hint1.png new file mode 100644 index 0000000000..7a102a95d4 Binary files /dev/null and b/html/images/6-java-hint1.png differ diff --git a/html/images/6-java-hint2.png b/html/images/6-java-hint2.png new file mode 100644 index 0000000000..c9e699f74e Binary files /dev/null and b/html/images/6-java-hint2.png differ diff --git a/html/images/6-resource-classification.png b/html/images/6-resource-classification.png new file mode 100644 index 0000000000..6ec5681de9 Binary files /dev/null and b/html/images/6-resource-classification.png differ diff --git a/html/images/GraphOperationSubtypes.png b/html/images/GraphOperationSubtypes.png new file mode 100644 index 0000000000..8b396a3fd5 Binary files /dev/null and b/html/images/GraphOperationSubtypes.png differ diff --git a/html/images/WindupModels-NbScreenshot.png b/html/images/WindupModels-NbScreenshot.png new file mode 100644 index 0000000000..56d34cbfa0 Binary files /dev/null and b/html/images/WindupModels-NbScreenshot.png differ diff --git a/html/images/directory-setup.png b/html/images/directory-setup.png new file mode 100644 index 0000000000..86aa06bf2e Binary files /dev/null and b/html/images/directory-setup.png differ diff --git a/html/images/report-directory-file-list.png b/html/images/report-directory-file-list.png new file mode 100644 index 0000000000..dff0be23c2 Binary files /dev/null and b/html/images/report-directory-file-list.png differ diff --git a/html/images/report-example.png b/html/images/report-example.png new file mode 100644 index 0000000000..eda6d349b7 Binary files /dev/null and b/html/images/report-example.png differ diff --git a/html/images/report-index-page.png b/html/images/report-index-page.png new file mode 100644 index 0000000000..92c38b26bf Binary files /dev/null and b/html/images/report-index-page.png differ diff --git a/html/images/report-javaee-ear-01-summary.png b/html/images/report-javaee-ear-01-summary.png new file mode 100644 index 0000000000..b10d12b2e9 Binary files /dev/null and b/html/images/report-javaee-ear-01-summary.png differ diff --git a/html/images/report-javaee-ear-02-ear.png b/html/images/report-javaee-ear-02-ear.png new file mode 100644 index 0000000000..c8ceb1e90d Binary files /dev/null and b/html/images/report-javaee-ear-02-ear.png differ diff --git a/html/images/report-javaee-ear-03-services-jar.png b/html/images/report-javaee-ear-03-services-jar.png new file mode 100644 index 0000000000..95e7c8552c Binary files /dev/null and b/html/images/report-javaee-ear-03-services-jar.png differ diff --git a/html/images/report-javaee-ear-04-war.png b/html/images/report-javaee-ear-04-war.png new file mode 100644 index 0000000000..9dfe08b8be Binary files /dev/null and b/html/images/report-javaee-ear-04-war.png differ diff --git a/html/images/report-javaee-ear-file-detail-part1.png b/html/images/report-javaee-ear-file-detail-part1.png new file mode 100644 index 0000000000..771363e92c Binary files /dev/null and b/html/images/report-javaee-ear-file-detail-part1.png differ diff --git a/html/images/report-javaee-ear-file-detail-part2.png b/html/images/report-javaee-ear-file-detail-part2.png new file mode 100644 index 0000000000..cc76dec384 Binary files /dev/null and b/html/images/report-javaee-ear-file-detail-part2.png differ diff --git a/html/images/report-javaee-ear-ruleprovider.png b/html/images/report-javaee-ear-ruleprovider.png new file mode 100644 index 0000000000..e0c92a1219 Binary files /dev/null and b/html/images/report-javaee-ear-ruleprovider.png differ diff --git a/html/images/report-javaee-ear-summary.png b/html/images/report-javaee-ear-summary.png new file mode 100644 index 0000000000..58ecbd5471 Binary files /dev/null and b/html/images/report-javaee-ear-summary.png differ diff --git a/html/images/rh-logo.png b/html/images/rh-logo.png new file mode 100644 index 0000000000..e36f442aef Binary files /dev/null and b/html/images/rh-logo.png differ diff --git a/html/images/windup-logo-large.png b/html/images/windup-logo-large.png new file mode 100644 index 0000000000..86da5748e1 Binary files /dev/null and b/html/images/windup-logo-large.png differ diff --git a/html/images/windup-logo-wiki-header.jpg b/html/images/windup-logo-wiki-header.jpg new file mode 100644 index 0000000000..78d02937b3 Binary files /dev/null and b/html/images/windup-logo-wiki-header.jpg differ diff --git a/pdf/WindupCoreDevelopmentGuide.pdf b/pdf/WindupCoreDevelopmentGuide.pdf new file mode 100644 index 0000000000..dd88e27a75 Binary files /dev/null and b/pdf/WindupCoreDevelopmentGuide.pdf differ diff --git a/pdf/WindupRulesDevelopmentGuide.pdf b/pdf/WindupRulesDevelopmentGuide.pdf new file mode 100644 index 0000000000..3b9c8b3a8f Binary files /dev/null and b/pdf/WindupRulesDevelopmentGuide.pdf differ diff --git a/pdf/WindupUserGuide.pdf b/pdf/WindupUserGuide.pdf new file mode 100644 index 0000000000..d8f9382bc9 Binary files /dev/null and b/pdf/WindupUserGuide.pdf differ diff --git a/scripts/windupDocCopyWiki.sh b/scripts/windupDocCopyWiki.sh new file mode 100755 index 0000000000..9d8e3fbb6f --- /dev/null +++ b/scripts/windupDocCopyWiki.sh @@ -0,0 +1,113 @@ +if [ "$1" == "" ]; then + + echo "You must pass the path to the windup.wiki GitHub directories on the command line." + echo "For example: scripts/windupDocCopyWiki.sh ~/GitRepos/windup.wiki" + exit +fi +echo "*******************************************" +echo "Copying files from: " $1 +echo "*******************************************" +cp $1/About-the-WINDUP_HOME-Variable.asciidoc docs/About-the-WINDUP_HOME-Variable.adoc +cp $1/About-the-Windup-Wiki.asciidoc docs/About-the-Windup-Wiki.adoc +cp $1/Core-Development-Guide.asciidoc docs/Core-Development-Guide.adoc ## this topic is not used +cp $1/Dev-Add-Images-to-the-Windup-Wiki.asciidoc docs/Dev-Add-Images-to-the-Windup-Wiki.adoc +cp $1/Dev-Build-Windup-from-Source.asciidoc docs/Dev-Build-Windup-from-Source.adoc +cp $1/Dev-Classloading-Notes.asciidoc docs/Dev-Classloading-Notes.adoc +cp $1/Dev-Concepts-and-Philosophy.asciidoc docs/Dev-Concepts-and-Philosophy.adoc +cp $1/Dev-Connect-to-the-Graph-via-Rexster.asciidoc docs/Dev-Connect-to-the-Graph-via-Rexster.adoc +cp $1/Dev-Create-Windup-JavaDoc.asciidoc docs/Dev-Create-Windup-JavaDoc.adoc +cp $1/Dev-Customer-Portal-Tags.asciidoc docs/Dev-Customer-Portal-Tags.adoc ## this topic is not used +cp $1/Dev-Debugging-and-Profiling.asciidoc docs/Dev-Debugging-and-Profiling.adoc +cp $1/Dev-Decompiling.asciidoc docs/Dev-Decompiling.adoc +cp $1/Dev-Dependencies.asciidoc docs/Dev-Dependencies.adoc +cp $1/Dev-Development-Guidelines-and-Conventions.asciidoc docs/Dev-Development-Guidelines-and-Conventions.adoc +cp $1/Dev-Execute-Windup-Built-from-Source.asciidoc docs/Dev-Execute-Windup-Built-from-Source.adoc +cp $1/Dev-Frames-Extensions.asciidoc docs/Dev-Frames-Extensions.adoc +cp $1/Dev-Get-the-Windup-Source-Code.asciidoc docs/Dev-Get-the-Windup-Source-Code.adoc +cp $1/Dev-Git-Rebasing.asciidoc docs/Dev-Git-Rebasing.adoc +cp $1/Dev-How-to-Write-a-Rule-Test.asciidoc docs/Dev-How-to-Write-a-Rule-Test.adoc ## this topic is not used +cp $1/Dev-Internal-API-Features.asciidoc docs/Dev-Internal-API-Features.adoc +cp $1/Dev-Jenkins-Setup.asciidoc docs/Dev-Jenkins-Setup.adoc ## this topic is not used +cp $1/Dev-Logging.asciidoc docs/Dev-Logging.adoc +cp $1/Dev-Port-WindRide-Functionality-to-Windup.asciidoc docs/Dev-Port-WindRide-Functionality-to-Windup.adoc +cp $1/Dev-Release-Checklist.asciidoc docs/Dev-Release-Checklist.adoc ## this topic is not used +cp $1/Dev-Rule-Documentation-Tracker.asciidoc docs/Dev-Rule-Documentation-Tracker.adoc ## this topic is not used +cp $1/Dev-Rule-Metadata-and-API-Discrepancies.asciidoc docs/Dev-Rule-Metadata-and-API-Discrepancies.adoc ## this topic is not used +cp $1/Dev-Submit-Code-Updates-to-the-Windup-Project.asciidoc docs/Dev-Submit-Code-Updates-to-the-Windup-Project.adoc +cp $1/Dev-Team-Meeting.asciidoc docs/Dev-Team-Meeting.adoc ## this topic is not used +cp $1/Dev-Test-Logging.asciidoc docs/Dev-Test-Logging.adoc ## this topic is not used +cp $1/Dev-Troubleshoot-Windup-Issues.asciidoc docs/Dev-Troubleshoot-Windup-Issues.adoc +cp $1/Dev-Variables-Stack.asciidoc docs/Dev-Variables-Stack.adoc +cp $1/Dev-Windup-Bootstrap.asciidoc docs/Dev-Windup-Bootstrap.adoc +cp $1/Dev-Windup-Configuration.asciidoc docs/Dev-Windup-Configuration.adoc ## this topic is not used +cp $1/Dev-Windup-Documentation-Process.asciidoc docs/Dev-Windup-Documentation-Process.adoc +cp $1/Dev-Windup-Project-Information.asciidoc docs/Dev-Windup-Project-Information.adoc +cp $1/Dev-Windup-Project-Structure.asciidoc docs/Dev-Windup-Project-Structure.adoc +cp $1/Dev-Windup-Release-Process.asciidoc docs/Dev-Windup-Release-Process.adoc +cp $1/Dev-Windup-Web.asciidoc docs/Dev-Windup-Web.adoc ## this topic is not used +cp $1/Execute-Windup.asciidoc docs/Execute-Windup.adoc +cp $1/Extend-Windup-Rules.asciidoc docs/Extend-Windup-Rules.adoc ## this topic is not used +cp $1/Features-of-Windup-2.0.asciidoc docs/Features-of-Windup-2.0.adoc +cp $1/Get-Involved.asciidoc docs/Get-Involved.adoc +cp $1/Glossary.asciidoc docs/Glossary.adoc +cp $1/Home.asciidoc docs/Home.adoc ## this topic is not used +cp $1/Install-and-Configure-Maven.asciidoc docs/Install-and-Configure-Maven.adoc +cp $1/Install-Windup.asciidoc docs/Install-Windup.adoc +cp $1/Known-Issues.asciidoc docs/Known-Issues.adoc +cp $1/Migration-Planning-Guide.asciidoc docs/Migration-Planning-Guide.adoc ## this topic is not used +cp $1/Migration-Planning-Process.asciidoc docs/Migration-Planning-Process.adoc ## this topic is not used +cp $1/Migration-Technology-Categories.asciidoc docs/Migration-Technology-Categories.adoc ## this topic is not used +cp $1/News.asciidoc docs/News.adoc ## this topic is not used +cp $1/Performance-tuning.asciidoc docs/Performance-tuning.adoc ## this topic is not used +cp $1/Report-Issues-with-Windup.asciidoc docs/Report-Issues-with-Windup.adoc +cp $1/Review-the-Report.asciidoc docs/Review-the-Report.adoc +cp $1/Review-the-Windup-Quickstarts.asciidoc docs/Review-the-Windup-Quickstarts.adoc +cp $1/Rule-Metadata.asciidoc docs/Rule-Metadata.adoc +cp $1/Rules-Available-Rules-Utilities.asciidoc docs/Rules-Available-Rules-Utilities.adoc +cp $1/Rules-Basic-Rule-Execution-Flow-Patterns.asciidoc docs/Rules-Basic-Rule-Execution-Flow-Patterns.adoc +cp $1/Rules-Create-a-Basic-Java-based-Rule-Add-on.asciidoc docs/Rules-Create-a-Basic-Java-based-Rule-Add-on.adoc +cp $1/Rules-Create-a-Basic-XML-Rule.asciidoc docs/Rules-Create-a-Basic-XML-Rule.adoc +cp $1/Rules-Create-a-Groovy-Rule-Add-on.asciidoc docs/Rules-Create-a-Groovy-Rule-Add-on.adoc ## this topic is not used +cp $1/Rules-Create-an-Advanced-Ruleset.asciidoc docs/Rules-Create-an-Advanced-Ruleset.adoc +cp $1/Rules-Create-Custom-Reports.asciidoc docs/Rules-Create-Custom-Reports.adoc ## this topic is not used +cp $1/Rules-Create-Java-Queries.asciidoc docs/Rules-Create-Java-Queries.adoc +cp $1/Rules-Creating-Rule-Operations.asciidoc docs/Rules-Creating-Rule-Operations.adoc +cp $1/Rules-Development-Guide.asciidoc docs/Rules-Development-Guide.adoc ## this topic is not used +cp $1/Rules-Difference-Between-XML-based-and-Java-based-Rules.asciidoc docs/Rules-Difference-Between-XML-based-and-Java-based-Rules.adoc +cp $1/Ruleset-Core.asciidoc docs/Ruleset-Core.adoc ## this topic is not used +cp $1/Ruleset-Java-Archives-Identification.asciidoc docs/Ruleset-Java-Archives-Identification.adoc ## this topic is not used +cp $1/Ruleset-Java-Basic-Ruleset.asciidoc docs/Ruleset-Java-Basic-Ruleset.adoc +cp $1/Ruleset-Java-Classifications-and-Inline-Hints.asciidoc docs/Ruleset-Java-Classifications-and-Inline-Hints.adoc +cp $1/Ruleset-Java-Code-Matching-Examples.asciidoc docs/Ruleset-Java-Code-Matching-Examples.adoc ## this topic is not used +cp $1/Ruleset-Java-EE-Apps.asciidoc docs/Ruleset-Java-EE-Apps.adoc +cp $1/Ruleset-Java-EE-Servers.asciidoc docs/Ruleset-Java-EE-Servers.adoc +cp $1/Ruleset-Reporting.asciidoc docs/Ruleset-Reporting.adoc +cp $1/Ruleset-Ruleset-Template.asciidoc docs/Ruleset-Ruleset-Template.adoc ## this topic is not used +cp $1/Ruleset-XML.asciidoc docs/Ruleset-XML.adoc +cp $1/Ruleset-XML-Ruleset-Element-Reference.asciidoc docs/Ruleset-XML-Ruleset-Element-Reference.adoc ## this topic is not used +cp $1/Rules-Java-based-Rule-Structure.asciidoc docs/Rules-Java-based-Rule-Structure.adoc +cp $1/Rules-Ops-Reporting-Classification.asciidoc docs/Rules-Ops-Reporting-Classification.adoc +cp $1/Rules-Ops-Reporting-Hint.asciidoc docs/Rules-Ops-Reporting-Hint.adoc +cp $1/Rules-Ops-Reporting-TypeReference.asciidoc docs/Rules-Ops-Reporting-TypeReference.adoc +cp $1/Rules-Ops-Xml-XsltTransformation.asciidoc docs/Rules-Ops-Xml-XsltTransformation.adoc +cp $1/Rules-Rule-Configuration.asciidoc docs/Rules-Rule-Configuration.adoc ## this topic is not used +cp $1/Rules-Rule-Execution-Lifecycle.asciidoc docs/Rules-Rule-Execution-Lifecycle.adoc +cp $1/Rules-Rulesets.asciidoc docs/Rules-Rulesets.adoc +cp $1/Rules-Rules-Operations.asciidoc docs/Rules-Rules-Operations.adoc +cp $1/Rules-Rules-Overview.asciidoc docs/Rules-Rules-Overview.adoc ## this topic is not used +cp $1/Rules-Rule-Story-Points.asciidoc docs/Rules-Rule-Story-Points.adoc +cp $1/Rules-Test-a-Basic-XML-Rule-in-Windup.asciidoc docs/Rules-Test-a-Basic-XML-Rule-in-Windup.adoc +cp $1/Rules-Windup-Models.asciidoc docs/Rules-Windup-Models.adoc +cp $1/Rules-XML-Rule-Construction.asciidoc docs/Rules-XML-Rule-Construction.adoc ## this topic is not used +cp $1/Rules-XML-Rule-Perform-Action-Syntax.asciidoc docs/Rules-XML-Rule-Perform-Action-Syntax.adoc +cp $1/Rules-XML-Rule-When-Condition-Syntax.asciidoc docs/Rules-XML-Rule-When-Condition-Syntax.adoc +cp $1/Rule-XML-Ruleset-Examples-Match-on-XMLFile.asciidoc docs/Rule-XML-Ruleset-Examples-Match-on-XMLFile.adoc ## this topic is not used +cp $1/Sande-ScratchPad.asciidoc docs/Sande-ScratchPad.adoc ## this topic is not used +cp $1/_Sidebar.asciidoc docs/_Sidebar.adoc ## this topic is not used +cp $1/Start-Windup.asciidoc docs/Start-Windup.adoc ## this topic is not used +cp $1/User-Guide.asciidoc docs/User-Guide.adoc ## this topic is not used +cp $1/What-is-Windup.asciidoc docs/What-is-Windup.adoc +cp $1/Windup-Architectural-Components.asciidoc docs/Windup-Architectural-Components.adoc +cp $1/Windup-lab-scripts.asciidoc docs/Windup-lab-scripts.adoc ## this topic is not used +cp $1/Windup-Processing-Overview.asciidoc docs/Windup-Processing-Overview.adoc + diff --git a/scripts/windupDocPublish.sh b/scripts/windupDocPublish.sh index a65a7aad31..08fc391b4d 100755 --- a/scripts/windupDocPublish.sh +++ b/scripts/windupDocPublish.sh @@ -28,11 +28,13 @@ git reset --hard upstream/gh-pages cd docs/ pwd echo Testing for existence of $WINDUP_VERSION -if [ ! -d $WINDUP_VERSION ]; then +if [ ! -d $WINDUP_VERSION ] || [ ! -d $WINDUP_VERSION/html ] || [ ! -d $WINDUP_VERSION/pdf ] ; then echo Creating directory: $WINDUP_VERSION mkdir -p $WINDUP_VERSION/html/images + mkdir $WINDUP_VERSION/pdf fi + cd $1 pwd cp html/*.html $2/docs/$WINDUP_VERSION/html/ @@ -49,6 +51,7 @@ git add docs git commit -m "Update the docs for release $3" +echo "*******************************************" echo "The following are manual steps: " echo " Navigate to the local windup source GitHub directory." echo " Issue the following commands to push the doc upstream." @@ -64,6 +67,7 @@ echo " git commit -m 'Replace symlink for latest to point to WINDUP_RELEA echo " git push origin HEAD" echo " git push upstream gh-pages" echo " firefox http://windup.github.io/windup/docs/latest/html/WindupUserGuide.html" +echo "*******************************************" # git push origin HEAD ## issue a pull and verify diff --git a/scripts/windupDocUpdate.sh b/scripts/windupDocUpdate.sh index 57d18414f6..96a1a55234 100755 --- a/scripts/windupDocUpdate.sh +++ b/scripts/windupDocUpdate.sh @@ -28,197 +28,37 @@ echo "*******************************************" echo "* Copying the latest images and stylesheets..." echo "*******************************************" cp -r $1/images docs/ +cp -r $1/images html/ # There don't seem to be any css files in the Wiki that are needed. # cp $1/*.css docs/ echo "Copy complete." echo "" echo "*******************************************" -echo "* Copying the User Guide Wiki pages from the Wiki to windup-documentation..." +echo "* Copying the doc pages from the Wiki to windup-documentation..." echo "*******************************************" +sh scripts/windupDocCopyWiki.sh $1 + ## Copy the current guide to a text file for conversion to a script -cp docs/Windup-User-Guide.adoc scripts/pageLinksUserGuide.txt +###cp docs/Windup-User-Guide.adoc scripts/pageLinksUserGuide.txt ## Copy the guide page as-is to use for comparison -cp $1/User-Guide.asciidoc docs/ - -## Overview -cp $1/What-is-Windup.asciidoc docs/What-is-Windup.adoc -cp $1/Features-of-Windup-2.0.asciidoc docs/Features-of-Windup-2.0.adoc -cp $1/Windup-Processing-Overview.asciidoc docs/Windup-Processing-Overview.adoc -cp $1/Get-Involved.asciidoc docs/Get-Involved.adoc -cp $1/Report-Issues-with-Windup.asciidoc docs/Report-Issues-with-Windup.adoc -cp $1/About-the-WINDUP_HOME-Variable.asciidoc docs/About-the-WINDUP_HOME-Variable.adoc -## Run Windup -cp $1/Install-Windup.asciidoc docs/Install-Windup.adoc -cp $1/Execute-Windup.asciidoc docs/Execute-Windup.adoc -cp $1/Review-the-Report.asciidoc docs/Review-the-Report.adoc -## Addtional Resources -cp $1/Review-the-Windup-Quickstarts.asciidoc docs/Review-the-Windup-Quickstarts.adoc -cp $1/Known-Issues.asciidoc docs/Known-Issues.adoc -cp $1/Glossary.asciidoc docs/Glossary.adoc -cp $1/Windup-Architectural-Components.asciidoc docs/Windup-Architectural-Components.adoc -echo "Copy complete." -echo "" - - -echo "*******************************************" -echo "* Copying the Rules Development Guide Wiki pages from the Wiki to windup-documentation..." -echo "*******************************************" +##cp $1/User-Guide.asciidoc docs/ ## Copy the current guide to a text file for conversion to a script -cp docs/Windup-Rules-Development-Guide.adoc scripts/pageLinksRulesDevelopmentGuide.txt - +##cp docs/Windup-Rules-Development-Guide.adoc scripts/pageLinksRulesDevelopmentGuide.txt + ## Copy the guide page as-is to use for comparison -cp $1/Rules-Development-Guide.asciidoc docs/ - -## Overview -cp $1/What-is-Windup.asciidoc docs/What-is-Windup.adoc -cp $1/Features-of-Windup-2.0.asciidoc docs/Features-of-Windup-2.0.adoc -cp $1/Get-Involved.asciidoc docs/Get-Involved.adoc -cp $1/Report-Issues-with-Windup.asciidoc docs/Report-Issues-with-Windup.adoc -cp $1/About-the-WINDUP_HOME-Variable.asciidoc docs/About-the-WINDUP_HOME-Variable.adoc -## Get Started -cp $1/Install-Windup.asciidoc docs/Install-Windup.adoc -cp $1/Execute-Windup.asciidoc docs/Execute-Windup.adoc -cp $1/Review-the-Report.asciidoc docs/Review-the-Report.adoc -## Configure Your System for Java-based Rules -cp $1/Install-and-Configure-Maven.asciidoc docs/Install-and-Configure-Maven.adoc -## Understand the Rule Processing -cp $1/Windup-Processing-Overview.asciidoc docs/Windup-Processing-Overview.adoc -cp $1/Rules-Rule-Execution-Lifecycle.asciidoc docs/Rules-Rule-Execution-Lifecycle.adoc -cp $1/Rules-Rule-Story-Points.asciidoc docs/Rules-Rule-Story-Points.adoc -#Create and Test Java Rule Addons -cp $1/Rules-Java-based-Rule-Structure.asciidoc docs/Rules-Java-based-Rule-Structure.adoc -cp $1/Rules-Basic-Rule-Execution-Flow-Patterns.asciidoc docs/Rules-Basic-Rule-Execution-Flow-Patterns.adoc -cp $1/Rules-Create-a-Basic-Java-based-Rule-Add-on.asciidoc docs/Rules-Create-a-Basic-Java-based-Rule-Add-on.adoc -cp $1/Rules-Create-an-Advanced-Ruleset.asciidoc docs/Rules-Create-an-Advanced-Ruleset.adoc -## Create and Test XML Rules -cp $1/Rules-Create-a-Basic-XML-Rule.asciidoc docs/Rules-Create-a-Basic-XML-Rule.adoc -cp $1/Rules-XML-Rule-When-Condition-Syntax.asciidoc docs/Rules-XML-Rule-When-Condition-Syntax.adoc -cp $1/Rules-XML-Rule-Perform-Action-Syntax.asciidoc docs/Rules-XML-Rule-Perform-Action-Syntax.adoc -cp $1/Rules-Test-a-Basic-XML-Rule-in-Windup.asciidoc docs/Rules-Test-a-Basic-XML-Rule-in-Windup.adoc -## Debugging and Troubleshooting -cp $1/Dev-Debugging-and-Profiling.asciidoc docs/Dev-Debugging-and-Profiling.adoc -cp $1/Dev-Troubleshoot-Windup-Issues.asciidoc docs/Dev-Troubleshoot-Windup-Issues.adoc -## Additional Resources -cp $1/Rules-Available-Rules-Utilities.asciidoc docs/Rules-Available-Rules-Utilities.adoc -cp $1/Review-the-Windup-Quickstarts.asciidoc docs/Review-the-Windup-Quickstarts.adoc -cp $1/Known-Issues.asciidoc docs/Known-Issues.adoc -cp $1/Glossary.asciidoc docs/Glossary.adoc -## Appendix -cp $1/Windup-Architectural-Components.asciidoc docs/Windup-Architectural-Components.adoc -cp $1/Dev-Dependencies.asciidoc docs/Dev-Dependencies.adoc -cp $1/Rules-Windup-Models.asciidoc docs/Rules-Windup-Models.adoc -echo "Copy complete." -echo "" +##cp $1/Rules-Development-Guide.asciidoc docs/ -echo "*******************************************" -echo "*Copying the Core Development Guide Wiki pages from the Wiki to windup-documentation..." -echo "*******************************************" - ## Copy the current guide to a text file for conversion to a script -cp docs/Windup-Core-Development-Guide.adoc scripts/pageLinksCoreDevelopmentGuide.txt +##cp docs/Windup-Core-Development-Guide.adoc scripts/pageLinksCoreDevelopmentGuide.txt ## Copy the guide page as-is to use for comparison -cp $1/Core-Development-Guide.asciidoc docs/ +##cp $1/Core-Development-Guide.asciidoc docs/ -## Overview -cp $1/What-is-Windup.asciidoc docs/What-is-Windup.adoc -cp $1/Features-of-Windup-2.0.asciidoc docs/Features-of-Windup-2.0.adoc -cp $1/Get-Involved.asciidoc docs/Get-Involved.adoc -cp $1/Dev-Windup-Project-Information.asciidoc docs/Dev-Windup-Project-Information.adoc -cp $1/Report-Issues-with-Windup.asciidoc docs/Report-Issues-with-Windup.adoc -cp $1/About-the-WINDUP_HOME-Variable.asciidoc docs/About-the-WINDUP_HOME-Variable.adoc - -## Developer Contributing Information -cp $1/Dev-Development-Guidelines-and-Conventions.asciidoc docs/Dev-Development-Guidelines-and-Conventions.adoc -cp $1/Dev-Submit-Code-Updates-to-the-Windup-Project.asciidoc docs/Dev-Submit-Code-Updates-to-the-Windup-Project.adoc - -## Understand the Windup Architecture and Structure -cp $1/Windup-Architectural-Components.asciidoc docs/Windup-Architectural-Components.adoc -cp $1/Dev-Windup-Project-Structure.asciidoc docs/Dev-Windup-Project-Structure.adoc - -## Get Started -cp $1/Install-and-Configure-Maven.asciidoc docs/Install-and-Configure-Maven.adoc -cp $1/Dev-Get-the-Windup-Source-Code.asciidoc docs/Dev-Get-the-Windup-Source-Code.adoc -cp $1/Dev-Build-Windup-from-Source.asciidoc docs/Dev-Build-Windup-from-Source.adoc -cp $1/Dev-Execute-Windup-Built-from-Source.asciidoc docs/Dev-Execute-Windup-Built-from-Source.adoc -cp $1/Execute-Windup.asciidoc docs/Execute-Windup.adoc -cp $1/Review-the-Report.asciidoc docs/Review-the-Report.adoc - -## Understand the Rule Processing -cp $1/Windup-Processing-Overview.asciidoc docs/Windup-Processing-Overview.adoc -cp $1/Rules-Rule-Execution-Lifecycle.asciidoc docs/Rules-Rule-Execution-Lifecycle.adoc -cp $1/Rules-Rule-Story-Points.asciidoc docs/Rules-Rule-Story-Points.adoc - -#Create and Test Java Rule Addons -cp $1/Rules-Java-based-Rule-Structure.asciidoc docs/Rules-Java-based-Rule-Structure.adoc -cp $1/Rules-Basic-Rule-Execution-Flow-Patterns.asciidoc docs/Rules-Basic-Rule-Execution-Flow-Patterns.adoc -cp $1/Rules-Create-a-Basic-Java-based-Rule-Add-on.asciidoc docs/Rules-Create-a-Basic-Java-based-Rule-Add-on.adoc -cp $1/Rules-Create-an-Advanced-Ruleset.asciidoc docs/Rules-Create-an-Advanced-Ruleset.adoc - -## Create and Test XML Rules -cp $1/Rules-Create-a-Basic-XML-Rule.asciidoc docs/Rules-Create-a-Basic-XML-Rule.adoc - -## Debugging and Troubleshooting -cp $1/Dev-Debugging-and-Profiling.asciidoc docs/Dev-Debugging-and-Profiling.adoc -cp $1/Dev-Troubleshoot-Windup-Issues.asciidoc docs/Dev-Troubleshoot-Windup-Issues.adoc - -## Wiki and Product Documentation - -cp $1/About-the-Windup-Wiki.asciidoc docs/About-the-Windup-Wiki.adoc -cp $1/Dev-Add-Images-to-the-Windup-Wiki.asciidoc docs/Dev-Add-Images-to-the-Windup-Wiki.adoc -cp $1/Dev-Create-Windup-JavaDoc.asciidoc docs/Dev-Create-Windup-JavaDoc.adoc -cp $1/Dev-Windup-Documentation-Process.asciidoc docs/Dev-Windup-Documentation-Process.adoc - -## Additional Resources -cp $1/Review-the-Windup-Quickstarts.asciidoc docs/Review-the-Windup-Quickstarts.adoc -cp $1/Known-Issues.asciidoc docs/Known-Issues.adoc -cp $1/Glossary.asciidoc docs/Glossary.adoc - -## Dev topics -cp $1/Windup-Architectural-Components.asciidoc docs/Windup-Architectural-Components.adoc -cp $1/Dev-Dependencies.asciidoc docs/Dev-Dependencies.adoc - -cp $1/Dev-Windup-Bootstrap.asciidoc docs/Dev-Windup-Bootstrap.adoc -cp $1/Dev-Classloading-Notes.asciidoc docs/Dev-Classloading-Notes.adoc -cp $1/Dev-Connect-to-the-Graph-via-Rexster.asciidoc docs/Dev-Connect-to-the-Graph-via-Rexster.adoc -cp $1/Dev-Decompiling.asciidoc docs/Dev-Decompiling.adoc -cp $1/Dev-Frames-Extensions.asciidoc docs/Dev-Frames-Extensions.adoc -cp $1/Dev-Internal-API-Features.asciidoc docs/Dev-Internal-API-Features.adoc -cp $1/Dev-Logging.asciidoc docs/Dev-Logging.adoc -cp $1/Dev-Variables-Stack.asciidoc docs/Dev-Variables-Stack.adoc -cp $1/Dev-Port-WindRide-Functionality-to-Windup.asciidoc docs/Dev-Port-WindRide-Functionality-to-Windup.adoc -cp $1/Dev-Git-Rebasing.asciidoc docs/Dev-Git-Rebasing.adoc -cp $1/Dev-Windup-Release-Process.asciidoc docs/Dev-Windup-Release-Process.adoc - -## Rule topics -cp $1/Rules-Windup-Models.asciidoc docs/Rules-Windup-Models.adoc -cp $1/Rules-Available-Rules-Utilities.asciidoc docs/Rules-Available-Rules-Utilities.adoc -cp $1/Dev-Concepts-and-Philosophy.asciidoc docs/Dev-Concepts-and-Philosophy.adoc -cp $1/Rules-Creating-Rule-Operations.asciidoc docs/Rules-Creating-Rule-Operations.adoc -cp $1/Rules-Rulesets.asciidoc docs/Rules-Rulesets.adoc -cp $1/Ruleset-Java-Basic-Ruleset.asciidoc docs/Ruleset-Java-Basic-Ruleset.adoc -cp $1/Ruleset-Java-Classifications-and-Inline-Hints.asciidoc docs/Ruleset-Java-Classifications-and-Inline-Hints.adoc -cp $1/Ruleset-Java-EE-Apps.asciidoc docs/Ruleset-Java-EE-Apps.adoc -cp $1/Ruleset-Java-EE-Servers.asciidoc docs/Ruleset-Java-EE-Servers.adoc -cp $1/Ruleset-Reporting.asciidoc docs/Ruleset-Reporting.adoc -cp $1/Ruleset-XML.asciidoc docs/Ruleset-XML.adoc -cp $1/Rules-Windup-Models.asciidoc docs/Rules-Windup-Models.adoc -cp $1/Rules-Create-Java-Queries.asciidoc docs/Rules-Create-Java-Queries.adoc -cp $1/Rule-Metadata.asciidoc docs/Rule-Metadata.adoc -cp $1/Rules-Rules-Operations.asciidoc docs/Rules-Rules-Operations.adoc -cp $1/Rules-Ops-Reporting-Classification.asciidoc docs/Rules-Ops-Reporting-Classification.adoc -cp $1/Rules-Ops-Reporting-Hint.asciidoc docs/Rules-Ops-Reporting-Hint.adoc -cp $1/Rules-Ops-Reporting-TypeReference.asciidoc docs/Rules-Ops-Reporting-TypeReference.adoc -cp $1/Rules-Ops-Xml-XsltTransformation.asciidoc docs/Rules-Ops-Xml-XsltTransformation.adoc -cp $1/Rules-Rule-Execution-Lifecycle.asciidoc docs/Rules-Rule-Execution-Lifecycle.adoc -cp $1/Rules-Java-based-Rule-Structure.asciidoc docs/Rules-Java-based-Rule-Structure.adoc -cp $1/Rules-Rule-Story-Points.asciidoc docs/Rules-Rule-Story-Points.adoc -cp $1/Rules-Difference-Between-XML-based-and-Java-based-Rules.asciidoc docs/Rules-Difference-Between-XML-based-and-Java-based-Rules.adoc echo "Copy complete." echo "" @@ -298,6 +138,10 @@ echo "*******************************************" echo "* Building the Windup User Guide..." echo "*******************************************" asciidoctor -t -dbook -a toc -o html/WindupUserGuide.html docs/Windup-User-Guide.adoc +asciidoctor -t -dbook -o html/WindupUserGuide-NO-TOC.html docs/Windup-User-Guide-NO-TOC.adoc +##wkhtmltopdf --disable-smart-shrinking html/WindupUserGuide-NO-TOC.html html/WindupUserGuide.pdf +wkhtmltopdf --page-size Letter html/WindupUserGuide-NO-TOC.html pdf/WindupUserGuide.pdf + echo "Guide is located at: " file://$2/html/WindupUserGuide.html echo "" @@ -305,6 +149,9 @@ echo "*******************************************" echo "* Building the Windup Rules Development Guide..." echo "*******************************************" asciidoctor -t -dbook -a toc -o html/WindupRulesDevelopmentGuide.html docs/Windup-Rules-Development-Guide.adoc +asciidoctor -t -dbook -o html/WindupRulesDevelopmentGuide-NO-TOC.html docs/Windup-Rules-Development-Guide.adoc +##wkhtmltopdf --disable-smart-shrinking html/WindupRulesDevelopmentGuide-NO-TOC.html html/WindupRulesDevelopmentGuide.pdf +wkhtmltopdf --page-size Letter html/WindupRulesDevelopmentGuide-NO-TOC.html pdf/WindupRulesDevelopmentGuide.pdf echo "Guide is located at: " file://$2/html/WindupRulesDevelopmentGuide.html echo "" @@ -312,6 +159,9 @@ echo "*******************************************" echo "* Building the Windup Core Development Guide..." echo "*******************************************" asciidoctor -t -dbook -a toc -o html/WindupCoreDevelopmentGuide.html docs/Windup-Core-Development-Guide.adoc +asciidoctor -t -dbook -o html/WindupCoreDevelopmentGuide-NO-TOC.html docs/Windup-Core-Development-Guide-NO-TOC.adoc +##wkhtmltopdf --disable-smart-shrinking html/WindupCoreDevelopmentGuide-NO-TOC.html html/WindupCoreDevelopmentGuide.pdf +wkhtmltopdf --page-size Letter html/WindupCoreDevelopmentGuide-NO-TOC.html pdf/WindupCoreDevelopmentGuide.pdf echo "Guide is located at: " file://$2/html/WindupCoreDevelopmentGuide.html echo ""