15-12-2022

This commit is contained in:
Jonathan Jenne
2022-12-15 11:53:59 +01:00
parent 8d6d81f488
commit e4c5658c13
31 changed files with 1020 additions and 274 deletions

View File

@@ -20,6 +20,12 @@
<wsdl:message name="IEDMIService_GetJobStatus_OutputMessage">
<wsdl:part name="parameters" element="tns:GetJobStatusResponse" />
</wsdl:message>
<wsdl:message name="IEDMIService_RunJob_InputMessage">
<wsdl:part name="parameters" element="tns:RunJob" />
</wsdl:message>
<wsdl:message name="IEDMIService_RunJob_OutputMessage">
<wsdl:part name="parameters" element="tns:RunJobResponse" />
</wsdl:message>
<wsdl:message name="IEDMIService_UpdateJob_InputMessage">
<wsdl:part name="parameters" element="tns:UpdateJob" />
</wsdl:message>
@@ -47,6 +53,10 @@
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/GetJobStatus" message="tns:IEDMIService_GetJobStatus_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/GetJobStatusResponse" message="tns:IEDMIService_GetJobStatus_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="RunJob">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/RunJob" message="tns:IEDMIService_RunJob_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/RunJobResponse" message="tns:IEDMIService_RunJob_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="UpdateJob">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/UpdateJob" message="tns:IEDMIService_UpdateJob_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/UpdateJobResponse" message="tns:IEDMIService_UpdateJob_OutputMessage" />

View File

@@ -25,31 +25,45 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RunJob">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="pdata" nillable="true" type="q2:RunJob.RunJobRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RunJobResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q3="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="RunJobResult" nillable="true" type="q3:RunJob.RunJobResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UpdateJob">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="pData" nillable="true" type="q2:UpdateJob.UpdateJobRequest" />
<xs:element xmlns:q4="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="pData" nillable="true" type="q4:UpdateJob.UpdateJobRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UpdateJobResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q3="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="UpdateJobResult" nillable="true" type="q3:UpdateJob.UpdateJobResponse" />
<xs:element xmlns:q5="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="UpdateJobResult" nillable="true" type="q5:UpdateJob.UpdateJobResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UpdateProfile">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q4="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="pData" nillable="true" type="q4:UpdateProfile.UpdateProfileRequest" />
<xs:element xmlns:q6="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="pData" nillable="true" type="q6:UpdateProfile.UpdateProfileRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UpdateProfileResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q5="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="UpdateProfileResult" nillable="true" type="q5:UpdateProfile.UpdateProfileResponse" />
<xs:element xmlns:q7="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="UpdateProfileResult" nillable="true" type="q7:UpdateProfile.UpdateProfileResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -61,7 +75,7 @@
<xs:element name="GetJobConfigResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q6="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="GetJobConfigResult" nillable="true" type="q6:GetJobConfig.GetJobConfigResponse" />
<xs:element xmlns:q8="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows" minOccurs="0" name="GetJobConfigResult" nillable="true" type="q8:GetJobConfig.GetJobConfigResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="RunJobRunJobResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>ECM.JobRunner.Common.JobRunnerReference.RunJobRunJobResponse, Connected Services.JobRunnerReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -80,6 +80,20 @@
</xs:sequence>
</xs:complexType>
<xs:element name="StatusItem" nillable="true" type="tns:StatusItem" />
<xs:complexType name="RunJob.RunJobRequest">
<xs:sequence>
<xs:element minOccurs="0" name="JobId" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="RunJob.RunJobRequest" nillable="true" type="tns:RunJob.RunJobRequest" />
<xs:complexType name="RunJob.RunJobResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:Base.BaseResponse">
<xs:sequence />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="RunJob.RunJobResponse" nillable="true" type="tns:RunJob.RunJobResponse" />
<xs:complexType name="UpdateJob.UpdateJobRequest">
<xs:sequence>
<xs:element minOccurs="0" name="Action" type="tns:UpdateJob.UpdateJobRequest.UpdateJobAction" />
@@ -138,32 +152,31 @@
</xs:simpleType>
<xs:element name="UpdateProfile.UpdateProfileRequest.UpdateProfileAction" nillable="true" type="tns:UpdateProfile.UpdateProfileRequest.UpdateProfileAction" />
<xs:complexType name="ImportProfile">
<xs:complexContent mixed="false">
<xs:extension base="tns:BaseProfile">
<xs:sequence>
<xs:element minOccurs="0" name="Active" type="xs:boolean" />
<xs:element minOccurs="0" name="BackupFolder" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="DeleteFiles" type="xs:boolean" />
<xs:element minOccurs="0" name="FileExcludeRegex" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Id" type="xs:int" />
<xs:element minOccurs="0" name="IncludeSubfolders" type="xs:boolean" />
<xs:element minOccurs="0" name="JobId" type="xs:int" />
<xs:element minOccurs="0" name="ObjectTypeName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="SourceFolder" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Steps" nillable="true" type="tns:ArrayOfImportProfileStep" />
<xs:element minOccurs="0" name="SubfolderDateFormat" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="TargetFolder" nillable="true" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="ImportProfile" nillable="true" type="tns:ImportProfile" />
<xs:complexType name="BaseProfile">
<xs:sequence>
<xs:element minOccurs="0" name="Active" type="xs:boolean" />
<xs:element minOccurs="0" name="BackupFolder" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="DeleteFiles" type="xs:boolean" />
<xs:element minOccurs="0" name="FileExcludeRegex" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Id" type="xs:int" />
<xs:element minOccurs="0" name="IncludeSubfolders" type="xs:boolean" />
<xs:element minOccurs="0" name="Job" nillable="true" type="tns:JobDefinition" />
<xs:element minOccurs="0" name="JobId" type="xs:int" />
<xs:element minOccurs="0" name="ObjectType" nillable="true" type="tns:ObjectType" />
<xs:element minOccurs="0" name="ObjectTypeName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="SourceFolder" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Steps" nillable="true" type="tns:ArrayOfImportProfileStep" />
<xs:element minOccurs="0" name="SubfolderDateFormat" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="TargetFolder" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="BaseProfile" nillable="true" type="tns:BaseProfile" />
<xs:element name="ImportProfile" nillable="true" type="tns:ImportProfile" />
<xs:complexType name="ObjectType">
<xs:sequence>
<xs:element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="Indexes" nillable="true" type="q1:ArrayOfstring" />
<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="ObjectType" nillable="true" type="tns:ObjectType" />
<xs:complexType name="ArrayOfImportProfileStep">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="ImportProfileStep" nillable="true" type="tns:ImportProfileStep" />
@@ -178,29 +191,12 @@
<xs:element minOccurs="0" name="Argument3" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Id" type="xs:int" />
<xs:element minOccurs="0" name="IndexName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Method" type="tns:ImportProfileStep.StepMethod" />
<xs:element minOccurs="0" name="Method" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="ProfileId" type="xs:int" />
<xs:element minOccurs="0" name="Scope" type="tns:ImportProfileStep.StepScope" />
<xs:element minOccurs="0" name="Scope" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="ImportProfileStep" nillable="true" type="tns:ImportProfileStep" />
<xs:simpleType name="ImportProfileStep.StepMethod">
<xs:restriction base="xs:string">
<xs:enumeration value="SUBSTRING" />
<xs:enumeration value="REGEX" />
<xs:enumeration value="SPLIT" />
<xs:enumeration value="ALL" />
<xs:enumeration value="VALUE" />
</xs:restriction>
</xs:simpleType>
<xs:element name="ImportProfileStep.StepMethod" nillable="true" type="tns:ImportProfileStep.StepMethod" />
<xs:simpleType name="ImportProfileStep.StepScope">
<xs:restriction base="xs:string">
<xs:enumeration value="FILE" />
<xs:enumeration value="FOLDER" />
</xs:restriction>
</xs:simpleType>
<xs:element name="ImportProfileStep.StepScope" nillable="true" type="tns:ImportProfileStep.StepScope" />
<xs:complexType name="UpdateProfile.UpdateProfileResponse">
<xs:complexContent mixed="false">
<xs:extension base="tns:Base.BaseResponse">
@@ -252,11 +248,4 @@
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfObjectType" nillable="true" type="tns:ArrayOfObjectType" />
<xs:complexType name="ObjectType">
<xs:sequence>
<xs:element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="Indexes" nillable="true" type="q1:ArrayOfstring" />
<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="ObjectType" nillable="true" type="tns:ObjectType" />
</xs:schema>

