powered by Jive Software

Display the entire history

Spark keeps history of all messages in the *~/.Spark/user/user@*example.com/transcripts/ folder.

Although there is no way to view the entire history in the application itself.

I developed this functionality. This window allows to view the messages grouped by the date tag as well as search the text.

Please see some screenshot below.

Also I attached the patch.

To me it could be handy for users.

Please let me know what do you think about this functionality.




history_window.patch.zip (6847 Bytes)

1 Like

This feature refers to Group Chat messages history. I tested it and looks good

Would like to see community feedback.

Depending on feedback, I will commit the code in spark if community agrees

thanks,

Mircea

Thanks, Mircea!

I have applied the patch and compiled Spark. But it doesn’t show anything when i go to View Log. It shows the size (52 Kb after 4 messages), but a blank window where the history should be.

It’s intresting.

Could you please provide some screenshots, jdk version, and OS you use ?

Also please take a look at the log file, any exception occured?

Appreciate your help wr00t!

I can provide screenshots later, what logs exactly do you need? AppData\Spark\logs? I’m using the latest JDK 7 update 21 (32-bit), my OS is Windows 7 64-bit, compiling with Netbeans.

Thanks wr00t.

what logs exactly do you need? AppData\Spark\logs?

Yes. This one Spark/logs/errors.log

It doesn’t write anything to logs when i try to view a chat log. I have only these errors, a few days old:

May 08, 2013 6:50:38 AM org.jivesoftware.spark.util.log.Log error

SEVERE: Error calling constructor for org.jivesoftware.spark.ui.rooms.GroupChatRoom

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.jivesoftware.spark.util.UIComponentRegistry.instantiate(UIComponentRegistry .java:501)

at org.jivesoftware.spark.util.UIComponentRegistry.createGroupChatRoom(UIComponent Registry.java:444)

at org.jivesoftware.spark.ui.conferences.ConferenceUtils.joinConferenceOnSeperateT hread(ConferenceUtils.java:163)

at org.jivesoftware.spark.ui.conferences.ConferenceUtils.joinConferenceOnSeperateT hread(ConferenceUtils.java:128)

at org.jivesoftware.spark.ui.conferences.BookmarksUI.setBookmarks(BookmarksUI.java :605)

at org.jivesoftware.spark.ui.conferences.BookmarksUI$4.run(BookmarksUI.java:204)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.NullPointerException

at javax.swing.text.JTextComponent.setCaretPosition(Unknown Source)

at org.jivesoftware.spark.ui.ChatRoom.scrollToBottom(ChatRoom.java:609)

at org.jivesoftware.spark.ui.ChatRoom.(ChatRoom.java:223)

at org.jivesoftware.spark.ui.rooms.GroupChatRoom.(GroupChatRoom.java:132)

… 16 more

May 11, 2013 2:09:57 PM org.jivesoftware.spark.util.log.Log error

SEVERE: Closing Group Chat Room error.

java.lang.IllegalStateException: Not connected to server.

at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:495)

at org.jivesoftware.smackx.muc.MultiUserChat.leave(MultiUserChat.java:540)

at org.jivesoftware.spark.ui.rooms.GroupChatRoom.leaveChatRoom(GroupChatRoom.java: 561)

at org.jivesoftware.spark.ui.ChatContainer.leaveChatRoom(ChatContainer.java:606)

at org.jivesoftware.spark.Workspace$1.shutdown(Workspace.java:147)

at org.jivesoftware.MainWindow.fireWindowShutdown(MainWindow.java:255)

at org.jivesoftware.MainWindow.shutdown(MainWindow.java:284)

at org.jivesoftware.MainWindow$8.actionPerformed(MainWindow.java:594)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)

at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)

at javax.swing.AbstractButton.doClick(AbstractButton.java:376)

at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)

at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.ja va:877)

at java.awt.Component.processMouseEvent(Component.java:6505)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)

at java.awt.Component.processEvent(Component.java:6270)

at java.awt.Container.processEvent(Container.java:2229)

at java.awt.Component.dispatchEventImpl(Component.java:4861)

at java.awt.Container.dispatchEventImpl(Container.java:2287)

