Package com.ecyrd.jspwiki

Examples of com.ecyrd.jspwiki.WikiEngine


     {@inheritDoc}
     */
    public void postSave( WikiContext context, String pagecontent )
    {
        String     blogName = context.getPage().getName();
        WikiEngine engine   = context.getEngine();

        int blogentryTxt = blogName.indexOf("_blogentry_");
        if( blogentryTxt == -1 )
        {
            return; // This is not a weblog entry.
        }
       
        blogName = blogName.substring( 0, blogentryTxt );

        if( blogName.equals( engine.getFrontPage() ) )
        {
            blogName = null;
        }

        try
        {
            XmlRpcClient xmlrpc = new XmlRpcClient(m_pingURL);
            Vector<String> params = new Vector<String>();
            params.addElement( "The Butt Ugly Weblog" ); // FIXME: Must be settable
            params.addElement( engine.getURL( WikiContext.VIEW, blogName, null, true ) );

            if( log.isDebugEnabled() )
                log.debug("Pinging weblogs.com with URL: "+engine.getURL( WikiContext.VIEW, blogName, null, true ));

            xmlrpc.executeAsync("weblogUpdates.ping", params,
                                new AsyncCallback()
                                {
                                    public void handleError( Exception ex,
View Full Code Here


            else
            {
                Boolean b = (Boolean)context.getVariable( RenderingManager.VAR_EXECUTE_PLUGINS );
                if( b != null && !b.booleanValue() ) return BLANK;

                WikiEngine engine = context.getEngine();
           
                HashMap<String,Object> parsedParams = new HashMap<String,Object>();
           
                //
                //  Parse any variable instances from the string
                //
                for( Map.Entry e : m_params.entrySet() )
                {
                    Object val = e.getValue();
               
                    if( val instanceof String )
                    {
                        val = engine.getVariableManager().expandVariables( context, (String)val );
                    }
               
                    parsedParams.put( (String)e.getKey(), val );
                }
           
                result = engine.getPluginManager().execute( context,
                                                            m_pluginName,
                                                            parsedParams );
            }
        }
        catch( Exception e )
View Full Code Here

        // Supply a custom LoginModule class
        props.put( "jspwiki.loginModule.class", "com.ecyrd.jspwiki.auth.login.CookieAssertionLoginModule" );

        // Init the engine and verify that we initialized with a custom auth
        // login module
        WikiEngine engine = new TestEngine( props );
        AuthenticationManager authMgr = engine.getAuthenticationManager();
        assertEquals( CookieAssertionLoginModule.class, authMgr.m_loginModuleClass );
    }
View Full Code Here

        props.put( "jspwiki.loginModule.options.key2", "value2" );
        props.put( "jspwiki.loginModule.options.key3", "value3" );

        // Init the engine and verify that we initialized with the correct
        // options
        WikiEngine engine = new TestEngine( props );
        AuthenticationManager authMgr = engine.getAuthenticationManager();
        Map<String, String> options = authMgr.m_loginModuleOptions;
        assertEquals( 3, options.size() );
        assertTrue( options.containsKey( "key1" ) );
        assertTrue( options.containsKey( "key2" ) );
        assertTrue( options.containsKey( "key3" ) );
View Full Code Here

  protected void setUp() throws Exception
  {
      super.setUp();
      Properties props = new Properties();
      props.load( TestEngine.findTestProperties() );
      WikiEngine engine  = new TestEngine( props );
      m_db = new XMLGroupDatabase();
      m_db.initialize( engine, props );
      m_wiki = engine.getApplicationName();
  }
View Full Code Here

    public void setUp() throws Exception
    {
        Properties props = new Properties();
        props.load( TestEngine.findTestProperties() );
        WikiEngine engine  = new TestEngine( props );
        m_wiki = engine.getApplicationName();
       
        m_group = new Group( "TestGroup", m_wiki );
    }
View Full Code Here

    public void testMessage() throws Exception
    {
        Properties props = new Properties();
        props.load(TestEngine.findTestProperties());
        WikiEngine engine = new TestEngine(props);
        InternationalizationManager i18n = engine.getInternationalizationManager();
        String core = "templates.default";
        Locale english = Locale.ENGLISH;
        Outcome o;

        o = Outcome.DECISION_APPROVE;
View Full Code Here

  {
      super.setUp();
      Properties props = new Properties();
      props.load( TestEngine.findTestProperties() );
      props.put(XMLUserDatabase.PROP_USERDATABASE, "tests/etc/userdatabase.xml");
      WikiEngine engine  = new TestEngine(props);
      m_db = new XMLUserDatabase();
      m_db.initialize(engine, props);
  }
View Full Code Here

        throws Exception
    {
            Properties props = new Properties();
            props.load( TestEngine.findTestProperties() );
            PropertyConfigurator.configure(props);
            WikiEngine engine  = new TestEngine(props);
            m_db = engine.getUserManager().getUserDatabase();
    }
View Full Code Here

            if( context instanceof HttpServletRequest )
            {
                boolean canDo = false;
                HttpServletRequest req = (HttpServletRequest) context;
               
                WikiEngine e = WikiEngine.getInstance( req.getSession().getServletContext(), null );
              
                for( Iterator i = c_globalObjects.values().iterator(); i.hasNext(); )
                {
                    CallbackContainer cc = (CallbackContainer) i.next();
                   
                    if( cc.m_object == instance )
                    {
                        canDo = e.getAuthorizationManager().checkPermission( WikiSession.getWikiSession(e, req),
                                                                             cc.m_permission );

                        break;
                    }
                }
View Full Code Here

TOP

Related Classes of com.ecyrd.jspwiki.WikiEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.