PUMA Manager - Code

Topics: Developer Forum
Nov 19, 2006 at 3:55 AM
Any one can help me in getting the source code related to PUMA Manager as I am getting some issue while using the tool.

Thank you for the help

Thanks
Ram
Coordinator
Nov 19, 2006 at 7:33 PM
It is included in Change Set: 11601
(Apologies - I thought it was already included)

There is much to do in that application - especially the wizard interface for designing new reports or modifying existsing ones and also a wizard is needed to set up automatic document categorisation...all help with that would be appreciated
Nov 20, 2006 at 2:40 PM
Thank you for the help. I am checking all the functionality to make sure all the components are working. Once I understood the functionality I will be contributing for enhancements and fixing any bugs.

Thank you for the help for including the code.

Thanks
RAm
Developer
Mar 3, 2007 at 3:41 AM
When I was trying do debug the class FormSelectServer of Puma Manager solution. I can’t see any server to add. I knew exactly where the problem is. There is a piece of code like following:
Private Sub RefreshServerList()

Me.TreeView_Network.Nodes.Clear()

Dim nodeMain As TreeNode = TreeView_Network.Nodes.Add("All Servers")
nodeMain.ImageIndex = 0
Dim de As New DirectorySearcher
Try
For Each cde As DirectoryEntry In de.FindAll
nodeMain.Nodes.Add(cde.Name).ImageIndex = 2
Next
Catch ex As Exception
'\\ Could not find any servers
TreeView_Network.Enabled = False
End Try
End Sub
I have lookat MSDN for what the DirectorySearcher is, I also leaned about ADSI, ADAM…, but I can’t find the code which contains the path or searchroot looking for PrintServers in the PUMA project(alpha).
Any body can give me the “light of Candle”, the sample code to see all PrintServers in my workgroup.
thanks in advanced!
Coordinator
Mar 3, 2007 at 10:04 AM
There is a class in the PrintQueueWatch project called "PrintServer" and if you have an instance of that class that has been created with the server name then the .Printers member will list all the printers on that server e.g.:-

Dim myServer As New PrintQueueWatch.PrintServer("DUBLIN_PUBLIC")
For Each p As PrinterInformation In myServer.Printers
Trace.WriteLine(p.Printername & " found on " & myServer.Servername)
Next p

To list all the print servers visible to you, you could create a new PrintServer class instance for each machine name found on the local network but only add it to the list if it's .Printers.Count > 0 ?
Developer
Mar 13, 2007 at 4:07 AM
thanks for your suggestion. i coded as you told and compiled with no erro, but the result is not complete. for example when my treeview_printers has 4 nodes, it means that there are 4 printers were located at my selected printserver. but only the first node displayed "the name" of its printer. the rest nodes display "none".
did you see that problem in your deployment?
Mar 13, 2007 at 8:52 AM
Hello,

I just downloaded changeset 19987 and still have some problems.
1)
There is still a reference to the PrinterQueuewatch.Resources. (in PrinterqueueWatch). Where can I find the dll in the changeset (I found another "old" one and added that one to the references, but it would be nice if this dll can be found within the changeset itself)?

2)
You also added a DELETE server functionality, but forgot that there is a Foreign Key to the printer-info itself. So first all printers must be deleted (If possible as well. There are other foreign keys related to the Printers! So there is some hierarchy in here!) and than the server-info. Maybe it is good to have a stored procedure for that as well?

System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FKPrintersPrint Servers". The conflict occurred in database "PrintMonitor", table "dbo.Printers", column 'Server Name'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
etc...

Coordinator
Mar 14, 2007 at 1:16 AM
I think I may have to remove the foreign key links because the record of existing recorded print jobs would need to be deleted when the server/printer is deleted - does that make sense to do that from the user point of view?
Coordinator
Mar 14, 2007 at 1:17 AM
This discussion has been copied to Work Item 8895. You may wish to continue further discussion there.