Hello!
We've upgraded Jive Forums to Clearspace with some issues, but I'll report them later.
Now we have some troubles with NNTP gateway:
1. Clearspace posts are doubled by NNTP gateway. When I do a post to Community, my post goes to NNTP server and back as once new message to community. Hopefully it happens only once. :-)
You can see this here:
Original post: http://jetbrains.net/devnet/message/5227292#5227292
Double: http://jetbrains.net/devnet/message/5227293#5227293
2. Clearspace posts HTML messages as text/plain. You can see results in links above.
I've patched NewsgroupExporter.java to fix that, but I'm sure it will be good if you do that.
Thanks,
Sergey
We found that the problem N1 is in NewsgroupExporter.java:
285 ForumMessage m = getForumManager().getMessage(forumMessage.getID());
We receive NPE here, because ForumManager is Null
NNTP integraion is very important for us. We'd appreciate if you could provide an urgent fix for us that we can use.
If you can let us know where to make changes in the code, this is fine.
Thanks in advance,
-S.
Hey Sergey,
You'll want to replace that line with these:
JiveContext factory = JiveApplication.getContext(); DbForumMessage m = (DbForumMessage) factory.getForumManager().getMessage(forumMessage.getID());
Thanks,
Vinh
Ok, thanks, it's the same solution as I done yesterday. It works.
When will you integrate this into release build of Clearspace ?
Also I've done following with NewsgroupsExporter.java to fix ugly html messages in NNTP readers:
800: else {
//message.setText(body.toString(), getMimeCharacterEncoding());
message.setContent(body.toString(), "text/html");
}
and (to fix Sent Date in Outlook Express):
// SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z",
// java.util.Locale.US);
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z",
java.util.Locale.US);
And last question: Is it possible to get plain/text message from Clearspace to post it to NNTP ?
Some clients can't read HTML body at all.
Thanks,
Sergey
It should be possible to mirror the functionality of the email gateway exporter, which converts the content to wiki syntax before sending out the message. You'll need to change these lines in NewsgroupExporter.AddContent:
org.w3c.dom.Document domBody = forumMessage.getBody();
StringBuffer body = new StringBuffer(JAXPUtils.toXmlString(domBody));
To:
String html = WikiContentHelper.contentBodyToWikiText(forumMessage.getBody());
StringBuffer body = new StringBuffer(html);
You'll also need to import this into NewsgroupExporter:
import com.jivesoftware.base.wiki.WikiContentHelper;
Thanks,
Vinh
Ok, thank you, it works!
But I see some troubles with this formatter like following message.
Is there any possible to remove "font" section and keep line breaks ?
================
'lo all, I just upgraded our server to the new Team City 4 release and am seeing some exceptions during an inspection run (from a pom file): {font:style=text-decoration: underline;}[20:48:35]:{font} Analyzing code ... 2%{font:style=text-decoration: underline;}[20:48:37]:{font} +[ 141367] ERROR - ex.GlobalInspectionContextImpl -+{font:style=text-decoration: underline;}[20:48:37]:{font} +java.lang.IllegalStateException: @NotNull method co m/intellij/extapi/psi/StubBasedPsiElementBase.getRequiredStubOrPsiChild must not return null+{font:style=text-decoration: underline;}[20:48:37]:{font} +at com.intellij.extapi.psi.StubBasedPsiElementBase.getRequiredStubOrPsiChild(StubBasedPsiElementBase.java:175)+{font:style=text-decoration: underlin e;}[20:48:37]:{font} +at com.intellij.psi.impl.source.PsiMethodImpl.getParameterList(PsiMethodImpl.java:73)+{font:style=text-decoration: underline;}[20:48:37]:{font} +at com.intellij.psi.impl.source.PsiMethodImpl.isVarArgs(PsiMethodImpl.java:77)+{font:style=text-decoration: underline;}[20:48:37]:{fo nt} +at com.intellij.psi.impl.java.stubs.JavaMethodElementType.createStub(JavaMethodElementType.java:7)+{font:style=text-decoration: underline;}[20:48:37]:{font} Analyzing code ... 3% \\and\\{font:style=text-decoration: underline;}[20:48:45]:{font} +[ 149020] ERROR - ex.GlobalInspectionContextImpl -+{font:style=text-decoration: underline;}[20:48:45]:{font} +java.util.NoSuchElementException+{font:style=text-decoration: underline;}[20:48:45]:{font} +at java.util.AbstractList$Itr.n ext(AbstractList.java:350)+{font:style=text-decoration: underline;}[20:48:45]:{font} +at com.intellij.psi.impl.source.PsiFileImpl.a(PsiFileImpl.java:370)+{font:style=text-decoration: underline;}[20:48:45]:{font} +at com.intellij.psi.impl.source.PsiFileImpl.a(PsiFileImpl.java:357)+{font:style=text-de coration: underline;}[20:48:45]:{font} +at com.intellij.psi.impl.source.PsiFileImpl.a(PsiFileImpl.java:357)+{font:style=text-decoration: underline;}[20:48:45]:{font} +at com.intellij.psi.impl.source.PsiFileImpl.a(PsiFileImpl.java:357)+{font:style=text-decoration: underline;}[20:48:45]:{font} +at com intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:354)+{font:style=text-decoration: underline;}[20:48:45]:{font} +at com.intellij.extapi.psi.StubBasedPsiElementBase.getNode(StubBasedPsiElementBase.java:54)+{font:style=text-decoration: underline;}[20:48:45]:{font} +at com.intelli j.psi.impl.source.PsiMethodImpl.getNode(PsiMethodImpl.java:20)+\\Is this a known issue at all? Shall I raise them in Jira?\\ --- Original message URL: http://www.jetbrains.net/devnet/message/5227876#5227876
================
Thanks,
Sergey
I don't think there's a way to turn this off, since it's a part of the wiki syntax. You'd have to take a closer look at how it's being generated in the MessageFontVisitor class (in the HTMLMessageConverter.java file) and visitChildContent().
Thank you for the hint.
I see you told me wrong function in the first message. The right conversion done by WikiContentHelper.contentBodyToMessageText().
So now I'm attaching the patch for NewsgroupExporter.java for CS 2.5.4 with my changes.
Look them please, it will be great if you merge them into your product.
We're widely using NNTP gateways and we coldn't use them without these patches.
Some comments to make this patch understandable:
1. Changed text/html export to text/plain with right conversion.
2. Added a little bit log records to find messages which breaks NNTP exports.
3. Added code to split long strings into 300 chars pieces, because NNTP server doesn't accepts very long lines.
4. Added code to simple check user's email if he doesn't hide it and prefer to post to NNTP. If this email has wrong format, it changes to defaultEmail(), because NNTP server doesn't allow wrong emails.
5. Fixed NPE with ForumManager.
6. Changed Date format in the message to make them viewable by Outlook Express. It doesn't breaks other clients.
I hope you add these changes into your product, because it's heavy to patch it before every update.
Noted, thanks for the catch.
I've created two JIRA issues for this (CS-10051 and CS-10052) with a set fix date of 2.5.6. I'll make sure to roll your changes into the fixes.
Jive combines collaboration software, community software & social networking software into the leading SBS solution.
© Copyright 2000–2009 Jive Software. All rights reserved.
915 SW Stark St., Suite 400, Portland, OR 97205