Comments
Posted by Ulrich Krause on 08/25/2006 01:09:08 AMError at line 98.java.lang.InternalError
I copied the code to mail mailDB. When running the agent I get two errormessages
Error at line 98.java.lang.InternalError
Error at line 102.java.lang.InternalError
In spite of these messages the attachments are stored to disk.
Any idea ?
Posted by Kevin Pettitt on 08/25/2006 07:28:06 AMDid you resave/recompile the agent after copying elements?
Hi Ulrich,
Any java errors indicate that the problem is with the java status dialog box stuff. Since this code comes largely from the script library, you will probably need to resave the agent at least once to make sure everything compiles properly. If that doesn't fix the problem, what version of Notes are you running? I've only tested on 6.5.
Thanks again for your contribution to this effort.
Kevin
Posted by Ulrich Krause on 08/25/2006 08:25:28 AMI recompiled / resaved the agent ...
as well as the scriptzlib but the error still occurs. I'm using 7.0.1 ( german )
Posted by Kevin Pettitt on 08/25/2006 09:33:59 AMAnyone else having problems?
Ulrich, I cannot reproduce, so it's obviously something different about your machine. Might be 7.0.1 but I doubt it. The German installation is more likely the issue, but it could just as easily be something to do with German *Windows* as with German *Notes*. I'm not a java expert and certainly didn't write any of the java in this code, so I can't speculate too much, but it does look like something to do with your particular JVM setup.
Maybe Julian can shed some light. Sorry.
Posted by Kevin Pettitt on 08/25/2006 10:51:03 AMJust checking, but did you make a change to the agent before resaving?
Ulrich, I just had a thought that may not apply since you probably already did this, but if by some chance you only opened the agent and hit save, without making any sort of "change" to it, then it probably didn't recompile. To be sure everything compiles correctly, you'll have to make a dummy change, like adding then deleting a space, before saving. Hopefully that's the issue.
Posted by Ulrich Krause on 08/25/2006 11:47:08 AMHMM
yes, I added an extra space in the agent and then saved it. And I compiled the java part as well. But still
Error at line 98: java.lang.InternalError
Error at line 102: java.lang.InternalError
1 messages selected for processing...
Documents will be saved in C:\temp
mc-4.6.0-2.i386.rpm
Congratulations! You have removed files totalling 1,7 MB
Process complete! Please click the Close button to finish.
I guess that in fact it has to do with the german client because I can reproduce the issue in my office and on my home laptop.
OK, so I will install an english client and let you know if this will raise the error, too.
Posted by Barb Skedel on 08/29/2006 03:54:00 PMSame error in English version
I tried it with version 7.0 and 7.0.1 and get the same errors. I do like the fact how it works; cool agent.
Posted by Kevin Pettitt on 08/29/2006 04:27:45 PMAnyone using 7.x English NOT getting an error?
If you're running ND7 in English please let me know if this works or not for you. If everyone with ND7 has a problem that will mean something different than if some do, some don't.
Thx
Posted by Markus Koller on 09/19/2006 01:28:03 AMCheck for attachments
I would check for attachments in the document to prevent this errors:
Notes Error at line 145: Type mismatch
Notes Error at line 146: FOR loop not initialized
Notes Error at line 147: FOR loop not initialized
Notes Error at line 148: FOR loop not initialized
Notes Error at line 150: FOR loop not initialized
Notes Error at line 165: FOR loop not initialized
Notes Error at line 166: FOR loop not initialized
old code:
' Goes to the body field and finds all attachments
If ( rtitem.Type = RICHTEXT ) Then
Forall obj In rtitem.EmbeddedObjects
If ( obj.Type = EMBED_ATTACHMENT ) Then
new code:
' Goes to the body field and finds all attachments
If ( rtitem.Type = RICHTEXT ) Then
If Not Isempty(rtitem.EmbeddedObjects) Then
Forall obj In rtitem.EmbeddedObjects
If ( obj.Type = EMBED_ATTACHMENT ) Then
Posted by Markus Koller on 09/19/2006 01:41:00 AMJavaErrors
I also get
Error at line 98: java.lang.InternalError
Error at line 102: java.lang.InternalError
Using Notes 7.0.1 english, resaved the Library and the agent, no success.
The errors occur here:
sb.setInfoBoxColor(sb.COLOR_BLACK)
sb.setBarText(sb.BOXMSG_PERCENT)
Not sure if the functions are used correctly.
Posted by Markus Koller on 09/19/2006 02:06:11 AMQuickFix
'sb.setInfoBoxColor(sb.COLOR_BLACK)
sb.setInfoBoxColor(0)
'sb.setBarText(sb.BOXMSG_PERCENT)
sb.setBarText(1)
'sb.setInfoBoxColor(sb.COLOR_RED)
sb.setInfoBoxColor(2)
Posted by Barb Skedel on 09/19/2006 07:17:16 AMThanks!
Adding the quickfix code to the agent works like a charm; no errors now. Thank you.
Posted by Kevin Pettitt on 09/19/2006 07:37:01 AMExcellent, thanks folks for the debugging help...
I'll post update soon. I've also been helping a client adapt the code to broader (beyond email) use, and found that things can get a little less predictable when you're not just looking in the Body field. In some cases, it seems there are embedded objects that are not associated with fields per se...might be documents originally created in the 4.6 days. Anyway, if I get that working reliably I'll post that separately.
Posted by Barb Skedel on 09/19/2006 09:34:36 AMOne other question
Is this available to users who only have access to their mail via Domino Web Access client?
Posted by Kevin Pettitt on 09/19/2006 02:13:07 PMNo Web Access functionality.
That would require a completely different approach, and even if you built it, you'd have trouble selecting more than whatever documents are being shown in the view. In the Notes client, you could literally select 1000+ documents and hit go.
Posted by Uwe Janssen on 11/08/2006 05:35:17 AMExpand functionality?
Thanks for the fine agent!
Is it possible to expand functionality with the options:
- remove the attachments from all mail message with attachments
- select mail message by date (all message older than date x)
- save attachments to the file system in a folder structure similarly to the folders in the mail-db
That would be great.
Posted by Michelle Hutchinson on 01/04/2007 01:24:58 PMThank you
Thank you - thank you. Our users are too lazy to open each email and delete attachments when they reach their quota. And they forget where they stored the attachment. This will help in both areas.
This agent ran great but I did also receive the error posted above about line 98 & line 102. We are running 7.0.2 English.
I'm not a java person - will the quick fix posted above work and if so where do I add this?
Thanks!
Posted by Markus Koller on 01/05/2007 04:17:28 AMwhere to find the buggy code
Michelle,
you find the code in the Initialize section. Scroll down to line 89:
sb.setInfoBoxColor(sb.COLOR_RED)
Remark it with a ' and enter the new code for it:
' sb.setInfoBoxColor(sb.COLOR_RED)
sb.setInfoBoxColor(2)
Do the same with sb.setInfoBoxColor(sb.COLOR_BLACK) on line 99 and sb.setBarText(sb.BOXMSG_PERCENT) on 104 (approximately, depends, on how you replaced the code above):
Should now look like this:
End If
' sb.setInfoBoxColor(sb.COLOR_BLACK)
sb.setInfoBoxColor(0)
'sb.println("")
sb.updateMaxValue(totalDocs)
' sb.setBarText(sb.BOXMSG_PERCENT)
sb.setBarText(1)
'** start stepping through the documents
Posted by Markus Koller on 01/05/2007 05:20:03 AMcheck for attachments
Kevin, I would suggest one more check: The agent produces errors, if there are no attachments in the Body-Item. Add this line before the Forall obj In rtitem.EmbeddedObjects loop:
.
If Not Isempty(rtitem.EmbeddedObjects) Then
Forall obj In rtitem.EmbeddedObjects
.
and close the If after the End Forall:
.
End Forall
End If
.
.
BTW: The agent goes mad, if the entered path does not exist.
Posted by Angshuman Guin on 02/15/2007 01:19:58 PMwhere is the script?
This might sound stupid... I copied the agent over to my mail database but I could not find the java script... How am I supposed to copy it?
Thanks!
Posted by Randal Oulton on 04/24/2007 12:39:15 PMupdates?
I note that the last modified date on the zipped up file is 24 Aug 2006.
I take it this means then that when Kevin said "I'll post update soon" on 09/19/2006, that life intervened, as it often does, and he hasn't gotten around to it, and that we need to add enhancements / fixes such as those suggested by Markus Koller ourselves (no biggie, just making sure, not trying to look a gift horse in the mouth, grin.)
Posted by Kevin Pettitt on 04/24/2007 01:04:52 PMLife did indeed intervene...
If anyone who has already taken the initiative would like to send me the modifications I'll post them here in short order, and with due credit. Sorry for letting this one slip.
Kevin
www.lotusguru.com
Posted by Kevin Pettitt on 05/05/2007 11:07:27 PMUpdated Code Posted - Thank You Markus Koller!
Many thanks to Markus Koller for contributing his various fixes and improvements of this agent code to the community. I have reposted version 2 incorporating his changes, and the agent seems to work great for me on Notes 7.0.2. Please report success (if you had problems before) or failure, and version number.
Thanks for all your feedback.
Posted by Ron Turnbull on 05/07/2007 04:06:56 PMHow about including a link to the attachment in the email?
It would be really nice if you could also include a link in the email to the file system where the attachment is being stored. This would save the user from having to find it manually. Some of the other solutions I looked at provided this functionality. Still, this is a very nice utility.
Posted by Markus Koller on 05/08/2007 05:12:22 AMA hotspot would be nice, but...
I think you can only create hotspot links to DBs, Views or Docs. So you only can add a file:// link. Something like this would do it:
Line 11, add: Dim currentpathurl As String
Line 38, add: currentpathurl = "file:///" & currentpath
Line 176, add: Call rtitem.AppendText( " -- Link to archive folder: " & currentpathurl )
Line 185, add: Call rtitem.AppendText( " -- Link to archive folder: " & currentpathurl )
Beware: Line Numbers can vary. You should find the logical locations. Kevin, would you add the code to the script, please?
Posted by Kevin Pettitt on 05/08/2007 10:46:38 AMMarkus - thanks for the link syntax...
I saw this and thought "sure we can do that" but couldn't figure out the hotspot logic or immediately recall the "file://" url syntax, so this is great. I am wondering though whether to link directly to the file or just open the archive folder. Since the folder could have a lot of stuff inside it might be better to open the actual file. I suppose if its no longer in the same place some sort of error will popup but that may be ok as long as it's a useful error message like "file not found" or something. I'll try out a few options and see what works best.
Posted by maggie h innes on 04/20/2009 12:53:26 AMFantastic
Hi This worked really well...first go..
thankyou I had been searching for a Tool to do remove and save attachments for a while.
Site using Domino 7.03 DWA7.ntf
Posted by Keith A Collyer on 10/02/2009 09:35:55 AMNot a Lotus expert - but need this!
Hi
I haven't worked out how to get this agent into my mail file. I can open the ArchiveAttachment database, and (perhaps naively) was expecting that I could just copy the agent into my mail DB. If I do that I get an error:
Illegal circular USE: JavaStatusBox
I am using Notes 8.5 with the eProductivity template (which may of course be causing the problem...)
Posted by Kevin Pettitt on 10/02/2009 10:51:15 AMNot tested in 8.5 - YMMV
Keith, I'm afraid I haven't had occasion to test/update this for 8.5, let along the eProductivity template, so it may very well just not work. If you haven't already you definitely should open the agent, make a "dummy" change, then resave it, as not having done so would explain an error like this. Let me know how that works out, and if you end up fixing any genuine issues please send in the fix and I'll update accordingly.
Posted by Keith A Collyer on 10/02/2009 12:05:37 PMThanks, Kevin, I'll try that
does it matter whether I make the change in the original database before I copy the agent or in the working mail database?
Posted by Kevin Pettitt on 10/02/2009 12:28:01 PMYes, make it in the target db after copying
Yes, make it in the target db after copying
Posted by Keith A Collyer on 10/02/2009 02:19:04 PMScript error
Hi Kevin, I tried what you suggested but the save failed because of a script error:
Error loading USE or USELSX module: JavaStatusBox
with the Use "JavaStatusBox" line highlighted in red. I haven't programmed professionally in over twenty years, but that looks like its telling me it can't find JavaStatusBox.
Posted by Kevin Pettitt on 10/02/2009 03:34:42 PMDid you copy over the script library too?
The agent is only one of TWO elements that need to be copied, as stated in the instructions :-)
Posted by Keith A Collyer on 10/06/2009 03:48:05 AMAt the risk of sounding even dumber...
... how do I copy the Java? (I see I am not the only person who has asked this question)
Posted by Kevin Pettitt on 10/06/2009 09:18:09 AMLook under the "Script Library" design element heading in Domino Designer
There is a single library that you just copy like you would any other design element (Select element and hit Ctrl-C copy from the designer view, open same view in target db and hit Ctrl-V paste), not by opening the library and copying lines of code)
Posted by Keith A Collyer on 10/08/2009 05:39:23 AMYes, it is my fault
For expecting a site designed and run by code gurus to be usable by mere mortals like me (not a criticism! I hope much of what you do here makes it into the product in the future). I don't have Domino Designer installed - maybe when 8.5.1 comes next week I'll get it - and I didn't realise you needed it. Not blaming anyone except me for this.
thanks for all your help. I hope I will be able to use the code soon ;-)
Posted by Kevin Pettitt on 10/08/2009 08:45:25 AMIt's generally expected that OpenNTF downloaders have Domino Designer
Keith, while it's certainly possible and actually fairly easy to add an "installer" for code like this particular example, and thus bypass the need for Domino Designer, there is generally not much you can do by way of customizing or deploying applications to a server without it. Making the Designer client free is a big help for folks like yourself, and we all hope that move translates into even greater visibility for OpenNTF and Domino app dev in general.