ampla / ampla-data Goto Github PK
View Code? Open in Web Editor NEWAmpla Webservice Data Access and classes that supports a model based repository pattern
License: MIT License
Ampla Webservice Data Access and classes that supports a model based repository pattern
License: MIT License
Provide access to the History of a record using the GetAuditData method.
Need to add nuget functionality to ensure that functionality is easily added.
When a user changes the default value for a record, the GetAuditData will return an empty string for the original value.
For instance, changing an int field from default (null) to 100 will show the following:
When the Repository.GetVersions() tries to convert the empty string to an int, it will be throw an exception.
[FormatException: is not a valid value for Boolean.]
System.ComponentModel.BooleanConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) +291
System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text) +43
AmplaWeb.Data.Binding.ModelData.ModelProperties`1.TryConvertFromString(Type type, String propertyName, String stringValue, Object& value) in D:\GitHub\Ampla\Ampla-Data-MVC\src\AmplaWeb.Data\Binding\ModelData\ModelProperties.cs:229
AmplaWeb.Data.Binding.ModelData.ModelProperties`1.TrySetValueFromString(TModel model, String propertyName, String value) in D:\GitHub\Ampla\Ampla-Data-MVC\src\AmplaWeb.Data\Binding\ModelData\ModelProperties.cs:174
AmplaWeb.Data.Binding.ViewData.AmplaViewProperties`1.UpdateModel(TModel model, String name, String value, Boolean useDisplayName) in D:\GitHub\Ampla\Ampla-Data-MVC\src\AmplaWeb.Data\Binding\ViewData\AmplaViewProperties.cs:68
AmplaWeb.Data.Binding.AmplaGetDataVersionsBinding`1.Bind() in D:\GitHub\Ampla\Ampla-Data-MVC\src\AmplaWeb.Data\Binding\AmplaGetDataVersionsBinding.cs:62
AmplaWeb.Data.AmplaRepository.AmplaRepository`1.GetVersions(Int32 id) in D:\GitHub\Ampla\Ampla-Data-MVC\src\AmplaWeb.Data\AmplaRepository\AmplaRepository.cs:204
AmplaWeb.Data.Adapters.RepositoryAdapter`1.GetVersions(Int32 id) in D:\GitHub\Ampla\Ampla-Data-MVC\src\AmplaWeb.Data\Adapters\RepositoryAdapter.cs:55
AmplaWeb.Data.Controllers.RepositoryController`1.Versions(Int32 id) in D:\GitHub\Ampla\Ampla-Data-MVC\src\AmplaWeb.Data\Controllers\RespositoryController.cs:78
Repository.GetVersions() needs to use the Displayname of properties but the GetAuditData returns the name not the display name of the field.
The Repository pattern is about looking at the classes.
So why not review the GetAuditData history to provide different "versions" of the data.
This is similar to issue #8 but rather than providing a list of changes actually provide the changes in the model.
One of the problems with the the Downtime Cause and Classification fields is that they are either ids or the names.
When reading data the Cause
and Classification
fields will return Cause and Classification as int
when ResolveIdentifiers = false
and will return the fields as string
when ResolveIdentifiers = true
.
When reading data in the GetData
request the Cause
and Classification
will read either string
or int
depending on the ResolveIdentifiers
property.
When writing data in the SubmitData
the Cause and Classification will need to be int
.
This makes it difficult to map the Ampla records to and from the <TModel>
object, especially if there are Cause
and Classification
properties.
There is no option to be able to include deleted records. Even when specified in the [AmplaDefaultFilter("Deleted=")]
attribute.
Example:
[AmplaLocation(Location = "Enterprise.Site.Area.Point")]
[AmplaModule(Module = "Production")]
[AmplaDefaultFilters("Deleted=")]
public class Model
{
public int Id { get; set; }
/// ...
}
At the moment, the Duration field only supports int data types.
Add extra support for Duration field that will map between TimeSpan and int.
The AmplaWeb.Data assembly has mostly data access methods but there are some web methods. Need to extract the web based classes into a separate assembly to promote reuse.
Ampla's Data Webservice doesn't provide enough meta data from the GetViews webservice to determine what operations are allowed.
The GetViews() meta data returned will specify that the following operations are allowed but will throw when the SubmitData or UpdateRecordStatus methods are called.
When a record is deleted, the audit trail shows "{user} modified record (IsDeleted)". Should really be "{user} deleted record.
At the moment, the library caches the credential (session) and will keep operating until the client session expires when it will then throw an "Unable to Authenticate a user" error.
Currently the AmplaUserService doesn't handle the fact that the same user can log in from multiple clients from different IP addresses. When one of the users log out, then all users will be logged out.
When using a default filter, it is possible to return multiple records for a single id. This will occur when the Metrics module has a default query that for current shift.
The filter:
Id = 100, GroupBy = Hour, Sample Period = Current day
will include the current period records as well as the record specified by 100.
When writing to the Ampla Data Webservice, if the Cause Location is null or string.Empty then web-service will throw the following fault.
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
<faultstring xml:lang="en-AU">Value cannot be null.
Parameter name: name</faultstring>
<detail>
<ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HelpLink i:nil="true" />
<InnerException i:nil="true" />
<Message>Value cannot be null.
Parameter name: name</Message>
<StackTrace> at Citect.Common.ArgumentCheck.IsNotNullOrEmpty(String argumentValue, String parameterName) in c:\Projects\Platform\v5.2\Code\Common\ArgumentCheck.cs:line 113
at Citect.Ampla.Framework.ChildItemsCollection.get_Item(String name) in c:\Projects\Platform\v5.2\Code\Framework\ChildItemsCollection.cs:line 124
at Citect.Ampla.Framework.AllItemsCollection.get_Item(String name) in c:\Projects\Platform\v5.2\Code\Framework\AllItemsCollection.cs:line 57
at Citect.Ampla.Public.WebService.Data.V200806.DataWebService.buildEditedData(Int32 recordIndex, SubmitDataRecord record, Int32 setIdInt, ErrorHelper errors, FieldDescriptorCollection fieldDescriptors, Guid session) in c:\Projects\Applications\v5.2\Code\WebServices\Public\WebService\Data\V200806\DataWebServiceImplementation.cs:line 3019
at Citect.Ampla.Public.WebService.Data.V200806.DataWebService.buildSubmitDataEditableCollection(ErrorHelper errorHelper, SubmitDataRecord[] sets, Guid session, String userName) in c:\Projects\Applications\v5.2\Code\WebServices\Public\WebService\Data\V200806\DataWebServiceImplementation.cs:line 2900
at Citect.Ampla.Public.WebService.Data.V200806.DataWebService.SubmitData(SubmitDataRequestMessage requestMessage) in c:\Projects\Applications\v5.2\Code\WebServices\Public\WebService\Data\V200806\DataWebServiceImplementation.cs:line 945
at SyncInvokeSubmitData(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.ArgumentNullException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.