Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillkrylov committed Nov 9, 2023
2 parents 2fab781 + 5b5bde6 commit 0608843
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$cliogate_Version="2.0.0.15"
$cliogate_Version="2.0.0.19"
$clioPath=".\clio\bin\Release\net6.0\clio.dll"

dotnet build .\clio\clio.csproj -c Release --no-incremental
Expand Down
Binary file modified clio/cliogate/cliogate.gz
Binary file not shown.
Binary file modified clio/cliogate/cliogate_netcore.gz
Binary file not shown.
Binary file modified cliogate.gz
Binary file not shown.
66 changes: 55 additions & 11 deletions cliogate/Files/cs/BpmcliApiGateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Terrasoft.Core.Factories;
using Terrasoft.Core.Packages;
using Terrasoft.Web.Common;
using global::Common.Logging;
#if NETSTANDARD2_0
using System.Globalization;
using Terrasoft.Web.Http.Abstractions;
Expand Down Expand Up @@ -99,6 +100,9 @@ private Stream GetCompressedFolder(string rootRelativePath, string fileName) {

#endregion

private ILog _log = LogManager.GetLogger(typeof(CreatioApiGateway));

Check notice on line 103 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Field can be made readonly (private accessibility)

Field can be made readonly
private string splitName = "#OriginalMaintainer:";

Check notice on line 104 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Field can be made readonly (private accessibility)

Field can be made readonly

#region Methods: Public

[OperationContract]
Expand Down Expand Up @@ -198,37 +202,77 @@ public bool ResetSchemaChangeState(string packageName) {
ResponseFormat = WebMessageFormat.Json)]
public bool UnlockPackages(string[] unlockPackages = null) {
if (UserConnection.DBSecurityEngine.GetCanExecuteOperation("CanManageSolution")) {
_log.WarnFormat("Start UnlockPackages, packages: {0}", string.Join(", ", unlockPackages));

Check warning on line 205 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'null' assignment to non-nullable entity

Possible 'null' assignment to non-nullable entity
var maintainerCode = SysSettings.GetValue<string>(UserConnection, "Maintainer", "NonImplemented");
Query query = new Update(UserConnection, "SysPackage")
.Set("InstallType", Column.Parameter(0, "Integer"))
.Where("Maintainer").IsEqual(Column.Parameter(maintainerCode)) as Update;
if (unlockPackages != null && unlockPackages.Any()) {

Check warning on line 207 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Expression is always 'true' or always 'false'

Expression is always true
query = query.And("Name").In(Column.Parameters((IEnumerable<string>)unlockPackages));
foreach (var unlockPackage in unlockPackages) {
var originalMaintainer = GetPackageAttributeValue<string>("Maintainer", unlockPackage);
var originalDescription = GetPackageAttributeValue<string>("Description", unlockPackage);
var description = originalDescription.Contains(splitName) ? originalDescription
: originalDescription + splitName + originalMaintainer;
Query query = new Update(UserConnection, "SysPackage")
.Set("InstallType", Column.Parameter(0))
.Set("Maintainer", Column.Parameter(maintainerCode))
.Set("Description", Column.Parameter(description))
.Where("Name").IsEqual(Column.Parameter(unlockPackage));
Update update = query as Update;
update.BuildParametersAsValue = true;

Check warning on line 219 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'System.NullReferenceException'

Possible 'System.NullReferenceException'
update.Execute();
}
} else {
Query query = new Update(UserConnection, "SysPackage")
.Set("InstallType", Column.Parameter(0, "Integer"))
.Where("Maintainer").IsEqual(Column.Parameter(maintainerCode));
Update update = query as Update;
update.Execute();

Check warning on line 227 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'System.NullReferenceException'

Possible 'System.NullReferenceException'
}
Update update = query as Update;
update.Execute();
return true;
} else {
throw new Exception("You don'nt have permission for operation CanManageSolution");
}
}

private T GetPackageAttributeValue<T>(string key, string packageName) {
Select query = new Select(UserConnection)
.From("SysPackage")
.Column(key)
.Where("Name")
.IsEqual(Column.Parameter(packageName)) as Select;
var result = query.ExecuteScalar<T>();

Check warning on line 241 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'System.NullReferenceException'

Possible 'System.NullReferenceException'
return result;
}

[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "LockPackages",
BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
public bool LockPackages(string[] lockPackages = null) {
if (UserConnection.DBSecurityEngine.GetCanExecuteOperation("CanManageSolution")) {
_log.WarnFormat("Start LockPackages, packages: {0}", string.Join(", ", lockPackages));

Check warning on line 251 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'null' assignment to non-nullable entity

Possible 'null' assignment to non-nullable entity
var maintainerCode = SysSettings.GetValue<string>(UserConnection, "Maintainer", "NonImplemented");
Query query = new Update(UserConnection, "SysPackage")
if (lockPackages != null && lockPackages.Any()) {

Check warning on line 253 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Expression is always 'true' or always 'false'

Expression is always true
foreach (var lockPackage in lockPackages) {
var originalMaintainer = GetPackageAttributeValue<string>("Maintainer", lockPackage);
var description = GetPackageAttributeValue<string>("Description", lockPackage)
.Split(new[] { splitName }, StringSplitOptions.None);
var maintainer = description.Length > 1 ? description.Last() : originalMaintainer;
Query query = new Update(UserConnection, "SysPackage")
.Set("InstallType", Column.Parameter(1))
.Set("Maintainer", Column.Parameter(maintainer))
.Set("Description", Column.Parameter(description[0]))
.Where("Name").IsEqual(Column.Parameter(lockPackage));
Update update = query as Update;
update.BuildParametersAsValue = true;

Check warning on line 265 in cliogate/Files/cs/BpmcliApiGateway.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'System.NullReferenceException'

Possible 'System.NullReferenceException'
update.Execute();
}
} else {
Query query = new Update(UserConnection, "SysPackage")
.Set("InstallType", Column.Parameter(1, "Integer"))
.Where("Maintainer").IsEqual(Column.Parameter(maintainerCode))
.And("Name").IsNotEqual(Column.Parameter("Custom")) as Update;
if (lockPackages != null && lockPackages.Any()) {
query = query.And("Name").In(Column.Parameters((IEnumerable<string>)lockPackages));
Update update = query as Update;
update.Execute();
}
Update update = query as Update;
update.Execute();
return true;
} else {
throw new Exception("You don'nt have permission for operation CanManageSolution");
Expand Down
4 changes: 2 additions & 2 deletions cliogate/descriptor.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"Descriptor": {
"UId": "e24226f9-c177-458f-af34-9338e2699983",
"PackageVersion": "2.0.0.15",
"PackageVersion": "2.0.0.19",
"Name": "cliogate",
"Type": 0,
"ProjectPath": "",
"ModifiedOnUtc": "/Date(1674754117000)/",
"ModifiedOnUtc": "/Date(1699572901000)/",
"Maintainer": "Advanced Technologies Foundation",
"DependsOn": []
}
Expand Down
Binary file added docs/img/clio_explorer_mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0608843

Please sign in to comment.