I am in testing mode for this part of my app so I can change anything to make this work.
I have added email functionality to one of my apps. I use SMTP to send and either POP3 or IMAP4 to receive. For the receive I store everything into tables except attachments - they are in a directory and only referenced in the tables.
Everything works fine so no problem getting email to work.
What I am wanting has to do with the interface. Everthing for viewing an email account and emails looks good and works. One of the tables I have has 'folder' names called 'Inbox, outbox, trash, etc.' - the standard 'folders' in an email app. Clicking (from a list box control) on any of those shows the emails in the appropriate 'folders'
What I want now is to allow an end user to add their own 'folders' - Such as Clients. I can do that but now I want 'sub folders'. Such as under Clients they may have a Jane Doe 'folder', a Joe Blow 'folder', etc.
That is the part I am having trouble with. How can I set up the table to accomodate that and more importantly how can I display it in a nested fashion.
I was fooling with a table like so:
tblMailUserFolders
MailUserFolderID - autonumber
MailUserFolderName - text
MailUserParentFolderID - number (long)
The MailUserParentFolderID would reference back to the MailUserFolderID
example
Record 1
MailUserFolderID = 1
MailUserFolderName = Clients
Mail UserParentFolderID = NULL - NULL would indicated root folder
Record 2
MailUserFolderID=2
MailUserFolderName = Jane Doe
MailUserParentIDFolderID = 1 - any value here other than NULL would indicated a nested folder
I have no problem getting the data in but cannot figure out how to display it in a nested view.
Remember this is in testing mode and I can make any changes. The only requirement I have is that tables are used and NOT real directories.
Any ideas?
cheers
25 3483 @mshmyob
To graphically display data in a Nested/Hierarchal view, such as would exist in a Relational Database, I use a TreeView Control. Have you considered this Option?
Thanks ADezii,
I have never used the Treeview Control before. I will research that and give it a try.
cheers, @ADezii @mshmyob
This Control can be tricky to use, as soon as I get a chance, I'll whip up a Demo for you to Preview. Actually, I'll Attach a Demo that I use right now:
Just subscribing.
I will post some demo later when get a time to cleanup and comment the code.
Thanks AD,
I am working on it and will let you know. But I believe you are correct (as usual) that the ListView is the way to proceed.
cheers, @ADezii
Thanks Fish,
Look forward to it.
cheers @FishVal @mshmyob
mshmyob, just keep in mind that the ListView and TreeView are two, distinct, Controls and do not refer to the same thing.
Sorry AD, I meant TreeView :).
cheers, @ADezii
Well.
Frankly speaking, I've written this sample a while ago and the code was very kludgy and uncompleted. It was not tested in long run (I use tree with other relationship type in my applications) and a part of code was written from scratch today. It seems to work, but I couldn't state it has completely no bugs.
Contents:
Tables:
[tblTree] - tree source
the rest tables with meaningful names are used to store values to initialize object properties (in the sample only one object of OtMTree class).
Queries:
all the queries are used to initialize object properties
Forms:
[frmDObjects] - edit values used to initialize object properties
[frmTree] - form with sample tree
Modules:
[DObj] - routine to initialize object properties
[SQLSelect] - simple SQL statement parser class
[OtMTree] - class which handles all operations with tree (One-to-Many Tree)
Sample tree has the following properties: - WYSIWYG editing of node text
- WYSIWYG adding of new node
- WYSIWYG deleting of node (button in the left upper corner). So far it treats orphans appearing after node with children has been deleted in only one way - make them children of parent node.
- Drag-and-Drop to move node
- Tree nodes expanded/colapsed state as well as node order persists in source table
- Nodes have icons which are being rendered from ImageList control. Icon keys are stored in source table.
Thank you AD and Fish.
I will study your code and see what I come up with in during the next week or two and let you know my results.
Again thank you.
cheers,
@mshmyob
If you are interested, I can provide you with the Help Files for the Microsoft Common Controls, which includes, but is not limited to, the TreeView Control. It is extremely handy, in that it will provide comprehensive Help for the Properties, Methods, and Events that the Control exposes. Just let me know if you are interested.
Thanks AD,
That would be EXTREMELY helpful.
cheers, @ADezii @mshmyob
Hello mshmyob, I think that you will find this very helpful, not just for the TreeView Control, but the others also. Enjoy!
For those who find it interesting I'm attaching the last version of tree interface sample. There are several major enhancements in comparison with the previous version. - Two shortcut menus were added to OtMTree class and now all operations with nodes and tree are being held via these menus.
- Node properties dialog was added.
- Tree search dialog was added.
Regards,
Fish.
Thanks Fish,
I just completed my first run to get an understanding of the treeview using AD's code and help file. I am now ready to advance my understanding by looking at your code.
This will come in very handy.
Just to let you know I am now working with 3 tables.
tblMailAccount - holds email account info
tblMailFolder - holds folder info - linked to tblMailAccount & tblMailMessage
tblMailMessage - holds all info related to email messages
Obviously my root is picked up from the tblMailAccount and my child nodes are picked up from the tblMailFolder and the details of the selected node are picked up from the tblMailMessage.
cheers, @FishVal NeoPa 32,556
Expert Mod 16PB @mshmyob
I want to follow this thread but have little to add, particularly to the Tree structure discussion.
I would recommend using the ASMTP protocol though. In the current environment there are likely to be more and more situations where restrictions are placed on SMTP traffic at a network and security level. Authenticated SMTP will make it easier to get around such restrictions if/when you come up against them. It will also make you more popular with any network administrator trying to restrict email borne malware etc. Just an idea.
Good luck with your project :)
Good point Neo,
The ActiveX client I am using supports ESMTP so I will create functions for both SMTP and ESMTP.
cheers, @NeoPa NeoPa 32,556
Expert Mod 16PB
Does the ESMTP API support the ASMTP protocol?
I can support ESMTP, Plain, Login, CRAM-MD5, NTLM, MSN authentication.
My understanding of ASMTP is just authorizing your SMTP connection to prevent spammers from gaining access to the outgoing mail server on your ISP or internal mail server.
cheers, @NeoPa NeoPa 32,556
Expert Mod 16PB
Mine too. I don't know, but I suspect the API would have to support passing the credentials to the ASMTP server?
@mshmyob
I use code frequently that routes E-Mails directly through a SMPT Server, and have never had a problem yet. If you are interested, let me know and I'll post the relevant code and/or a Demo.
NeoPa 32,556
Expert Mod 16PB @ADezii
That will either be because the SMTP provider hasn't put the proper security in place, or it is at a network level.
With the prevalence of compromised PCs around which have there own SMTP service set up in malware it's not responsible for network administrators to allow SMTP traffic from all PCs to pass through either their SMTP servers or their firewalls.
Many do (ISPs have very little choice, although some are preparing to switch to ASMTP already), but there are relatively few who appreciate the problem and the solutions available. I wouldn't ever recommend designing software that relies on such low levels of security though. Customers can be many and varied, and the more there are, the less chance there is that none of them will be required to work in a properly secured environment.
Preparing a proper solution is not so hard and protects you from unhappy customers down the line.
@NeoPa
I should have been a little more specific in my explanation, NeoPa. Only a select, few, supervisory PCs are allowed to directly route through the SMTP Server via acceptable IP Addresses. On top of this, there is a specific Front End, available to only a select number of individuals who will actually be able to utilize this functionality.
Thanks for the offer AD but I have no problem with SMTP. Authenticating is also no problem for me.
Strange that I can create the entire emial system no problem but the TreeView is the hardest part :) but now I have a grasp of it so now with the final touches of Fish's code I think it will be just what I envisioned it to be. Only one part left of it but I will start a new thread if I have a problem with the last part.
cheers, @ADezii NeoPa 32,556
Expert Mod 16PB
That's good to hear Mshmyob.
If I may though, at the risk of weighing down this topic with too much security detail, respond to ADezii's last post, as I feel it is important to clarify this for anyone reading it who may not have the experience it seems clear we all have.
Your (ADezii's) network sounds like it's well set up and the security has been considered. This illustrates well the need for considering the security issue in the code as suggested. Consider the code running within your network but from a PC that is not allowed to send SMTP through the server. Not easy for support, when a user calls up that will probably not be aware of the IP security that's in place. I know this as I've had very similar problems in my network where PCs were blocked and I'd forgotten all the details of exactly what was set and where. That was as the administrator. Imagine how a user of the software may be confused.
Anyway, I'm glad this security discussion has been aired as it's something many are not aware of.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Glen |
last post by:
I have a Struts action form which contains a bean. I am trying to
display a bean retrieved from the database in this form using the
nested tag. Can anyone help me? I continue to get an error...
|
by: horndude77 |
last post by:
Ok, this might be for a web designing group, but here's my problem. I'm
trying to make a web page with tabs which you can navigate between
without the page reloading. I have one set of tabs working...
|
by: DelphiBlue |
last post by:
I have a Nested Datagrid that is using a data relations to tie the parent
child datagrids together. All is working well with the display but I am
having some issues trying to sort the child...
|
by: Robert |
last post by:
Need some help to stop me going around in circles on this one....
Have a nested subform (subform2) which simulates a continuous form for the
record on the parent subform.
Subform2 has rows of...
|
by: Stefan L |
last post by:
Hi everybody!
I was just starting to use partial classes in my projects, but it is
kind of anoying that the VS solution explorer displays the files flat in
the hierachy rather than nested.
...
|
by: ZikO |
last post by:
Hi there.
I have a problem. I have created nested classes but don't know how to access to
inner classes. I know I can create objects:
Hen Object;
Hen::Nest ObjectNest;
Hen::Nest::Egg...
|
by: brad |
last post by:
Group,
I'm using Visual Studio 2003 to create an ASP.NET 1.1 project which
contains nested server user controls in order to create a tree-like
hierarchy.
The tree is a sort of question and...
|
by: sharonrao123 |
last post by:
hello all,
I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
|
by: dagabe14 |
last post by:
Hi,
this is my first time posting here, so be please be nice. If i do something incorrectly (and admin notices), please let me know of my mistake.
So, I am attempting to make nested tables that...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |