6 Replies Latest reply on Sep 2, 2004 6:33 PM by Viet

    Displaying News in the Index page

    Kevin Williams Newbie

      I would like to have news stories in the lower half of my index page. How can I do that? Is it possible?

        • 1. Re: Attempting to eval Nukes
          Viet Master

          No I am not building from source, I downloaded rel 1.0. I moved the bean script into the deploy directory and recieved the following error on startup:

          2004-03-31 13:13:25,488 INFO [org.jboss.nukes.core.modules.block.BlockModule] Started

          2004-03-31 13:13:25,488 INFO [org.jboss.nukes.core.modules.core.CoreModule] Starting

          2004-03-31 13:13:25,488 INFO [org.jboss.nukes.core.Main] Added handler nukes.modules:name=core

          2004-03-31 13:13:25,528 INFO [org.jboss.nukes.core.modules.core.CoreModule] Started

          2004-03-31 13:13:25,528 INFO [org.jboss.nukes.core.modules.profile.ProfileModule] Starting

          2004-03-31 13:13:25,528 WARN [org.jboss.system.ServiceController] Problem starting service nukes.modules:name=profile

          javax.naming.NameNotFoundException: PropertyValue not bound

          at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)

          at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)

          at org.jnp.server.NamingServer.getObject(NamingServer.java:509)

          at org.jnp.server.NamingServer.lookup(NamingServer.java:282)

          at org.jnp.server.NamingServer.lookup(NamingServer.java:256)

          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)

          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)

          at javax.naming.InitialContext.lookup(InitialContext.java:345)

          at org.jboss.nukes.core.modules.profile.ProfileModule.start(ProfileModule.java:87)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectReferenceInterceptor.java:59)

          at org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttributeInterceptor.java:43)

          at org.jboss.mx.interceptor.PersistenceInterceptor2.invoke(PersistenceInterceptor2.java:93)

          at org.jboss.nukes.mx.LifeCycleInterceptor.transition(LifeCycleInterceptor.java:172)

          at org.jboss.nukes.mx.LifeCycleInterceptor.start(LifeCycleInterceptor.java:134)

          at org.jboss.nukes.mx.LifeCycleInterceptor.invoke(LifeCycleInterceptor.java:64)

          at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:76)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)

          at $Proxy14.start(Unknown Source)

          at org.jboss.system.ServiceController.start(ServiceController.java:394)

          at org.jboss.system.ServiceController.start(ServiceController.java:411)

          at org.jboss.system.ServiceController.start(ServiceController.java:411)

          at org.jboss.system.ServiceController.start(ServiceController.java:411)

          at org.jboss.system.ServiceController.start(ServiceController.java:411)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

          at $Proxy34.start(Unknown Source)

          at org.jboss.ejb.EjbModule.startService(EjbModule.java:331)

          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)

          at $Proxy14.start(Unknown Source)

          at org.jboss.system.ServiceController.start(ServiceController.java:394)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

          at $Proxy12.start(Unknown Source)

          at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:544)

          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)

          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)

          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)

          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

          at $Proxy6.deploy(Unknown Source)

          at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)

          at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)

          at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)

          at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)

          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)

          at $Proxy0.start(Unknown Source)

          at org.jboss.system.ServiceController.start(ServiceController.java:394)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

          at $Proxy4.start(Unknown Source)

          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)

          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)

          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)

          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)

          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)

          at java.lang.reflect.Method.invoke(Native Method)

          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)

          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

          at $Proxy5.deploy(Unknown Source)

          at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)

          at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)

          at org.jboss.Main.boot(Main.java:150)

          at org.jboss.Main$1.run(Main.java:395)

          at java.lang.Thread.run(Thread.java:479)

          2004-03-31 13:13:25,538 INFO [org.jboss.nukes.core.modules.index.IndexModule] Starting

          2004-03-31 13:13:25,538 INFO [org.jboss.nukes.component.Component.index] Uses the dir : C:\src\jboss-3.2.3RC1\server\default\data\nukes\index

          2004-03-31 13:13:25,678 INFO [org.jboss.nukes.component.Component.index] Add nukes.modules:name=index to indices

          2004-03-31 13:13:25,808 INFO [org.jboss.nukes.core.modules.index.IndexModule] Started

          2004-03-31 13:13:25,808 INFO [org.jboss.nukes.core.modules.core.blocks.MenuBlock] Starting

          2004-03-31 13:13:25,848 ERROR [org.jboss.nukes.core.modules.index.Index.index] Cannot open index writer

          java.io.IOException: Lock obtain timed out

          at org.apache.lucene.store.Lock.obtain(Lock.java:97)

          at org.apache.lucene.index.IndexWriter.(IndexWriter.java:173)

          at org.apache.lucene.index.IndexWriter.(IndexWriter.java:160)

          at org.jboss.nukes.core.modules.index.Index.getWriter(Index.java:350)

          at org.jboss.nukes.core.modules.index.Index.access$200(Index.java:36)

          at org.jboss.nukes.core.modules.index.Index$WriterTask.run(Index.java:540)

          at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:88)

          at java.lang.Thread.run(Thread.java:479)

          2004-03-31 13:13:25,908 INFO [org.jboss.nukes.core.modules.core.blocks.MenuBlock] Started

          2004-03-31 13:13:25,908 INFO [org.jboss.nukes.core.modules.core.blocks.WhosOnlineBlock] Starting

          2004-03-31 13:13:25,918 INFO [org.jboss.nukes.core.modules.core.blocks.WhosOnlineBlock] Started

          2004-03-31 13:13:25,918 INFO [org.jboss.nukes.core.themes.seabreeze.SeaBreezeTheme] Starting

          2004-03-31 13:13:25,948 INFO [org.jboss.nukes.core.themes.seabreeze.SeaBreezeTheme] Started


          I am going to try removing the beanscript (as I assume it has already run) and restart nukes.

          • 2. Re: Displaying News in the Index page
            Viet Master

            Could you file a bur report in sourceforge for this ?

            • 3. Re: Displaying News in the Index page
              Viet Master

              This feature does not exist (yet)

              • 4. Re: Displaying News in the Index page
                john doe Newbie

                I have implemented this feature. Want you more details ?

                • 6. Re: Displaying News in the Index page
                  john doe Newbie

                  How to implement news stories in the half part of index page.

                  More precisely, I wanted to see all news on index page (main page), and some news filtered by topic on some "sub index", in fact headers pages.

                  I modified HtmlModule, to invoke news module, adding the following at the end of
                  private void print(Page page, String fileId, String contentType, String content, Integer id) method :

                  try
                  {
                  server.invoke(ObjectNameFactory.create "nukes.modules:name=news"), "news", new Object[]{page}, new String[]{Page.class.getName()});
                  }
                  catch (Exception e)
                  {
                  page.print("Error loading news");
                  e.printStackTrace();
                  }

                  (of course error message should be localized ! :))

                  The question is : when should we call news ? surely not on each page !

                  So I choose to trigger if page=index (main page) OR if topicid is not null (ie the address looks like .../nukes/subindex?topicid=2)
                  Thus, all calls to index page remains unchanged, while I can view stories whenever by completing topicid.

                  Here is the code snippet for this basic behaviour implementation :

                  if ("/index".equals(fileId) || page.getParameter ("topicid")!=null)
                  {
                  try
                  {
                  server.invoke(ObjectNameFactory.create("nukes.modules:name=news"), "news", new Object[]{page}, new String[]{Page.class.getName()});
                  }
                  catch (Exception e)
                  {
                  page.print("Error loading news");
                  e.printStackTrace();
                  }
                  }

                  I made that (quick and dirty) to meet my own needs,
                  to be really usable, IMHO, we should add :
                  A MBean property (default to NO) to view news or not on index page ;
                  A topicid meaning "all news" (topicid=0) to view all news in wichever page ;
                  Localization of error message.