<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">By nature, the engine core can&#39;t tell what the progress is, other than number of processed vs. remaining rules.</blockquote>
<div> </div><div>That might actually be enough.<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 7:16 PM, Ondrej Zizka <span dir="ltr">&lt;<a href="mailto:ozizka@redhat.com" target="_blank">ozizka@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Just few notes, inline.<div class=""><br>
    <br>
    <div>On 16.6.2014 16:07, Ian Tewksbury
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div style="font-family:Arial;font-size:12pt;color:rgb(0,0,0)">
        <div>All,</div>
        <div><br>
        </div>
        <div>Pete asked me to send out some of the ideas I have had
          about what the Eclipse plugin would like to see from the
          Windup core project as far as API goes.</div>
        <div><br>
        </div>
        <div><strong>ProgressMonitor</strong></div>
        <div><br>
        </div>
        <div>I would suggest basing this off the Eclipse
          IProgressMonitor API. I do not think it would make sense to
          actually use the Eclipse API because then Windup would be
          dependent on Eclipse. But if Windup had a similar interface I
          could use it to convert form a Windup ProgressMonitor to an
          Eclipse IProgressMonitor and report status back to the user.
          For Windup&#39;s long running actions this is very important.</div>
      </div>
    </blockquote></div>
    By nature, the engine core can&#39;t tell what the progress is, other
    than number of processed vs. remaining rules.<br>
    The rules might provide some metadata about how long they expect to
    run.<br>
    But they don&#39;t know until the previous rules are done.<br>
    So I guess this will be a bit of guesstimate - perhaps based on some
    simple value based on &quot;typical&quot; duration, given by rules as
    metadata.<div class=""><br>
    <br>
    <blockquote type="cite">
      <div style="font-family:Arial;font-size:12pt;color:rgb(0,0,0)">
        <div><br>
        </div>
        <div><strong>WinupdEngine</strong></div>
        <div><br>
        </div>
        <div>I think it is important a single instance of the Windup
          Engine is reusable and can be run multiple times on the same
          project or on different projects. But if for whatever reason
          it is only one time use only that needs to be well documented
          in the API. Currently with legacy windup I only create one
          copy of the Engine</div>
        <div><br>
        </div>
        <div>WindupEngine#setSettings(WindupEnvironment env) - set the
          windup options</div>
        <div><br>
        </div>
        <div>WindupEngine#process(File parentProject, ProgressMonitor
          monitor) - runs windup on a parent folder and generates all
          the metadata</div>
      </div>
    </blockquote></div>
    Looks like a subset of input. So this would fill one app dir to
    input and run, up to, excluding, the report phase.<div class=""><br>
    <blockquote type="cite">
      <div style="font-family:Arial;font-size:12pt;color:rgb(0,0,0)">
        <div>WindupEngine#generateReport(File parentProject,
          ProgressMonitor monitor) - generates a windup report based on
          all the metadata that is created by the #process(File
          parentFolder). This could either error out if the parentFolder
          has not yet been processed or could automatically process it</div>
      </div>
    </blockquote></div>
    This might need change in current runner, to resume from the
    REPORTING phase.<div class=""><br>
    <br>
    <blockquote type="cite">
      <div style="font-family:Arial;font-size:12pt;color:rgb(0,0,0)">
        <div>WindupEngine#getRuleMatches(File file) - Should return a
          list of RuleMatch objects, one for every rule match on a given
          file that can then be used to access any needed information
          about that rule match determined from all of the generated
          metadata</div>
      </div>
    </blockquote></div>
    That would probably be a matter of a query to the graph, in the
    ideal case.<div class=""><br>
    <br>
    <blockquote type="cite">
      <div style="font-family:Arial;font-size:12pt;color:rgb(0,0,0)">
        <div><br>
        </div>
        <div><strong>RuleMatch</strong></div>
        <div><strong><br>
          </strong></div>
        <div>This should be the class that is used to give API users all
          the information that was determined about a given resource. I
          would suggest most of this information if not all of it be
          lazily loaded and not pre populated. I do not know what your
          plan is for the storage of the windup model you will build on
          a given project. I hope there is some plan to not just keep it
          all in memory all the time and there will be some sort of file
          backend. An application like Eclipse is already a memory hog,
          to have to store the possibly infinite size of the windup
          model for all the projects in the workspace in memory all the
          time could get way out of proportion quickly. My suggestion
          would be this model would get saved to disk and then classes
          like the RuleMatch could query the model which would in turn
          query the disk for information. At the very least if the model
          is not saved to disk, then at least text and description from
          rules should only be loaded from disk when requested. So when
          loading a custom rule you have to load the matcher from disk
          as you process, but no need to load the description or other
          information until someone actually requests it, and even then
          that information should not be kept in memory by windup when
          requested, it should be returned and forgotten. I could go on
          an on on this subject, and it maybe a topic for another email
          or discussion at some point, but wanted to lay down some of my
          suggestions as it relates to this API.</div>
        <div><br>
        </div>
        <div>I would also assume that the report generator for Winup
          would be using this same API to generate the report. I see the
          Windup Report generator and the Eclipse plugin as siblings,
          both using the same API to display the same information in
          different ways.</div>
        <div><br>
        </div>
        <div>RuleMatch#getTitle() - a short description title of the
          match</div>
        <div><br>
        </div>
        <div>RuleMatch#getLongDescription() - a more verbose description
          of the match. this could possible contain some level of
          markup/simple html for basic formatting</div>
        <div><br>
        </div>
        <div>RuleMatch#getAdditionalReadingLinks() - returns list of
          links to externally extensible information relevant to the
          match</div>
        <div><br>
        </div>
        <div>RuleMatch#getLocation() - returns a location object that
          will contain the line number and character start and end
          locations on that line of the match. If the match if for the
          entire file there should be some way of describing that as
          well.</div>
        <div><br>
        </div>
        <div>RuleMatch#getCategory() - I am guessing rules will be
          provided in sets, JEE, WebSphere, Wildfly, or something that
          groups rules together in logical sets, this would be nice for
          reporting<br>
          <br>
        </div>
        <div>RuleMatch#getSeverity() - I would suggest a three level
          system, info, warning, error.</div>
        <div><br>
        </div>
        <div>RuleMatch#getFix() - Should return a block of text that can
          replace the matched block of text as a quick fix for the
          match. If you want to get really fancy these fixes should be
          able to match on parts of the match and inject them into the
          quick fix block. EX: if replacing one method call with another
          and there are parameters being passed the fix should be able
          to have some way of referencing those parameters so it can use
          them in its fix. This would all have to be done on the Windup
          side and likely all programmaticly by giving the rule writers
          access to the source they matched on so they can parse it for
          use in their fix code</div>
      </div>
    </blockquote></div>
    This should become part of the graph model. Perhaps not directly in
    a FramedVertex. Could need some DTO to be prepared for this purpose.<br>
    <br>
    Ondra<br>
    <blockquote type="cite"><div class="">
      <div style="font-family:Arial;font-size:12pt;color:rgb(0,0,0)">
        <div><br>
        </div>
        <div>----------------------</div>
        <div><br>
        </div>
        <div>That is all I can think of for now. I hope this helps
          describe the kind of things Eclipse will be looking for in
          terms of API.</div>
        <div><br>
        </div>
        <div>Blue Skies,</div>
        <div>~Ian</div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div><pre>_______________________________________________
windup-dev mailing list
<a href="mailto:windup-dev@lists.jboss.org" target="_blank">windup-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/windup-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-dev</a></pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
windup-dev mailing list<br>
<a href="mailto:windup-dev@lists.jboss.org">windup-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/windup-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Lincoln Baxter, III<br>
<a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;
</div></div></div>