View File

@@ -20,6 +20,7 @@ Namespace JobRunnerReference
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="Base.BaseResponse", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows"), _
System.SerializableAttribute(), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(JobRunnerReference.RunJobRunJobResponse)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(JobRunnerReference.UpdateJobUpdateJobResponse)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(JobRunnerReference.UpdateProfileUpdateProfileResponse)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(JobRunnerReference.GetJobConfigGetJobConfigResponse)), _
@@ -99,6 +100,14 @@ Namespace JobRunnerReference
End Sub
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="RunJob.RunJobResponse", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows"), _
System.SerializableAttribute()> _
Partial Public Class RunJobRunJobResponse
Inherits JobRunnerReference.BaseBaseResponse
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="UpdateJob.UpdateJobResponse", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows"), _
@@ -928,7 +937,11 @@ Namespace JobRunnerReference
System.Runtime.Serialization.DataContractAttribute(Name:="ImportProfile", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows"), _
System.SerializableAttribute()> _
Partial Public Class ImportProfile
Inherits JobRunnerReference.BaseProfile
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ActiveField As Boolean
@@ -948,9 +961,15 @@ Namespace JobRunnerReference
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private IncludeSubfoldersField As Boolean
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private JobField As JobRunnerReference.JobDefinition
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private JobIdField As Integer
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ObjectTypeField As JobRunnerReference.ObjectType
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ObjectTypeNameField As String
@@ -966,6 +985,16 @@ Namespace JobRunnerReference
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private TargetFolderField As String
<Global.System.ComponentModel.BrowsableAttribute(false)> _
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
Get
Return Me.extensionDataField
End Get
Set
Me.extensionDataField = value
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Active() As Boolean
Get
@@ -1044,6 +1073,19 @@ Namespace JobRunnerReference
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Job() As JobRunnerReference.JobDefinition
Get
Return Me.JobField
End Get
Set
If (Object.ReferenceEquals(Me.JobField, value) <> true) Then
Me.JobField = value
Me.RaisePropertyChanged("Job")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property JobId() As Integer
Get
@@ -1057,6 +1099,19 @@ Namespace JobRunnerReference
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property ObjectType() As JobRunnerReference.ObjectType
Get
Return Me.ObjectTypeField
End Get
Set
If (Object.ReferenceEquals(Me.ObjectTypeField, value) <> true) Then
Me.ObjectTypeField = value
Me.RaisePropertyChanged("ObjectType")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property ObjectTypeName() As String
Get
@@ -1121,45 +1176,6 @@ Namespace JobRunnerReference
End If
End Set
End Property
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="BaseProfile", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows"), _
System.SerializableAttribute(), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(JobRunnerReference.ImportProfile))> _
Partial Public Class BaseProfile
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private JobField As JobRunnerReference.JobDefinition
<Global.System.ComponentModel.BrowsableAttribute(false)> _
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
Get
Return Me.extensionDataField
End Get
Set
Me.extensionDataField = value
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Job() As JobRunnerReference.JobDefinition
Get
Return Me.JobField
End Get
Set
If (Object.ReferenceEquals(Me.JobField, value) <> true) Then
Me.JobField = value
Me.RaisePropertyChanged("Job")
End If
End Set
End Property
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
@@ -1201,13 +1217,13 @@ Namespace JobRunnerReference
Private IndexNameField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private MethodField As JobRunnerReference.ImportProfileStep.StepMethod
Private MethodField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ProfileIdField As Integer
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ScopeField As JobRunnerReference.ImportProfileStep.StepScope
Private ScopeField As String
<Global.System.ComponentModel.BrowsableAttribute(false)> _
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
@@ -1298,12 +1314,12 @@ Namespace JobRunnerReference
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Method() As JobRunnerReference.ImportProfileStep.StepMethod
Public Property Method() As String
Get
Return Me.MethodField
End Get
Set
If (Me.MethodField.Equals(value) <> true) Then
If (Object.ReferenceEquals(Me.MethodField, value) <> true) Then
Me.MethodField = value
Me.RaisePropertyChanged("Method")
End If
@@ -1324,12 +1340,12 @@ Namespace JobRunnerReference
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Scope() As JobRunnerReference.ImportProfileStep.StepScope
Public Property Scope() As String
Get
Return Me.ScopeField
End Get
Set
If (Me.ScopeField.Equals(value) <> true) Then
If (Object.ReferenceEquals(Me.ScopeField, value) <> true) Then
Me.ScopeField = value
Me.RaisePropertyChanged("Scope")
End If
@@ -1344,37 +1360,53 @@ Namespace JobRunnerReference
propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
End If
End Sub
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="RunJob.RunJobRequest", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows"), _
System.SerializableAttribute()> _
Partial Public Class RunJobRunJobRequest
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="ImportProfileStep.StepMethod", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows")> _
Public Enum StepMethod As Integer
<System.Runtime.Serialization.EnumMemberAttribute()> _
SUBSTRING = 0
<System.Runtime.Serialization.EnumMemberAttribute()> _
REGEX = 1
<System.Runtime.Serialization.EnumMemberAttribute()> _
SPLIT = 2
<System.Runtime.Serialization.EnumMemberAttribute()> _
ALL = 3
<System.Runtime.Serialization.EnumMemberAttribute()> _
VALUE = 4
End Enum
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="ImportProfileStep.StepScope", [Namespace]:="http://schemas.datacontract.org/2004/07/ECM.JobRunner.Windows")> _
Public Enum StepScope As Integer
<System.Runtime.Serialization.EnumMemberAttribute()> _
FILE = 0
<System.Runtime.Serialization.EnumMemberAttribute()> _
FOLDER = 1
End Enum
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private JobIdField As Integer
<Global.System.ComponentModel.BrowsableAttribute(false)> _
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
Get
Return Me.extensionDataField
End Get
Set
Me.extensionDataField = value
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property JobId() As Integer
Get
Return Me.JobIdField
End Get
Set
If (Me.JobIdField.Equals(value) <> true) Then
Me.JobIdField = value
Me.RaisePropertyChanged("JobId")
End If
End Set
End Property
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
If (Not (propertyChanged) Is Nothing) Then
propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
End If
End Sub
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
@@ -1547,6 +1579,12 @@ Namespace JobRunnerReference
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/GetJobStatus", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/GetJobStatusResponse")> _
Function GetJobStatusAsync() As System.Threading.Tasks.Task(Of JobRunnerReference.GetJobStatusGetJobStatusResponse)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/RunJob", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/RunJobResponse")> _
Function RunJob(ByVal pdata As JobRunnerReference.RunJobRunJobRequest) As JobRunnerReference.RunJobRunJobResponse
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/RunJob", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/RunJobResponse")> _
Function RunJobAsync(ByVal pdata As JobRunnerReference.RunJobRunJobRequest) As System.Threading.Tasks.Task(Of JobRunnerReference.RunJobRunJobResponse)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/UpdateJob", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/UpdateJobResponse")> _
Function UpdateJob(ByVal pData As JobRunnerReference.UpdateJobUpdateJobRequest) As JobRunnerReference.UpdateJobUpdateJobResponse
@@ -1613,6 +1651,14 @@ Namespace JobRunnerReference
Return MyBase.Channel.GetJobStatusAsync
End Function
Public Function RunJob(ByVal pdata As JobRunnerReference.RunJobRunJobRequest) As JobRunnerReference.RunJobRunJobResponse Implements JobRunnerReference.IEDMIService.RunJob
Return MyBase.Channel.RunJob(pdata)
End Function
Public Function RunJobAsync(ByVal pdata As JobRunnerReference.RunJobRunJobRequest) As System.Threading.Tasks.Task(Of JobRunnerReference.RunJobRunJobResponse) Implements JobRunnerReference.IEDMIService.RunJobAsync
Return MyBase.Channel.RunJobAsync(pdata)
End Function
Public Function UpdateJob(ByVal pData As JobRunnerReference.UpdateJobUpdateJobRequest) As JobRunnerReference.UpdateJobUpdateJobResponse Implements JobRunnerReference.IEDMIService.UpdateJob
Return MyBase.Channel.UpdateJob(pData)
End Function

