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<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><p style="margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px"><span style="white-space:pre-wrap">     </span><br>
</p><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>
<p style="margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px"><span style="white-space:pre-wrap">              </span><br></p><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>
<p style="margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px"><span style="white-space:pre-wrap">              </span><br></p><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><p style="margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px">
<span style="white-space:pre-wrap">     </span><br></p><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 class="h5"><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>