blob: 4cb8afa7ae4059e853fc4df7b24e3e30238580df [file]
<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>plugin_dev</title>
</head>
<body>
<h1 id="WebApp_Discoverer_API">WebApp Discoverer API</h1>
<p>Each MoDisco discoverer responds to a normalized interface and can be called programmatically (see org.eclipse.modisco.infra.discovery.core.IDiscoverer&lt;T&gt;).</p>
<p>First, add the following plug-in dependencies to your project (
<b>Require-Bundle</b> in your Manifest.MF):
</p>
<ul>
<li>org.eclipse.modisco.jee.webapp</li>
<li>org.eclipse.modisco.jee.webapp.discoverer</li>
<li>org.eclipse.modisco.infra.discovery.core</li>
</ul>
<p>You can easily discover a web-xml model programmatically. For example:</p>
<pre>
WebXmlDiscoverer2 discoverer = new WebXmlDiscoverer2();
discoverer.discoverElement(xmlFile, new NullProgressMonitor());
Resource webXmlResource = discoverer.getTargetModel();
</pre>
<p>To have a monitor to pass to the <code>discoverElement</code> method, you can either call the discoverer in an Eclipse Job, or pass a new NullProgressMonitor if you don't need progress reporting.</p>
<p>As an example, you may checkout the code from project org.eclipse.modisco.jee.webapp.discoverer.tests.</p>
</body>
</html>