View File

@@ -59,6 +59,15 @@
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RunJob">
<soap12:operation soapAction="http://DigitalData.Services.EDMIService/IEDMIService/RunJob" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="UpdateJob">
<soap12:operation soapAction="http://DigitalData.Services.EDMIService/IEDMIService/UpdateJob" style="document" />
<wsdl:input>

View File

@@ -0,0 +1,10 @@
Public Class Constants
Public Const SCOPE_FILE = "FILE"
Public Const SCOPE_FOLDER = "FOLDER"
Public Const METHOD_SUBSTRING = "SUBSTRING"
Public Const METHOD_REGEX = "REGEX"
Public Const METHOD_SPLIT = "SPLIT"
Public Const METHOD_VALUE = "VALUE"
Public Const METHOD_ALL = "ALL"
End Class

View File

@@ -71,6 +71,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="Constants.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
@@ -110,6 +111,9 @@
<None Include="Connected Services\JobRunnerReference\ECM.JobRunner.Common.JobRunnerReference.GetJobStatusGetJobStatusResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\JobRunnerReference\ECM.JobRunner.Common.JobRunnerReference.RunJobRunJobResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\JobRunnerReference\ECM.JobRunner.Common.JobRunnerReference.UpdateJobUpdateJobResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>

View File

