<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Alexey, Rob,<div><br></div><div>Thanks for your replies. I understand that our validators (JAX-RS is now part of them) are called during wst validation, and that I shouldn't trigger costly validation of all projects for the sole purpose of JAX-RS. I'll look at the options you suggested (explicit call of validateAll vs state saving/using KB)</div><div><br></div><div>Thanks</div><div>Best regards,<br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">/Xavier<br><br><br></span>
</div>
<br><div><div>On Sep 17, 2012, at 7:24 PM, Alexey Kazakov wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">We don't call our validators (CDI, EL,
JSF, Seam, ...) directly. These validators are registered in
plugin.xml's and managed by
org.jboss.tools.common.validation.ValidatorManager<br>
This manager is called by eclipse wst validation builder.<br>
You could call ValidatorManager.validateInJob(IValidationContext
helper, IReporter reporter) with proper helper
(validationHelper.getValidationContextManager().getRegisteredFiles()
should be empty) but in this case you will start all the
validators to validate the entire projects! So it's not the way
you are looking for.<br>
So you have two options here:<br>
1. Call your validator directly validateAll(..) when you need it
w/o builder<br>
or<br>
2. Save the validation state between sessions and relay on wst
builder/ValidationManager.<br>
In CDI/JSF/Seam tools we use KB project framework to save states.
This framework is not a part of common-validation framework, so
it's up to you if you want to use KB project or your own solution
to save the state. <br>
<br>
On 09/17/2012 08:27 AM, Xavier Coulon wrote:<br>
</div>
<blockquote cite="mid:BD326BB6-6AE7-4093-9B22-2C7E667D6758@redhat.com" type="cite">Never mind, I found the reason why the validate(..)
method is called: some xml files need to be checked. They are not
part of the 'changedFiles', but they are returned by the
validationHelper.getURIs() method.
<div><br>
</div>
<div>So, instead, I'd like to ask: how can I force the validation
framework to trigger a validateAll() at workbench startup ?</div>
<div><br>
</div>
<div>Thanks.</div>
<div><br>
</div>
<div>Best regards, <br>
<div>
<div apple-content-edited="true">
/Xavier<br>
<br>
<br>
</div>
<br>
<div>
<div>On Sep 17, 2012, at 4:49 PM, Xavier Coulon wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space; ">Hi !
<div><br>
</div>
<div>The JAX-RS tooling is now aligned on the CDI
tooling and relies on the common-validation plugin to
validate the JAX-RS elements. </div>
<div>So far, so good, but I have this issue that I'd
like to solve: at workbench start-up, the method </div>
<div>
<div style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; font: normal
normal normal 11px/normal Menlo; "><span style="color: #921f67"><b><br>
</b></span></div>
<div style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; font: normal
normal normal 11px/normal Menlo; "><span style="color: #921f67"><b><span class="Apple-tab-span" style="white-space:pre">
</span>public</b></span> IStatus
validate(Set<IFile> changedFiles, IProject
project, ContextValidationHelper validationHelper,</div>
<div style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; font: normal
normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre"> </span>IProjectValidationContext
context, ValidatorManager manager, IReporter
reporter) <span style="color: #921f67"><b>throws</b></span>
ValidationException</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><span class="Apple-tab-span" style="white-space:pre"> </span><br class="webkit-block-placeholder">
</div>
<div apple-content-edited="true">of my validator is
called, but with an empty set of 'changedFiles'.
Wouldn't it make more sense to call the </div>
<div apple-content-edited="true">
<div style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; font: normal
normal normal 11px/normal Menlo; "><span style="color: #921f67"><b><span class="Apple-tab-span" style="white-space:pre"> </span>public</b></span>
IStatus validateAll(IProject project,
ContextValidationHelper validationHelper,</div>
<div style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; font: normal
normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">
</span>IProjectValidationContext
validationContext, ValidatorManager manager,
IReporter reporter)</div>
<div style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; font: normal
normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">
</span><span style="color: #921f67"><b>throws</b></span>
ValidationException </div>
</div>
<div apple-content-edited="true">method instead ? </div>
<div apple-content-edited="true"><br>
</div>
<div apple-content-edited="true">I can workaround that
and call validateAll(..) when changesFiles.isEmpty()
in the validate(..) method call, but I don't think
it's the best approach.</div>
<div apple-content-edited="true"><br>
</div>
<div apple-content-edited="true">WDYT ?</div>
<div apple-content-edited="true"><br>
</div>
<div apple-content-edited="true">Thanks.</div>
<div apple-content-edited="true"><br>
</div>
<div apple-content-edited="true">Best regards,</div>
<div apple-content-edited="true">
/Xavier<br>
<br>
<br>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
jbosstools-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:jbosstools-dev@lists.jboss.org">jbosstools-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/jbosstools-dev">https://lists.jboss.org/mailman/listinfo/jbosstools-dev</a></pre>
</blockquote>
<br>
</div>
_______________________________________________<br>jbosstools-dev mailing list<br><a href="mailto:jbosstools-dev@lists.jboss.org">jbosstools-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/jbosstools-dev</blockquote></div><br></div></body></html>