at java.awt.Component.dispatchEvent(Component.java:4687)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)

at java.awt.Container.dispatchEventImpl(Container.java:2273)

at java.awt.Window.dispatchEventImpl(Window.java:2719)

at java.awt.Component.dispatchEvent(Component.java:4687)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)

at java.awt.EventQueue.access$200(EventQueue.java:103)

at java.awt.EventQueue$3.run(EventQueue.java:688)

at java.awt.EventQueue$3.run(EventQueue.java:686)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java: 76)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java: 87)

at java.awt.EventQueue$4.run(EventQueue.java:702)

at java.awt.EventQueue$4.run(EventQueue.java:700)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java: 76)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:24 2)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:15 0)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

May 11, 2013 2:10:02 PM org.jivesoftware.spark.util.log.Log error

SEVERE: Error Setting JTattoo

java.lang.ClassNotFoundException: com.jtattoo.plaf.luna.LunaLookAndFeel

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

at org.jivesoftware.Spark.loadLookAndFeel(Spark.java:285)

at org.jivesoftware.Spark.startup(Spark.java:177)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.jivesoftware.launcher.Startup.start(Startup.java:94)

at org.jivesoftware.launcher.Startup.main(Startup.java:44)

Thanks for you reply wroot.

I haven’t reproduced this issue yet.

It’d be great if you sent me your build I’ll test it in my environment.

Is it possible?

I can upload it on my host. What exactly do you need, whole /target folder?

/target/build folder

Thanks a lot

I downloaded spark, applied patch and rebuilt it from scratch using JDK7, W7 and Ant 1.6.5.

Anyway if there is a history file then the window is openned correctly and there is a history tree.

I am out of ideas what can work wrong.

Could you send me your build please and a few screenshots please?

Thanks for your help wr00t.

Here’s my build


build.zip (18974711 Bytes)

Thanks for the build.

I run it on my w7 x64 laptop with no changes.

It works anyway. I’ll go through the source code again, meanwhile could you please apply patch from scratch one more time.

see attached.

Maybe there is reproducible only with one specific account.

wroot, are you using an account on igniterealtime.org? Do you have a test account on this server so we can have a look to see if we can reproduce it this way?

Thanks,

Mircea

Or there are can be wrong formating of xml file history.

Could you take a look the the test@conference.wroot file?

I think it it should be somewhere in %UserAppData%/Spark/user/wroot@server/transcripts/test@conference.wroot.xml

Now this History window understands xml like below.

slava1@server

slava2@server

hey

2013-05-07 13:35:07.869 NOVT

Actually it does work ok with another user, which i haven’t used a lot. At first i was trying with my main user (admin user on my test server). He has lots of history for that room (56 KB). And the first part of the history looks like you described, but not indented. Like this:

test@conference.wrootadmin@wroot/S parkdsf2008-05-01 18:26:45.921 EESTadmin@wroot/Sparktest@conference.w rootThis room is not anonymous.2008-11-15 22:47:51.127 CETadmin@wroot/Sparktest@conference.wr ootThis room is not anonymous.2008-11-15 23:47:51.127 EETtest@conference.wrootnullsdf2008-11-15 23:48:03.34 EET

then at some point i think it got corrupted and a part of tag is missing:

admin@wroot/Sparktest@conference.wroot/john_doedfgdfg2011-04-28 21:08:51.281 EESTadmin@wroot/Sparktest@conference.w root/john_doedfgdfg2011-04-28 21:08:51.296 EEST**</messag **

And then it starts to show indented lines like this:

admin@wroot/wroot

test@conference.wroot/nova

Hi

2013-05-05 14:38:12.445 EEST

test@conference.wroot

null

lk

2013-05-05 14:38:22.464 EEST

admin@wroot/wroot

test@conference.wroot/mira

hello

2013-05-11 14:07:03.158 EEST

So, this is probably the transcript file problem. Maybe related to SPARK-1385

Thanks.

http://issues.igniterealtime.org/browse/SPARK-1385 is fixed now, so probably from now this problem won’t occur again.

Please let us know if we can commit the code

Mircea

I say commit. Probably some older chat rooms will have problems showing the log, but at least we know that the problem is with transcript.