@@ -1,6 +1,7 @@
@page "/profiles/import/{profileId:int}/edit"
@using ECM.JobRunner.Common.JobRunnerReference;
@using ECM.JobRunner.Web.Data;
@using ECM.JobRunner.Web.Pages.ImportStep;
@inject NavigationManager Navigation;
@inject ImportService Profile;
@@ -14,6 +15,9 @@
[Parameter]
public int ProfileId { get; set; }
[Parameter]
public int StepId { get; set; }
private async void OnFormSubmit(EditContext ctx)
{
ImportProfile profile = (ImportProfile)ctx.Model;

View File

@@ -8,10 +8,10 @@
<h3>Job erstellen</h3>
<ProfileForm JobId="JobId" OnValidSubmit="OnFormSubmit" />
<ProfileForm ProfileId="ProfileId" OnValidSubmit="OnFormSubmit" />
@code {
public int JobId = -1;
public int ProfileId = -1;
private async void OnFormSubmit(EditContext ctx)
{

View File

@@ -125,8 +125,6 @@ else
<div id="cronHelp" class="form-text">Die Zeitplan des Jobs. Erwartet eine <a href="https://www.quartz-scheduler.net/documentation/quartz-3.x/how-tos/crontrigger.html#examples" target="_blank">Quartz.NET Cron Expression.</a></div>
</div>
<div class="mb-3">
<label for="backupFolder" class="form-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-life-preserver" viewBox="0 0 16 16">
@@ -203,7 +201,7 @@ else
if (ProfileId == Constants.ENTITY_ID_NEW)
{
profile = new ImportProfile() { Id = Constants.ENTITY_ID_NEW };
profile = new ImportProfile() { Id = Constants.ENTITY_ID_NEW, Job = new() };
}
else
{

View File

@@ -72,27 +72,33 @@ else
</li>
</ul>
<h3>Verarbeitungsschritte</h3>
<h3>Profilschritte</h3>
<ECM.JobRunner.Web.Pages.ImportStep.List Profile="profile" />
<ECM.JobRunner.Web.Pages.ImportStep.ListSteps Profile="profile" />
<div class="btn-group mt-3" role="group" aria-label="Basic example">
<a class="btn btn-secondary" href="profiles/import">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
</svg> Back
</a>
<a class="btn btn-primary" href="profiles/import/@profile.Id/edit">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z" />
</svg> Edit
</a>
<a class="btn btn-danger" @onclick="DeleteJob">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash3" viewBox="0 0 16 16">
<path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z" />
</svg> Delete
</a>
<div class="btn-toolbar mt-3" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group me-2" role="group" aria-label="First group">
<a class="btn btn-secondary" href="profiles/import">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
</svg> Back
</a>
<a class="btn btn-primary" href="profiles/import/@profile.Id/edit">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z" />
</svg> Edit
</a>
<a class="btn btn-danger" @onclick="DeleteJob">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash3" viewBox="0 0 16 16">
<path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z" />
</svg> Delete
</a>
</div>
<div class="flex-column flex-fill"></div>
<div class="btn-group" role="group">
<a class="btn btn-secondary" href="profiles/import/@profile.Id/steps">Profilschritte bearbeiten</a>
</div>
</div>
}

View File

@@ -0,0 +1,38 @@
@page "/profiles/import/{profileId:int}/steps/{stepId:int}/edit"
@using ECM.JobRunner.Common.JobRunnerReference;
@using ECM.JobRunner.Web.Data;
@inject NavigationManager Navigation;
@inject ImportService Profile;
<PageTitle>Schritt bearbeiten</PageTitle>
<h3>Schritt bearbeiten</h3>
<StepForm ProfileId="ProfileId" StepId="StepId" OnValidSubmit="OnFormSubmit" />
@code {
[Parameter]
public int ProfileId { get; set; }
[Parameter]
public int StepId { get; set; }
public ImportProfile? profile;
private async void OnFormSubmit(EditContext ctx)
{
ImportProfile profile = await Profile.GetProfile(ProfileId);
ImportProfileStep step = (ImportProfileStep)ctx.Model;
// TODO: This is ugly and manual and needs to be abstracted.
var index = profile.Steps.ToList().FindIndex(s => s.Id == StepId);
profile.Steps[index] = step;
bool result = await Profile.UpdateProfile(profile);
if (result == true)
{
Navigation.NavigateTo($"/profiles/import/{profile.Id}");
}
}
}

View File

@@ -24,7 +24,7 @@ else
@foreach (var step in Profile.Steps)
{
<a href="#" class="list-group-item list-group-item-action d-flex justify-content-between align-items-start">
<a href="profiles/import/@Profile.Id/steps/@step.Id" class="list-group-item list-group-item-action d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">
<span>

View File

@@ -0,0 +1,178 @@
@page "/profiles/import/{profileId:int}/steps/{stepId:int}"
@using ECM.JobRunner.Common.JobRunnerReference;
@using ECM.JobRunner.Web.Data;
@inject NavigationManager Navigation;
@inject IJSRuntime JsRuntime;
@inject JobService Jobs;
@inject ImportService Import;
<PageTitle>Profilschritt</PageTitle>
@if (profile == null)
{
<h3>Job</h3>
<ul class="list-group">
<li class="list-group-item">Loading Job..</li>
</ul>
}
else
{
@if (step != null)
{
<h3>
@if (profile.Active)
{
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-bar-chart-steps text-success" viewBox="0 0 16 16">
<path d="M.5 0a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-1 0V.5A.5.5 0 0 1 .5 0zM2 1.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-6a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1z" />
</svg>
}
else
{
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-bar-chart-steps text-danger" viewBox="0 0 16 16">
<path d="M.5 0a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-1 0V.5A.5.5 0 0 1 .5 0zM2 1.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-6a.5.5 0 0 1-.5-.5v-1zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-1z" />
</svg>
}
Schritt
</h3>
<ul class="list-group mb-3">
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-braces" viewBox="0 0 16 16">
<path d="M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6zM13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6z" />
</svg> Index
</div>
@step.IndexName
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-gear" viewBox="0 0 16 16">
<path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z" />
<path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z" />
</svg> Methode
</div>
@step.Method
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg> Scope
</div>
@step.Scope
</div>
</li>
</ul>
<ul class="list-group mb-3">
@if (!String.IsNullOrEmpty(step.Argument1))
{
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg> Argument1
</div>
@step.Argument1
</div>
</li>
}
@if (!String.IsNullOrEmpty(step.Argument2))
{
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg> Argument2
</div>
@step.Argument2
</div>
</li>
}
@if (!String.IsNullOrEmpty(step.Argument3))
{
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="ms-2 me-auto">
<div class="fw-bold">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg> Argument3
</div>
@step.Argument3
</div>
</li>
}
</ul>
<div class="btn-group mt-3" role="group" aria-label="Basic example">
<a class="btn btn-secondary" href="profiles/import/@profile.Id">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
</svg> Back
</a>
<a class="btn btn-primary" href="profiles/import/@profile.Id/steps/@step.Id/edit">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z" />
</svg> Edit
</a>
<a class="btn btn-danger" @onclick="DeleteJob">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash3" viewBox="0 0 16 16">
<path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z" />
</svg> Delete
</a>
</div>
}
}
@code {
[Parameter]
public int ProfileId { get; set; }
[Parameter]
public int StepId { get; set; }
private ImportProfile? profile;
private ImportProfileStep? step;
private DateTime nextExecution;
protected async override void OnInitialized()
{
profile = await Import.GetProfile(ProfileId);
if (profile != null)
{
step = profile.Steps.Where(s => s.Id == StepId).SingleOrDefault();
StateHasChanged();
}
}
protected async void DeleteJob()
{
if (profile != null)
{
bool confirmed = await JsRuntime.InvokeAsync<bool>("confirm", "Are you sure?");
if (confirmed)
{
var steps = profile.Steps.Where(s => s.Id != StepId).ToArray();
profile.Steps = steps;
if (await Import.UpdateProfile(profile) == true)
{
Navigation.NavigateTo($"/profiles/import/{ProfileId}");
};
}
}
}
}

View File

@@ -0,0 +1,225 @@
@using ECM.JobRunner.Common.JobRunnerReference;
@using ECM.JobRunner.Web.Data;
@inject ImportService Import;
@inject JobService Jobs;
@if (step == null || profile == null)
{
<p>Form loading..</p>
}
else
{
<EditForm Model="step" OnValidSubmit="OnValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<div class="row row-cols-1 row-cols-lg-2">
<div class="col">
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="enabled" @bind="step.Active">
<label class="form-check-label" for="enabled">Aktiv</label>
</div>
</div>
</div>
<div class="row row-cols-1 row-cols-lg-2">
<div class="mb-3">
<label for="stepIndex" class="form-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-seam" viewBox="0 0 16 16">
<path d="M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2l-2.218-.887zm3.564 1.426L5.596 5 8 5.961 14.154 3.5l-2.404-.961zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464L7.443.184z" />
</svg> Index
</label>
<select class="form-select" aria-label="Job type selection" id="stepIndex" @bind="step.IndexName">
<option selected>Auswählen..</option>
@if (profile.ObjectType.Indexes != null)
{
@foreach (string index in profile.ObjectType.Indexes)
{
<option value="@index">@index</option>
}
}
</select>
<div id="stepIndexHelp" class="form-text">Der Windream Index, in den das Ergebnis des Schritte geschrieben wird</div>
</div>
<div class="mb-3">
<label for="stepScope" class="form-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-braces" viewBox="0 0 16 16">
<path d="M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6zM13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6z" />
</svg> Basis
</label>
<select class="form-select" aria-label="Job type selection" id="stepScope" @bind="step.Scope">
<option selected value="">Basis auswählen..</option>
<option value="FILE">Dateiname</option>
<option value="FOLDER">Ordnerpfad</option>
</select>
<div id="stepScopeHelp" class="form-text">Basiswert, auf den die Funktion angewendet wird.</div>
</div>
<div class="mb-3">
<label for="stepMethod" class="form-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16">
<path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z" />
</svg> Funktion
</label>
<select class="form-select" aria-label="Job type selection" id="stepMethod" value="@step.Method" @onchange="OnMethodChange">
<option selected value="">Methode auswählen..</option>
<option value="SUBSTRING">Substring</option>
<option value="REGEX">Regular Expression</option>
<option value="VALUE">Statischer Wert</option>
<option value="ALL">Unverändert lassen</option>
</select>
<div id="stepMethodHelp" class="form-text">Funktion, die auf den Wert angewendet wird.</div>
</div>
@if (arg1 != null)
{
<div class="mb-3">
<label for="Argument1" class="form-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-1-circle" viewBox="0 0 16 16">
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM9.283 4.002V12H7.971V5.338h-.065L6.072 6.656V5.385l1.899-1.383h1.312Z" />
</svg> @arg1.name
</label>
<input type="text" class="form-control" id="Argument1" aria-describedby="Argument1Help" @bind="step.Argument1" />
<div id="Argument1Help" class="form-text">@arg1.helpText</div>
</div>
}
@if (arg2 != null)
{
<div class="mb-3">
<label for="Argument2" class="form-label">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-2-circle" viewBox="0 0 16 16">
<path d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM6.646 6.24v.07H5.375v-.064c0-1.213.879-2.402 2.637-2.402 1.582 0 2.613.949 2.613 2.215 0 1.002-.6 1.667-1.287 2.43l-.096.107-1.974 2.22v.077h3.498V12H5.422v-.832l2.97-3.293c.434-.475.903-1.008.903-1.705 0-.744-.557-1.236-1.313-1.236-.843 0-1.336.615-1.336 1.306Z" />
</svg> @arg2.name
</label>
<input type="text" class="form-control" id="Argument2" aria-describedby="Argument2Help" @bind="step.Argument2" />
<div id="Argument2Help" class="form-text">@arg2.helpText</div>
</div>
}
@if (arg3 != null)
{
<div class="mb-3">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-3-circle" viewBox="0 0 16 16">
<path d="M7.918 8.414h-.879V7.342h.838c.78 0 1.348-.522 1.342-1.237 0-.709-.563-1.195-1.348-1.195-.79 0-1.312.498-1.348 1.055H5.275c.036-1.137.95-2.115 2.625-2.121 1.594-.012 2.608.885 2.637 2.062.023 1.137-.885 1.776-1.482 1.875v.07c.703.07 1.71.64 1.734 1.917.024 1.459-1.277 2.396-2.93 2.396-1.705 0-2.707-.967-2.754-2.144H6.33c.059.597.68 1.06 1.541 1.066.973.006 1.6-.563 1.588-1.354-.006-.779-.621-1.318-1.541-1.318Z" />
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0ZM1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8Z" />
</svg> @arg3.name
<input type="text" class="form-control" id="Argument3" aria-describedby="Argument3Help" @bind="step.Argument3" />
<div id="Argument3Help" class="form-text">@arg3.helpText</div>
</div>
}
</div>
<div class="btn-group mt-3" role="group" aria-label="Basic example">
<a class="btn btn-secondary" href="@GetBackUrl()">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
</svg> Back
</a>
<button type="submit" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-save" viewBox="0 0 16 16">
<path d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9.5a1 1 0 0 0-1 1v7.293l2.646-2.647a.5.5 0 0 1 .708.708l-3.5 3.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L7.5 9.293V2a2 2 0 0 1 2-2H14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h2.5a.5.5 0 0 1 0 1H2z" />
</svg> Save
</button>
</div>
</EditForm>
}
@code {
[Parameter]
public int ProfileId { get; set; }
[Parameter]
public int StepId { get; set; }
[Parameter]
public EventCallback<EditContext> OnValidSubmit { get; set; }
private ImportProfileStep? step;
private ImportProfile? profile;
private StepArgument? arg1 = null;
private StepArgument? arg2 = null;
private StepArgument? arg3 = null;
protected string GetBackUrl()
{
return $"/profiles/import/{ProfileId}/steps/{StepId}";
}
protected override async Task OnInitializedAsync()
{
profile = await Import.GetProfile(ProfileId);
if (profile == null)
return;
if (StepId == Constants.ENTITY_ID_NEW)
{
step = new ImportProfileStep() { Id = Constants.ENTITY_ID_NEW };
}
else
{
step = profile.Steps.Where(s => s.Id == StepId).SingleOrDefault();
SetMethodArgs(step.Method);
}
StateHasChanged();
}
protected void OnMethodChange(ChangeEventArgs e)
{
if (step == null || e.Value == null)
return;
step.Method = e.Value.ToString();
if (step.Method != null)
{
SetMethodArgs(step.Method);
}
}
protected void SetMethodArgs(string method)
{
switch (method)
{
case "SUBSTRING":
arg1 = new StepArgument() { name = "Index", helpText = "Index" };
arg2 = new StepArgument() { name = "Length", helpText = "Length" };
arg3 = null;
break;
case "REGEX":
arg1 = new StepArgument() { name = "Regex", helpText = "Regex" };
arg2 = new StepArgument() { name = "Match Value", helpText = "Match Value" };
arg3 = new StepArgument() { name = "Not Match Value", helpText = "Not Match Value" };
break;
case "VALUE":
arg1 = new StepArgument() { name = "Value", helpText = "Value" };
arg2 = null;
arg3 = null;
break;
default:
arg1 = null;
arg2 = null;
arg3 = null;
break;
}
}
class StepArgument
{
public string name;
public string helpText;
}
}

View File

@@ -1,6 +1,6 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">ECM.JobRunner.Web</a>
<a class="navbar-brand" href="">ECM Job Runner</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>

View File

@@ -1,6 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Warning"
propagateActivity="true" >
<listeners>
<add name="xml"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="E:\LogFiles\ECMJobRunner.svclog" />
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<diagnostics wmiProviderEnabled="true">
<messageLogging
logEntireMessage="true"
logMalformedMessages="false"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="false"
maxMessagesToLog="3000"
maxSizeOfMessageToLog="2000"/>
</diagnostics>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
</configuration>

View File

@@ -126,7 +126,6 @@
<Compile Include="Models\Jobs\JobType.vb" />
<Compile Include="Models\Jobs\HistoryItem.vb" />
<Compile Include="Models\Jobs\StatusItem.vb" />
<Compile Include="Models\Profiles\BaseProfile.vb" />
<Compile Include="Models\Profiles\ImportFile.vb" />
<Compile Include="Models\Profiles\ImportProfile.vb" />
<Compile Include="Models\Profiles\ImportProfileStep.vb" />

View File

@@ -1,3 +0,0 @@
Public Class BaseProfile
Public Property Job As New JobDefinition
End Class

View File

@@ -1,36 +1,18 @@
Imports System.ComponentModel.DataAnnotations
Public Class ImportProfile
Inherits BaseProfile
Public Property Job As New JobDefinition
Public Property Active As Boolean
<Required>
Public Property Id As Integer
<Required>
Public Property JobId As Integer
<Required>
Public Property ObjectTypeName As String
<Required>
<StringLength(500)>
Public Property ObjectType As ObjectType
Public Property SourceFolder As String
<Required>
<StringLength(500)>
Public Property TargetFolder As String
<StringLength(500)>
Public Property BackupFolder As String
<StringLength(50)>
Public Property SubfolderDateFormat As String
<StringLength(5000)>
Public Property FileExcludeRegex As String
Public Property DeleteFiles As Boolean
Public Property IncludeSubfolders As Boolean
Public Property Steps As New List(Of ImportProfileStep)
End Class

View File

@@ -1,26 +1,17 @@
Public Class ImportProfileStep
Imports System.Runtime.Serialization
Public Class ImportProfileStep
Public Property Active As Boolean
Public Property Id As Integer
Public Property ProfileId As Integer
Public Property IndexName As String
Public Property Scope As StepScope
Public Property Method As StepMethod
Public Property Scope As String
Public Property Method As String
Public Property Argument1 As String
Public Property Argument2 As String
Public Property Argument3 As String
Public Enum StepMethod
SUBSTRING
REGEX
SPLIT
ALL
VALUE
End Enum
Public Enum StepScope
FILE
FOLDER
End Enum
End Class

View File

@@ -120,6 +120,14 @@ Namespace Scheduler.Jobs
LogStep(HistoryItem.StepLevel.Debug, "{0} Files filtered out for matching exclusion Regex.", oRegexFilteredCount)
oFilteredFiles = oDateFilteredFiles
'-------------------------------------------------------------------------------------------------
' After this point, files are treated as processed and are being deleted before finishing the job
'-------------------------------------------------------------------------------------------------
If oFilteredFiles.Count = 0 Then
Return CompleteJob($"No files to process.")
End If
Logger.Info("Importing files..")
Dim oImportedFiles As New List(Of ImportFile)
For Each oFile In oFilteredFiles
@@ -150,6 +158,19 @@ Namespace Scheduler.Jobs
Logger.Info("[{0}] files successfully Indexed!", oIndexedFiles.Count)
LogStep(HistoryItem.StepLevel.Info, "{0} files successfully Indexed!", oIndexedFiles.Count)
If oProfile.DeleteFiles = True Then
Logger.Debug("Deleting [{0}] files before finishing job.", oFiles.Count)
For Each oFile In oFilteredFiles
Try
IO.File.Delete(oFile.FilePathOriginal)
Catch ex As Exception
Logger.Warn("Could not clean up processed files before finishing Job!")
Logger.Error(ex)
End Try
Next
End If
Return CompleteJob($"{oImportedFiles.Count} files successfully Processed!")
Catch ex As Exception
Logger.Error(ex)
@@ -161,7 +182,14 @@ Namespace Scheduler.Jobs
End Function
Private Function FileIsOlderThan(pFile As ImportFile, pMinutes As Integer)
Return pFile.FileInfo.CreationTime.AddMinutes(pMinutes) < Now
Dim oCreationTime = pFile.FileInfo.CreationTime
Dim oTimeSpan = New TimeSpan(0, pMinutes, 0)
If (Now - oCreationTime) > oTimeSpan Then
Return True
Else
Return False
End If
End Function
Private Function FileMatchesRegex(pFile As ImportFile, pRegexList As List(Of Regex))
@@ -228,31 +256,52 @@ Namespace Scheduler.Jobs
' Get the base value by checking scope
Select Case oStep.Scope
Case ImportProfileStep.StepScope.FILE
Case Common.Constants.SCOPE_FILE
oValue = pFile.FileInfo.Name
Case ImportProfileStep.StepScope.FOLDER
Case Common.Constants.SCOPE_FOLDER
oValue = pFile.FileInfo.DirectoryName
Case Else
oValue = pFile.FilePath
End Select
Logger.Info("Running Method [{0}] on Index [{1}]", oStep.Method, oStep.IndexName)
Logger.Debug("Value is [{0}]", oValue)
Logger.Debug("Scope is [{0}]", oStep.Scope)
' TODO: Error handling!
Select Case oStep.Method
Case ImportProfileStep.StepMethod.SUBSTRING
Case Common.Constants.METHOD_SUBSTRING
Try
Dim oIndex1 = Integer.Parse(oStep.Argument1)
Dim oLength = Integer.Parse(oStep.Argument2)
oValue = oValue.Substring(oIndex1, oLength)
Logger.Debug("Parsing Value [{0}] for Parameter 'StartIndex'", oStep.Argument1)
Dim oStartIndex = 0
If Integer.TryParse(oStep.Argument1, oStartIndex) = False Then
Throw New ArgumentException("StartIndex")
End If
Logger.Debug("Parsing Value [{0}] for Parameter 'Length'", oStep.Argument2)
Dim oLength = 0
If Integer.TryParse(oStep.Argument2, oLength) = False Then
Throw New ArgumentException("Length")
End If
oValue = oValue.Substring(oStartIndex, oLength)
Catch ex As Exception
LogStep(HistoryItem.StepLevel.Error, "Method SUBSTRING could not be applied to Index '{0}'. Error: '{1}'", oStep.IndexName, ex.Message)
Dim oMessage = "Method SUBSTRING could not be applied to Index '{0}' and Parameters StartIndex [{1}], Length [{2}]. Error: '{3}'"
LogStep(HistoryItem.StepLevel.Error, oMessage, oStep.IndexName, ex.Message, oStep.Argument1, oStep.Argument2)
Logger.Error(ex)
End Try
Case ImportProfileStep.StepMethod.SPLIT
Case Common.Constants.METHOD_SPLIT
Try
If String.IsNullOrEmpty(oStep.Argument1) Then
Throw New ArgumentException("Separator")
End If
Dim oSeparator = oStep.Argument1.Substring(0, 1)
Dim oIndex = Integer.Parse(oStep.Argument2)
Dim oIndex = 0
If Integer.TryParse(oStep.Argument2, oIndex) = False Then
Throw New ArgumentException("Index")
End If
Dim oSplit = oValue.Split(oSeparator)
oValue = oSplit(oIndex)
Catch ex As Exception
@@ -260,7 +309,7 @@ Namespace Scheduler.Jobs
Logger.Error(ex)
End Try
Case ImportProfileStep.StepMethod.REGEX
Case Common.Constants.METHOD_REGEX
Try
Dim oRegex = New Regex(oStep.Argument1)
Dim oTrueValue = oStep.Argument2
@@ -275,10 +324,10 @@ Namespace Scheduler.Jobs
Logger.Error(ex)
End Try
Case ImportProfileStep.StepMethod.VALUE
Case Common.Constants.METHOD_VALUE
oValue = oStep.Argument1
Case ImportProfileStep.StepMethod.ALL
Case Common.Constants.METHOD_ALL
'noop
Case Else
'noop

View File

@@ -138,42 +138,16 @@ Public Class State
For Each oRow As DataRow In oTable.Rows
Dim oTypeId = oRow.ItemEx("PROFILE_ID", 0)
Dim oScope As ImportProfileStep.StepScope
Select Case oRow.ItemEx("SCOPE", "FILE")
Case "FOLDER"
oScope = ImportProfileStep.StepScope.FOLDER
Case "FILE"
oScope = ImportProfileStep.StepScope.FILE
End Select
Dim oMethod As ImportProfileStep.StepMethod
Select Case oRow.ItemEx("METHOD", "ALL")
Case "SUBSTRING"
oScope = ImportProfileStep.StepMethod.SUBSTRING
Case "SPLIT"
oScope = ImportProfileStep.StepMethod.SPLIT
Case "REGEX"
oScope = ImportProfileStep.StepMethod.REGEX
Case "STATIC"
oScope = ImportProfileStep.StepMethod.VALUE
Case Else
oScope = ImportProfileStep.StepMethod.ALL
End Select
Dim oStep As New ImportProfileStep With {
.Id = oRow.ItemEx("GUID", 0),
.ProfileId = oRow.ItemEx("PROFILE_ID", 0),
.IndexName = oRow.Item("IDX_NAME"),
.Method = oMethod,
.Argument1 = oRow.ItemEx("ARGUMENT1", ""),
.Argument2 = oRow.ItemEx("ARGUMENT2", ""),
.Argument3 = oRow.ItemEx("ARGUMENT3", ""),
.Scope = oScope,
.Active = oRow.ItemEx("ACTIVE", 0)
.Active = oRow.ItemEx("ACTIVE", 0),
.Method = oRow.ItemEx("METHOD", "ALL"),
.Scope = oRow.ItemEx("SCOPE", "FILE")
}
oSteps.Add(oStep)
@@ -207,7 +181,6 @@ Public Class State
Logger.Info("[{0}] Import Profiles loaded!", oTable.Rows.Count)
For Each oRow As DataRow In oTable.Rows
Dim oTypeId = oRow.ItemEx("JOB_TYPE_ID", 0)
Dim oProfile As New ImportProfile With {
.Id = oRow.ItemEx("GUID", 0),
.JobId = oRow.ItemEx("JR_JOB_ID", 0),
@@ -222,12 +195,23 @@ Public Class State
.Active = oRow.ItemEx("ACTIVE", 0)
}
Logger.Debug("ProfileId: [{0}]", oProfile.Id)
Logger.Debug("JobId: [{0}]", oProfile.JobId)
Logger.Debug("ObjectType: [{0}]", oProfile.ObjectTypeName)
Logger.Debug("SourceFolder: [{0}]", oProfile.SourceFolder)
Logger.Debug("TargetFolder: [{0}]", oProfile.TargetFolder)
oProfiles.Add(oProfile)
Logger.Debug("Adding Import Profile for Folder [{0}]", oProfile.SourceFolder)
Next
Return oProfiles
Return oProfiles.
Select(Function(p) FillJobForProfile(p, JobDefinitions)).
Select(Function(p) FillStepsForProfile(p, ProfileDefintions.ImportProfileSteps)).
Select(Function(p) FillObjectTypeForProfile(p, ObjectTypes)).
ToList()
Catch ex As Exception
Logger.Error(ex)
@@ -236,6 +220,33 @@ Public Class State
End Try
End Function
Private Function FillJobForProfile(pProfile As ImportProfile, pJobDefinitions As List(Of JobDefinition)) As ImportProfile
Dim oJob = pJobDefinitions.
Where(Function(job) job.Id = pProfile.JobId).
FirstOrDefault()
pProfile.Job = oJob
Return pProfile
End Function
Private Function FillObjectTypeForProfile(pProfile As ImportProfile, pObjectTypes As List(Of ObjectType)) As ImportProfile
Dim oObjectType = pObjectTypes.
Where(Function(t) t.Name = pProfile.ObjectTypeName).
FirstOrDefault()
pProfile.ObjectType = oObjectType
Return pProfile
End Function
Private Function FillStepsForProfile(pProfile As ImportProfile, pProfileSteps As List(Of ImportProfileStep)) As ImportProfile
Dim oSteps = pProfileSteps.
Where(Function(s) s.ProfileId = pProfile.Id).
ToList()
pProfile.Steps = oSteps
Return pProfile
End Function
Private Function GetJobDefinitions(pJobTypes As List(Of JobType)) As List(Of JobDefinition)
Dim oJobs As New List(Of JobDefinition)

View File

@@ -16,8 +16,8 @@ Namespace WCF
<OperationContract>
Function GetJobStatus() As GetJobStatusResponse
'TODO: implement
Function RunJob() As RunJobResponse
<OperationContract>
Function RunJob(pdata As RunJobRequest) As RunJobResponse
<OperationContract>
Function UpdateJob(pData As UpdateJobRequest) As UpdateJobResponse

View File

@@ -57,7 +57,7 @@ Namespace WCF
Return oMethod.Run(pData)
End Function
Public Function RunJob() As RunJob.RunJobResponse Implements IJobRunner.RunJob
Public Function RunJob(pData As RunJob.RunJobRequest) As RunJob.RunJobResponse Implements IJobRunner.RunJob
'Dim oMethod As New RunJob.RunJobMethod(LogConfig, Database, State, Scheduler)
'Return oMethod.Run(pData)
End Function

View File

@@ -13,36 +13,22 @@ Public Class GetJobConfig
End Sub
Public Function Run() As GetJobConfigResponse
Return New GetJobConfigResponse With {
.JobTypes = State.JobTypes,
.JobDefinitions = State.JobDefinitions,
.ProfileDefinitions = New GetJobConfigResponse.ProfileDefinitionConfig With {
.ImportProfiles = State.ProfileDefintions.ImportProfiles.
Select(AddressOf FillJobForProfile).
Select(AddressOf FillStepsForProfile).
ToList()
},
.WindreamObjectTypes = State.ObjectTypes
}
Try
Return New GetJobConfigResponse With {
.JobTypes = State.JobTypes,
.JobDefinitions = State.JobDefinitions,
.ProfileDefinitions = New GetJobConfigResponse.ProfileDefinitionConfig With {
.ImportProfiles = State.ProfileDefintions.ImportProfiles
},
.WindreamObjectTypes = State.ObjectTypes
}
Catch ex As Exception
Logger.Error(ex)
Return New GetJobConfigResponse() With {.OK = False, .ErrorMessage = ex.Message}
End Try
End Function
Private Function FillJobForProfile(pProfile As ImportProfile) As ImportProfile
Dim oJob = State.JobDefinitions.
Where(Function(job) job.Id = pProfile.JobId).
FirstOrDefault()
pProfile.Job = oJob
Return pProfile
End Function
Private Function FillStepsForProfile(pProfile As ImportProfile) As ImportProfile
Dim oSteps = State.ProfileDefintions.ImportProfileSteps.
Where(Function(s) s.ProfileId = pProfile.Id).
ToList()
pProfile.Steps = oSteps
Return pProfile
End Function
End Class
Public Class GetJobConfigResponse
@@ -61,6 +47,7 @@ Public Class GetJobConfig
Public Property ProfileDefinitions As New ProfileDefinitionConfig
Public Class ProfileDefinitionConfig
<DataMember>
Public Property ImportProfiles As List(Of ImportProfile)
End Class
End Class

View File

@@ -15,7 +15,10 @@ Public Class RunJob
End Sub
Public Async Function Run(pData As RunJobRequest) As Task(Of RunJobResponse)
Await Scheduler.ScheduleJob(pData.JobId)
' This is calling the async function ScheduleJob synchronous, so that we can return a value to the caller
' This means that the job might or might not be scheduled when this method returns.
Task.Run(Function() Scheduler.ScheduleJob(pData.JobId))
Return New RunJobResponse()
End Function

View File

@@ -30,9 +30,15 @@ Public Class UpdateProfile
Return New UpdateProfileResponse With {.OK = False}
End If
Logger.Debug("Executing Action [{0}]", pData.Action)
Select Case pData.Action
Case UpdateProfileRequest.UpdateProfileAction.Update
oResponse = DoUpdateImportProfile(pData)
If DoUpdateImportProfile(pData) Then
oResponse = UpdateImportProfileSteps(pData)
Else
oResponse = False
End If
Case UpdateProfileRequest.UpdateProfileAction.Create
oResponse = DoCreateImportProfile(pData)
@@ -42,6 +48,8 @@ Public Class UpdateProfile
End Select
Logger.Debug("Action successful: [{0}]", oResponse)
If oResponse Then
Scheduler.Reload()
Else
@@ -133,8 +141,153 @@ Public Class UpdateProfile
Return Database.ExecuteNonQuery(oCommand)
End Function
Private Function UpdateImportProfileSteps(pData As UpdateProfileRequest) As Boolean
Dim oProfile = pData.ImportProfile
Dim oSQL As String = "UPDATE"
' Get the existing steps from the database
Dim oExistingStepsSQL = $"SELECT GUID FROM TBECM_JR_FIW_STEP WHERE PROFILE_ID = {oProfile.Id}"
Dim oExistingSteps = Database.GetDatatable(oExistingStepsSQL)
Dim oExistingStepsIds = oExistingSteps.Rows.Cast(Of DataRow).Select(Of Integer)(Function(r) r.Item("GUID")).ToList()
Logger.Debug("Existing steps: [{0}]", oExistingStepsIds.Count)
' Get the updated steps from the sent data
Dim oUpdatedSteps = oProfile.Steps
Dim oUpdatedStepsIds = oUpdatedSteps.Select(Function(s) s.Id).ToList()
Logger.Debug("Updated steps: [{0}]", oUpdatedStepsIds.Count)
' Calculate differences
' =======================
' These ids did not exist in the database but in the sent data,
' they will be created.
Dim oNewIds = oUpdatedStepsIds.Except(oExistingStepsIds).ToList()
Logger.Debug("Steps that will be created: [{0}]", oNewIds.Count)
Dim oCreateSuccessful = DoCreateImportProfileSteps(pData, oNewIds)
Logger.Debug("Create Successful: [{0}]", oCreateSuccessful)
' These ids existed in the database but not in the sent data,
' they will be deleted.
Dim oDeletedIds = oExistingStepsIds.Except(oUpdatedStepsIds).ToList()
Logger.Debug("Steps that will be deleted: [{0}]", oDeletedIds.Count)
Dim oDeleteSuccessful = DoDeleteImportProfileSteps(pData, oDeletedIds)
Logger.Debug("Delete Successful: [{0}]", oDeleteSuccessful)
' These ids exist in both datasets, so they were not deleted or created,
' they will be updated in case their values changed.
Dim oUnchangedIds = oExistingStepsIds.Union(oUpdatedStepsIds).
Except(oNewIds).
Except(oDeletedIds).
Distinct().
ToList()
Logger.Debug("Steps that will be updated: [{0}]", oUnchangedIds.Count)
Dim oUpdateSuccessful = DoUpdateImportProfileSteps(pData, oUnchangedIds)
Logger.Debug("Update Successful: [{0}]", oUpdateSuccessful)
' If all operations were successful, only then we return true.
Return New List(Of Boolean) From {oDeleteSuccessful, oCreateSuccessful, oUpdateSuccessful}.All(Function(b) b)
End Function
Private Function DoUpdateImportProfileSteps(pData As UpdateProfileRequest, pIdList As List(Of Integer)) As Boolean
Dim oProfile = pData.ImportProfile
Dim oSQL As String = "UPDATE TBECM_JR_FIW_STEP
SET IDX_NAME = @IDX_NAME,
METHOD = @METHOD,
ARGUMENT1 = @ARGUMENT1,
ARGUMENT2 = @ARGUMENT2,
ARGUMENT3 = @ARGUMENT3,
SCOPE = @SCOPE,
ACTIVE = @ACTIVE
WHERE GUID = @GUID"
Dim oResults As New List(Of Boolean)
For Each oId In pIdList
Try
Dim oStep = pData.ImportProfile.Steps.Where(Function(s) s.Id = oId).SingleOrDefault()
Dim oCommand As New SqlClient.SqlCommand(oSQL)
oCommand.Parameters.Add("IDX_NAME", SqlDbType.NVarChar, 100).Value = oStep.IndexName
oCommand.Parameters.Add("METHOD", SqlDbType.NVarChar, 100).Value = oStep.Method
oCommand.Parameters.Add("ARGUMENT1", SqlDbType.NVarChar, 500).Value = oStep.Argument1
oCommand.Parameters.Add("ARGUMENT2", SqlDbType.NVarChar, 500).Value = oStep.Argument2
oCommand.Parameters.Add("ARGUMENT3", SqlDbType.NVarChar, 500).Value = oStep.Argument3
oCommand.Parameters.Add("SCOPE", SqlDbType.NVarChar, 50).Value = oStep.Scope
oCommand.Parameters.Add("ACTIVE", SqlDbType.Bit).Value = oStep.Active
oCommand.Parameters.Add("GUID", SqlDbType.Int).Value = oStep.Id
oResults.Add(Database.ExecuteNonQuery(oCommand))
Catch ex As Exception
oResults.Add(False)
Logger.Error(ex)
End Try
Next
Return oResults.All(Function(r) r)
End Function
Private Function DoCreateImportProfileSteps(pData As UpdateProfileRequest, pIdList As List(Of Integer)) As Boolean
Dim oProfile = pData.ImportProfile
Dim oSQL As String = "INSERT INTO TBECM_JR_FIW_STEP
(PROFILE_ID, IDX_NAME, METHOD, ARGUMENT1, ARGUMENT2, ARGUMENT3, SCOPE, ACTIVE) VALUES
(@PROFILE_ID, @IDX_NAME, @METHOD, @ARGUMENT1, @ARGUMENT2, @ARGUMENT3, @SCOPE, @ACTIVE)"
Dim oResults As New List(Of Boolean)
For Each oId In pIdList
Try
Dim oStep = pData.ImportProfile.Steps.Where(Function(s) s.Id = oId).SingleOrDefault()
Dim oCommand As New SqlClient.SqlCommand(oSQL)
oCommand.Parameters.Add("PROFILE_ID", SqlDbType.Int).Value = oStep.ProfileId
oCommand.Parameters.Add("IDX_NAME", SqlDbType.NVarChar, 100).Value = oStep.IndexName
oCommand.Parameters.Add("METHOD", SqlDbType.NVarChar, 100).Value = oStep.Method
oCommand.Parameters.Add("ARGUMENT1", SqlDbType.NVarChar, 500).Value = oStep.Argument1
oCommand.Parameters.Add("ARGUMENT2", SqlDbType.NVarChar, 500).Value = oStep.Argument2
oCommand.Parameters.Add("ARGUMENT3", SqlDbType.NVarChar, 500).Value = oStep.Argument3
oCommand.Parameters.Add("SCOPE", SqlDbType.NVarChar, 50).Value = oStep.Scope
oCommand.Parameters.Add("ACTIVE", SqlDbType.Bit).Value = oStep.Active
oResults.Add(Database.ExecuteNonQuery(oCommand))
Catch ex As Exception
oResults.Add(False)
Logger.Error(ex)
End Try
Next
Return oResults.All(Function(r) r)
End Function
Private Function DoDeleteImportProfileSteps(pData As UpdateProfileRequest, pIdList As List(Of Integer)) As Boolean
Dim oProfile = pData.ImportProfile
Dim oSQL As String = "DELETE FROM TBECM_JR_FIW_STEP WHERE GUID = @GUID"
Dim oResults As New List(Of Boolean)
For Each oId In pIdList
Try
Dim oStep = pData.ImportProfile.Steps.Where(Function(s) s.Id = oId).SingleOrDefault()
Dim oCommand As New SqlClient.SqlCommand(oSQL)
oCommand.Parameters.Add("GUID", SqlDbType.Int).Value = oStep.Id
oResults.Add(Database.ExecuteNonQuery(oCommand))
Catch ex As Exception
oResults.Add(False)
Logger.Error(ex)
End Try
Next
Return oResults.All(Function(r) r)
End Function
End Class
Public Class UpdateProfileRequest
Public Enum UpdateProfileAction
Create

View File

@@ -13,6 +13,7 @@ Namespace WCF
Public Sub New(singletonInstance As Object, baseAddresses As Uri())
MyBase.New(singletonInstance, baseAddresses)
End Sub
Public Sub EnableMetadataExchange(ByVal Optional EnableHttpGet As Boolean = True)