<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">looks perfect. <div>Just assure that CmsMyShellCommands is available on your classpath (for example put it somewhere below "classes") and it should work </div><div><br></div><div>Regards</div><div>Christoph</div><div><br><div><div>Am 02.09.2012 um 12:47 schrieb Daniel Beddoe:</div><br class="Apple-interchange-newline"><blockquote type="cite"><pre class="source-java" style="text-align:left"><span style="font-family:arial;text-align:-webkit-auto;white-space:normal">We also run it like this aswell! </span></pre><pre class="source-java" style="text-align:left">java -classpath <span class="st0" style="color:rgb(255,0,0)">"${SERVLET_API}:${JSP_API}:${OPENCMS_CLASSPATH}:${TOMCAT_CLASSPATH}:classes"</span> org.<span class="me1" style="color:rgb(0,102,0)">opencms</span>.<span class="me1" style="color:rgb(0,102,0)">main</span>.<span class="me1" style="color:rgb(0,102,0)">CmsShell</span> -base=<span class="st0" style="color:rgb(255,0,0)">"${OPENCMS_BASE}"</span></pre>
<div>So would we add that -additional flag like this:</div><div><pre class="source-java" style="text-align:left">java -classpath <span class="st0" style="color:rgb(255,0,0)">"${SERVLET_API}:${JSP_API}:${OPENCMS_CLASSPATH}:${TOMCAT_CLASSPATH}:classes"</span> org.<span class="me1" style="color:rgb(0,102,0)">opencms</span>.<span class="me1" style="color:rgb(0,102,0)">main</span>.<span class="me1" style="color:rgb(0,102,0)">CmsShell </span>-additional="my.company.CmsMyShellCommands" -base=<span class="st0" style="color:rgb(255,0,0)">"${OPENCMS_BASE}"</span></pre>
</div><div><br></div><div>Thanks,</div><div><br></div><div>Dan</div><div><br><div class="gmail_quote">On Sun, Sep 2, 2012 at 11:40 AM, Daniel Beddoe <span dir="ltr"><<a href="mailto:daniel.beddoe123@googlemail.com" target="_blank">daniel.beddoe123@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Thank you very much for your suggestion. Just a few things to clarify. So this class goes in /org/opencms/main/ directory in the opencms.jar file, correct?</div>
<div>We run the cms shell by entering ./cmsshell.sh at the prompt, so it will now become something like: </div>
<div>./cmsshell.sh -additional=my.company.CmsMyShellCommands ?</div><div><br></div><div>Thanks very much for your help once again!</div><div><br></div><div>Dan<div><div class="h5"><br><br><div class="gmail_quote">On Sat, Sep 1, 2012 at 6:03 PM, Christoph Fröhlich <span dir="ltr"><<a href="mailto:cfauto@folge2.de" target="_blank">cfauto@folge2.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Daniel<div><br></div><div>maybe you can write a custom class that implement I_CmsShellCommands.</div>

<div><br></div><div>When you start CmsShell you pass the class via the additonal argument value (i.e. "-additional=my.company.CmsMyShellCommands")</div><div><br></div><div>Your class could look like the one below.</div>

<div>I just wrote it down without really checking that it works but it should point you in the right direction...</div><div><br></div><div>--------------------------------------------------------------------------</div><div>

<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="color:#910068">package</span> my.company;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;min-height:15px">

<br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="color:#910068">import</span> org.opencms.file.CmsObject;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">

<span style="color:#910068">import</span> org.opencms.file.CmsResource.CmsResourceDeleteMode;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;min-height:15px">

<br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(80,114,203)">/**</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(80,114,203)">

 * Additional shell commands.</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(80,114,203)"> * <span style="color:#91afcb">@author</span> <span style="text-decoration:underline">Christoph</span> <span style="text-decoration:underline">Froehlich</span></div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(80,114,203)"> *</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(80,114,203)">

 */</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="color:#910068">public</span> <span style="color:#910068">class</span> CmsMyShellCommands <span style="color:#910068">implements</span> I_CmsShellCommands {</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;min-height:15px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">

<span style="white-space:pre-wrap">     </span><span style="color:#910068">private</span> CmsObject <span style="color:#0000cb">cms</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><span style="white-space:pre-wrap">   </span><br>

</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">     </span><span style="color:#910068">protected</span>  CmsMyShellCommands() {</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">         </span><span style="color:#910068">super</span>();</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">

<span style="white-space:pre-wrap">     </span>}</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;min-height:15px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(119,119,119)">

<span style="color:#000000"><span style="white-space:pre-wrap"> </span></span>@Override</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">  </span><span style="color:#910068">public</span> <span style="color:#910068">void</span> initShellCmsObject(CmsObject cms, CmsShell shell) {</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">         </span><span style="color:#910068">this</span>.<span style="color:#0000cb">cms</span> = cms;</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap"> </span>}</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;min-height:15px">

<br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(119,119,119)"><span style="color:#000000"><span style="white-space:pre-wrap">        </span></span>@Override</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap"> </span><span style="color:#910068">public</span> <span style="color:#910068">void</span> shellExit() {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><span style="white-space:pre-wrap">                </span><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">

<span style="white-space:pre-wrap">     </span>}</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;min-height:15px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;color:rgb(119,119,119)">

<span style="color:#000000"><span style="white-space:pre-wrap"> </span></span>@Override</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">  </span><span style="color:#910068">public</span> <span style="color:#910068">void</span> shellStart() {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><span style="white-space:pre-wrap">               </span><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">

<span style="white-space:pre-wrap">     </span>}</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco;min-height:15px"><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; ">

<span style="white-space:pre-wrap">     </span><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">      </span><span style="color:#910068">public</span> <span style="color:#910068">void</span> deleteResource (String resource, <span style="color:#910068">int</span> type) <span style="color:#910068">throws</span> Exception{</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">         </span>CmsResourceDeleteMode mode = CmsResourceDeleteMode.valueOf(type);</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">         </span><span style="color:#0000cb">cms</span>.deleteResource(resource, mode);</div>

<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap"> </span>}</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">

}</div></div><div><br></div><div><br></div><div>--------------------------------------------------------------------------</div><div><br></div><div>Regards </div><div>Christoph</div><div><br></div><div><br></div><div><div>

Am 01.09.2012 um 17:50 schrieb Daniel Beddoe:</div><br><blockquote type="cite"><div><div><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Hi, I recently had a look on the OpenCms dev mailing list archives and noticed you recently had a problem with the deleteResource command through the Cms Shell: </span><a href="http://lists.opencms.org/pipermail/opencms-dev/2012q3/037129.html" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">http://lists.opencms.org/pipermail/opencms-dev/2012q3/037129.html</a><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">



<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Did you manage to find a work around for this using the CmsShellCommands API? So far we have had no luck in finding other commands to replicate this missing command. Any help would be much appreciated.</div>



<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Thanks,</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Daniel</div></div></div>
_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br>

<br><br><br></blockquote></div><br></div></div><br>_______________________________________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br>
<br>
<br>
<br>
<br></blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div></body></html>