Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Attachments without forums?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am adding attachments to PrivateMessages. When I begin to handle the attachments received, I need to create an instance of AttachmentCommon with a forum id that allows JForum to decide whether or not to allow the attachments.

In the new scenario, there is no Forum in the context, because there is no Post.

I propose to create a new AttachmentCommon constructor that establishes by default that attachments are allowed (setting canProceed to true).

I would like to hear your opinions.

Thanks in advance,
Diego


[originally posted on jforum.net by andune76]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally got around to look at this code... my suggestion would be to have a constructor like:

AttachmentCommon( request, int id, boolean isPrivateMessage)

If privateMessage is true, then there should be a check against a new global config setting that verifies that private message attachments are allowed or not. This also means that the id parameter should be handled as the PM id rather than a Forum Id.

Also, it would be nice to verify that the Quota code can limit the maximum disk space that a user can use with stored PM attachments.


[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. Ok, that sounds good, I'll check how it looks with the rest of the code. I'll add the check, �Should I add that configuration property to SystemGlobals.properties?

I'll look into the quota checking code and try to add support for that.



[originally posted on jforum.net by andune76]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!