title: Use sh404SEF router from a plugin
body: <p>I'm developing a Joomla 2.5 content plugin that need to programatically create a SEF url when an article is saved. </p>
  
  <p>I've managed to make this work when the regular Joomla SEF is activated. My plugin is using the regular Joomla JRoute::_(); to build a SEF URL. This works great with native Joomla.
  For example the url</p>
  
  <pre><code>http://localhost/index.php?option=com_content&amp;view=article&amp;id=123
  </code></pre>
  
  <p>is translated to</p>
  
  <pre><code>http://localhost/index.php/mycategory/article-title-123.html
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>private function joomlaSefUrl($article){
          require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
          $siteURL = substr(JURI::root(), 0, -1);
          if(JPATH_BASE == JPATH_ADMINISTRATOR) {
              // In the back end we need to set the application to the site app instead
              JFactory::$application = JApplication::getInstance('site');
          }
          $articleRoute = JRoute::_( ContentHelperRoute::getArticleRoute($article-&gt;id, $article-&gt;catid) );
          $sefURI = str_replace(JURI::base(true), '', $articleRoute);
          if(JPATH_BASE == JPATH_ADMINISTRATOR) {
              $siteURL = str_replace($siteURL.DS.'administrator', '', $siteURL);
              JFactory::$application = JApplication::getInstance('administrator');
          }
          $sefURL = $siteURL.$sefURI;
          return $sefURL;
      }
  </code></pre>
  
  <p>The problem is that when third party extensions like sh404SEF is installed the SEF URL that I get from using the JRoute::_() method is still the the regular Joomla route url:</p>
  
  <pre><code>http://localhost/index.php/mycategory/article-123.html 
  </code></pre>
  
  <p>instead of the expected sh404SEF's url </p>
  
  <pre><code>http://localhost/Mycategory/article-title.html
  </code></pre>
  
  <p>Joomla doesn't see that the sh404SEF is installed, so by using the JRoute::<em>(), I allways get the regular SEF Joomla url. So I need to find a way to use the sh404SEF JRoute::</em>() class directly from within my plugin, instead of the regular Joomla router class. </p>
  
  <p>Does anyone know how the sh404SEF classes work?</p>