Set up plugins in CableMES

Set up plugins in CableMES

  1. Go to IntelliJ and use File → New → Project From Version control download the project for the specific plugin you want. Use the GIT repository!

  2. After the Plugin is opened in a new project run Maven commands:

    1. clean

    2. install

    3. If it does not build ask someone for help!

  3. Modify Tomcat to accept the plugin:

    1. Go to \your_tomcat_directory\conf\ and open the context.xml file in the editor using Administrator privileges so you can save changes.

    2. inside <Context></Context> tags check if you already have <Resources className="org.apache.catalina.webresources.StandardRoot"></Resources> tags. If not then add them.

    3. inside the tags form above add the paths to the target and resource folders from the plugin project:
      <JarResources className="org.apache.catalina.webresources.DirResourceSet" base="/plugin_Name/target/classes" webAppMount="/WEB-INF/classes"/>
      <JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:/Projects/plugin_Name/target/classes/META-INF/resources" webAppMount="/"/>

    4. Save the changes! And restart Tomcat to read the modified context!

My sample context file (for comparison) looks like:

<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!--<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>-->
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<Resource auth="Container" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" maxActive="10" maxIdle="30" maxWait="10000" name="jdbc/CableMES" password="CableMES" type="javax.sql.DataSource" url="jdbc:sqlserver://localhost:1433;database=CableMESdev" username="CableMES"/>
<Resource name="jdbc/opcAlarms" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="aaAlarms" password="aaAlarms" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://DEV2:1433;databaseName=A2ALMDB"/>
<Resource name="jdbc/opcHistory" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="aaRuntime" password="aaRuntime" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://DEV2:1433;databaseName=Runtime"/>
<!-- PLUGIN RESOURCES -->
<Resources className="org.apache.catalina.webresources.StandardRoot">
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:/Projects/CableMESplugins/NEWTLabels/target/classes" webAppMount="/WEB-INF/classes"/>
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:/Projects/CableMESplugins/NEWTLabels/target/classes/META-INF/resources" webAppMount="/"/>
<!-- CableBuilderItemRouting Plugin -->
<!--
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:\\Projects\CableMESPlugin_CableBuilderItemRouting\target\classes"
webAppMount="/WEB-INF/classes" />-->
</Resources>
</Context>