Lotus Notes / Domino Sonstiges > Help-Desk Applikation !!Help!!
Help Application demo at Lotusphere
eknori (retired):
Habe gerade eine Antwort von Jon bekommen
--- Zitat ---Ulrich, my apologies on the delayed response. All of the functions you described below were in line with my thoughts. Accessing collections of tickets, viewing tickets, search for ticket, creating and modifying tickets. We are looking for apps to demo against our MDS 41 web services consumer IDE (MDS studio) and would showcase the app at lotusphere. Any chance you can have something by January 10th?
--- Ende Zitat ---
Was sagt das Team ? Ist das machbar ?
flaite:
Frag ihn am besten noch, wie er sich die Authentizifierungs/Autorisierungsfrage vorstellt?
SSL?
Falls meine Hilfe benötigt wird, habe ich zwischen dem 27.12. und dem 4.1. einige freie Tage.
Aus meiner Sicht ist es für den Producer (Server, also !!!Help!!!) einfacher als für den Client (die).
Also auf jeden Fall machbar.
Axel
Thomas Schulte:
Seh ich auch so. Das ist machbar.
Und die Zeit wäre nicht das Problem. Ich hab bis zum 10.01. Urlaub.
eknori (retired):
Hier einmal der Rumpf eines Web Services "wsTicket"
Funktionen:
-- CreateTicket ( strUser As String, strProblem As String ) As Integer
-- CloseTicket ( strTicket As String ) As Integer
-- AssignTicket ( strTicket As String, strAssignTo As String ) As Integer
-- GetAllTicketsBySupporter ( strSupporter As String ) As Variant
Das CreateTicket funktioniert schon einmal soweit 8) ; die anderen Funktionen beinhalten ein einfaches ERRHANDLE, aber noch keinen Funktionscode.
Bei GetAllTicketsBySupporter stehe ich ein wenig auf dem Schlauch; in LS würde ich eine NotesDocumentCollection zurückgeben; das funktioniert aber bei einem web service nicht. ???
Was noch fehlt ist das Abrufen eines bestimmten Tickets, und damit verbunden auch das Suchen nach einem Ticket ...
%REM
#####################################################
INCLUDES
#####################################################
%END REM
%INCLUDE "lsxsd.lss"
%REM
#####################################################
CONSTANTS
#####################################################
%END REM
Private Const CREATE_TICKET_FORM = "BugReport"
Private Const CREATE_TICKET_INITIAL_STATUS = "0"
Private Const CREATE_TICKET_VIA_WEBSERVICE = 1
Private Const CREATE_TICKET_ERR_NOERROR = 0
Private Const CREATE_TICKET_ERR_MISC_ERROR = 1
Private Const CREATE_TICKET_ERR_MANDANTORY = 2
Private Const ASSIGN_TICKET_ERR_NOERROR = 0
Private Const ASSIGN_TICKET_ERR_MISC_ERROR = 1
Private Const ASSIGN_TICKET_ERR_MANDANTORY = 2
Private Const CLOSE_TICKET_ERR_NOERROR = 0
Private Const CLOSE_TICKET_ERR_MISC_ERROR = 1
Private Const CLOSE_TICKET_ERR_MANDANTORY = 2
Private Const GET_TICKET_ERR_NOERROR = 0
Private Const GET_TICKET_ERR_MISC_ERROR = 1
Private Const GET_TICKET_ERR_MANDANTORY = 2
%REM
#####################################################
VARIABLES
#####################################################
%END REM
Private s As NotesSession
Private db As NotesDatabase
Private success As Variant
%REM
#####################################################
WEBSERVICE
#####################################################
%END REM
Class wsTicket
%REM
#####################################################
Public Sub New
#####################################################
%END REM
Public Sub New
' initialize some stuff
Set s = New NotesSession()
Set db = s.currentDatabase
End Sub
%REM
#####################################################
Public Function CreateTicket ( strUser As String, strProblem As String ) As Integer
#####################################################
%END REM
Public Function CreateTicket ( strUser As String, strProblem As String ) As Integer
CreateTicket = CREATE_TICKET_ERR_NOERROR
On Error Goto ERRHANDLE
If Trim(strUser) = "" Or Trim(strProblem) = "" Then
CreateTicket = CREATE_TICKET_ERR_MANDANTORY ' mandantory fields
Exit Function ' nothing else to do, get outa here !
Else
Dim doc As NotesDocument
Dim dateTime As New NotesDateTime( "" )
Call dateTime.SetNow
Set doc = db.CreateDocument
doc.Form = CREATE_TICKET_FORM
doc.User = strUser
doc.Problem = strProblem
doc.Status = CREATE_TICKET_INITIAL_STATUS ' new Ticket, unassigned
doc.Webservice = CREATE_TICKET_VIA_WEBSERVICE
doc.DateCreated = Cstr(dateTime.DateOnly)
doc.TimeCreated = Cstr(dateTime.TimeOnly)
success = doc.ComputeWithForm( False, False )
Call doc.Save (True,True)
End If
EXITPOINT:
Exit Function
ERRHANDLE:
CreateTicket = CREATE_TICKET_ERR_MISC_ERROR
Resume EXITPOINT
End Function
%REM
#####################################################
Public GetAllTicketsBySupporter ( strSupporter As String ) As Variant
#####################################################
%END REM
Public Function GetAllTicketsBySupporter ( strSupporter As String ) As Variant
On Error Goto ERRHANDLE
GetAllTicketsBySupporter = GET_TICKET_ERR_NOERROR
If Trim(strSupporter) = "" Then
GetAllTicketsBySupporter = GET_TICKET_ERR_MANDANTORY ' mandantory fields
Exit Function ' nothing else to do, get outa here !
Else
' Your Code goes here
End If
EXITPOINT:
Exit Function
ERRHANDLE:
GetAllTicketsBySupporter = GET_TICKET_ERR_MISC_ERROR
Resume EXITPOINT
End Function
%REM
#####################################################
Public Function AssignTicket (strTicket As String, strAssignTo As String) As Integer
#####################################################
%END REM
Public Function AssignTicket (strTicket As String, strAssignTo As String) As Integer
On Error Goto ERRHANDLE
AssignTicket = ASSIGN_TICKET_ERR_NOERROR
If Trim(strTicket) = "" Or Trim(strAssignTo) = "" Then
AssignTicket = ASSIGN_TICKET_ERR_MANDANTORY 'mandantory fields
Exit Function ' nothing else to do, get outa here !
Else
' Your Code goes here
End If
EXITPOINT:
Exit Function
ERRHANDLE:
AssignTicket = ASSIGN_TICKET_ERR_MISC_ERROR
Resume EXITPOINT
End Function
%REM
#####################################################
Public Function CloseTicket ( strTicket As String ) As Integer
#####################################################
%END REM
Public Function CloseTicket ( strTicket As String ) As Integer
On Error Goto ERRHANDLE
CloseTicket = CLOSE_TICKET_ERR_NOERROR
If Trim(strTicket) = "" Then
CloseTicket = CLOSE_TICKET_ERR_MANDANTORY 'mandantory fields
Exit Function ' nothing else to do, get outa here !
Else
' Your Code goes here
End If
EXITPOINT:
Exit Function
ERRHANDLE:
CloseTicket = CLOSE_TICKET_ERR_MISC_ERROR
Resume EXITPOINT
End Function
End Class
eknori (retired):
Hier ein Update des bisherigen Codes; nach wie vor kämpfe ich mit der Übergabe eine NotesDocumentCollection als ReturnValue einer Anfrage
%REM
#####################################################
INCLUDES
#####################################################
%END REM
%INCLUDE "lsxsd.lss"
%REM
#####################################################
CONSTANTS
#####################################################
%END REM
Private Const CREATE_TICKET_FORM = "BugReport"
Private Const CREATE_TICKET_INITIAL_STATUS = "0"
Private Const CREATE_TICKET_VIA_WEBSERVICE = 1
Private Const CREATE_TICKET_ERR_NOERROR = 0
Private Const CREATE_TICKET_ERR_MISC_ERROR = 1
Private Const CREATE_TICKET_ERR_MANDANTORY = 2
Private Const ASSIGN_TICKET_ERR_NOERROR = 0
Private Const ASSIGN_TICKET_ERR_MISC_ERROR = 1
Private Const ASSIGN_TICKET_ERR_MANDANTORY = 2
Private Const CLOSE_TICKET_ERR_NOERROR = 0
Private Const CLOSE_TICKET_ERR_MISC_ERROR = 1
Private Const CLOSE_TICKET_ERR_MANDANTORY = 2
Const DEFAULT_RETURN_VALUE ="-"
%REM
#####################################################
VARIABLES
#####################################################
%END REM
Private s As NotesSession
Private db As NotesDatabase
Private doc As NotesDocument
Private success As Variant
Private SearchFormula As String
Private strPersonName As String
Private i As Integer
Private nn As NotesName
Private col As NotesDocumentCollection
Class Ticket
Public User As String
Public TicketNumber As String
Public Problem As String
End Class
Class TicketDetails
Public User As String
Public TicketNumber As String
Public Problem As String
' ... more to declare
End Class
%REM
#####################################################
WEBSERVICE
#####################################################
%END REM
Class wsTicket
%REM
#####################################################
Public Sub New
#####################################################
%END REM
Public Sub New
' initialize some stuff
Set s = New NotesSession()
Set db = s.currentDatabase
End Sub
%REM
#####################################################
Public Function CreateTicket ( strUser As String, strProblem As String ) As Integer
#####################################################
%END REM
Public Function CreateTicket ( strUser As String, strProblem As String ) As Integer
CreateTicket = CREATE_TICKET_ERR_NOERROR
On Error Goto ERRHANDLE
If Trim(strUser) = "" Or Trim(strProblem) = "" Then
CreateTicket = CREATE_TICKET_ERR_MANDANTORY ' mandantory fields
Exit Function ' nothing else to do, get outa here !
Else
Dim doc As NotesDocument
Dim dateTime As New NotesDateTime( "" )
Call dateTime.SetNow
Set doc = db.CreateDocument
doc.Form = CREATE_TICKET_FORM
doc.User = strUser
doc.Problem = strProblem
doc.Status = CREATE_TICKET_INITIAL_STATUS ' new Ticket, unassigned
doc.Webservice = CREATE_TICKET_VIA_WEBSERVICE
doc.DateCreated = Cstr(dateTime.DateOnly)
doc.TimeCreated = Cstr(dateTime.TimeOnly)
success = doc.ComputeWithForm( False, False )
Call doc.Save (True,True)
End If
EXITPOINT:
Exit Function
ERRHANDLE:
CreateTicket = CREATE_TICKET_ERR_MISC_ERROR
Resume EXITPOINT
End Function
%REM
#####################################################
Public Function GetAllTicketsBySupporter ( ) As Variant
#####################################################
%END REM
Public Function GetAllTicketsBySupporter ( strSupporter As String, status As String ) As Ticket
On Error Goto ERRHANDLE
' open, progress, closed, empty string or all
If status = "" Or Ucase(status) = "ALL" Then
status = "ALL"
End If
Select Case Ucase(status)
Case "OPEN"
Case "CLOSED"
Case "PROGRESS"
Case "ALL"
SearchFormula =_
|@UpperCase(Form) ="BUGREPORT" & @Name([CN];supporter)="|_
& CommonNameString (strSupporter ) & |"|
Case Else
End Select
Dim dateTime As New NotesDateTime(_
Cstr(Datenumber(2000, 5, 1)))
' get all tickets for a given supporter
Set col = db.Search( SearchFormula, dateTime,0)
Set GetAllTicketsBySupporter = New Ticket
If Trim(strSupporter) = "" Or Col.Count = 0 Then
' the function must have a return value
GetAllTicketsBySupporter.User = DEFAULT_RETURN_VALUE
GetAllTicketsBySupporter.TicketNumber = DEFAULT_RETURN_VALUE
GetAllTicketsBySupporter.Problem = DEFAULT_RETURN_VALUE
Exit Function ' nothing else to do, get outa here !
Else
' Your Code goes here
Set doc = col.GetFirstDocument
GetAllTicketsBySupporter.User = CommonNameString(getItemValue ("user"))
GetAllTicketsBySupporter.TicketNumber = getItemValue ("ReqNumber")
GetAllTicketsBySupporter.Problem = getItemValue ("problem")
End If
EXITPOINT:
Exit Function
ERRHANDLE:
Resume EXITPOINT
End Function
%REM
#####################################################
Public Function AssignTicket (strTicket As String, strAssignTo As String) As Integer
#####################################################
%END REM
Public Function AssignTicket (strTicket As String, strAssignTo As String) As Integer
On Error Goto ERRHANDLE
AssignTicket = ASSIGN_TICKET_ERR_NOERROR
If Trim(strTicket) = "" Or Trim(strAssignTo) = "" Then
AssignTicket = ASSIGN_TICKET_ERR_MANDANTORY 'mandantory fields
Exit Function ' nothing else to do, get outa here !
Else
' Your Code goes here
End If
EXITPOINT:
Exit Function
ERRHANDLE:
AssignTicket = ASSIGN_TICKET_ERR_MISC_ERROR
Resume EXITPOINT
End Function
%REM
#####################################################
Public Function CloseTicket ( strTicket As String ) As Integer
#####################################################
%END REM
Public Function CloseTicket ( strTicket As String ) As Integer
On Error Goto ERRHANDLE
CloseTicket = CLOSE_TICKET_ERR_NOERROR
If Trim(strTicket) = "" Then
CloseTicket = CLOSE_TICKET_ERR_MANDANTORY 'mandantory fields
Exit Function ' nothing else to do, get outa here !
Else
' Your Code goes here
End If
EXITPOINT:
Exit Function
ERRHANDLE:
CloseTicket = CLOSE_TICKET_ERR_MISC_ERROR
Resume EXITPOINT
End Function
%REM
#####################################################
Private Function CommonNameString (strName As String) As String
#####################################################
%END REM
Private Function CommonNameString (strName As String) As String
Set nn = New NotesName( strName )
strPersonName = nn.Common
CommonNameString = strPersonName
End Function
%REM
#####################################################
Private Function getItemValue ( strItem As String ) As String
#####################################################
%END REM
Private Function getItemValue ( strItem As String ) As String
If doc.HasItem(strItem) Then
getItemValue = doc.GetItemValue( strItem )(0)
Else
getItemValue = DEFAULT_RETURN_VALUE
End If
End Function
End Class
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln