Skip to content
Permalink
Browse files

Merge pull request #679 from Orckestra/fix/xml-data-scope-setup-issue

    Adding a data language flushes (reinit) settings "as expected"
    Removing hard dependency on a user being logged in and evaluating publication controlled tree elements
    Textual fix and copy/paste fix
  • Loading branch information...
mawtex committed Jul 5, 2019
2 parents dbde1a5 + 04bf53b commit b6bed91eb97204836d6a480b738aa39a0190607b
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -189,6 +189,11 @@ internal static void AddLocale(CultureInfo cultureInfo, string urlMappingName, b
}

DynamicTypeManager.AddLocale(cultureInfo);

if (makeFlush)
{
C1Console.Events.GlobalEventSystemFacade.FlushTheSystem(false);
}
}


@@ -114,7 +114,7 @@ public static bool SetUp(string setupDescriptionXml, string username, string pas
ApplicationLevelEventHandlers.ApplicationStartInitialize();

Log.LogInformation(VerboseLogTitle, "Creating first locale: " + language);
LocalizationFacade.AddLocale(locale, "", true, false, true);
LocalizationFacade.AddLocale(locale, "", true, true, true);


Log.LogInformation(VerboseLogTitle, "Creating first user: " + username);
@@ -265,27 +265,34 @@ private static object GetDefaultValue(Type type)

private static Dictionary<string, string> GetAvailablePublishingFlowTransitions(EntityToken entityToken)
{
var transitionNames = new Dictionary<string, string>
if(UserValidationFacade.IsLoggedIn())
{
var transitionNames = new Dictionary<string, string>
{
{GenericPublishProcessController.Draft, LocalizationFiles.Composite_Management.PublishingStatus_draft},
{GenericPublishProcessController.AwaitingApproval, LocalizationFiles.Composite_Management.PublishingStatus_awaitingApproval}
};

var username = UserValidationFacade.GetUsername();
var userPermissionDefinitions = PermissionTypeFacade.GetUserPermissionDefinitions(username);
var userGroupPermissionDefinition = PermissionTypeFacade.GetUserGroupPermissionDefinitions(username);
var currentPermissionTypes = PermissionTypeFacade.GetCurrentPermissionTypes(UserValidationFacade.GetUserToken(), entityToken, userPermissionDefinitions, userGroupPermissionDefinition);
foreach (var permissionType in currentPermissionTypes)
{
if (GenericPublishProcessController.AwaitingPublicationActionPermissionType.Contains(permissionType))
var username = UserValidationFacade.GetUsername();
var userPermissionDefinitions = PermissionTypeFacade.GetUserPermissionDefinitions(username);
var userGroupPermissionDefinition = PermissionTypeFacade.GetUserGroupPermissionDefinitions(username);
var currentPermissionTypes = PermissionTypeFacade.GetCurrentPermissionTypes(UserValidationFacade.GetUserToken(), entityToken, userPermissionDefinitions, userGroupPermissionDefinition);
foreach (var permissionType in currentPermissionTypes)
{
transitionNames.Add(GenericPublishProcessController.AwaitingPublication,
LocalizationFiles.Composite_Management.PublishingStatus_awaitingPublication);
break;
if (GenericPublishProcessController.AwaitingPublicationActionPermissionType.Contains(permissionType))
{
transitionNames.Add(GenericPublishProcessController.AwaitingPublication,
LocalizationFiles.Composite_Management.PublishingStatus_awaitingPublication);
break;
}
}
}

return transitionNames;
return transitionNames;
}
else
{
return new Dictionary<string, string>();
}
}


@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@@ -249,7 +249,7 @@ private static void OnDataBuildNew(object sender, DataEventArgs dataEventArgs)

foreach (IPublishControlledAuxiliary publishControlledAuxiliary in publishControlledAuxiliaries)
{
publishControlledAuxiliary.OnAfterDataUpdated(dataEventArgs.Data);
publishControlledAuxiliary.OnAfterBuildNew(dataEventArgs.Data);
}
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
@@ -115,7 +115,6 @@ public void AddLocale(CultureInfo cultureInfo)
}



public void RemoveLocale(CultureInfo cultureInfo)
{
XmlDataProviderDocumentCache.ClearCache();
@@ -148,7 +147,7 @@ private void InitializeExistingStores()
{
if (!dataTypes.TryGetValue(dataTypeDescriptor.DataTypeId, out interfaceType) || interfaceType == null)
{
Log.LogWarning(LogTitle, "The data interface type '{0}' does not exists and is not code generated. It will not be usable", dataTypeDescriptor.TypeManagerTypeName);
Log.LogWarning(LogTitle, "The data interface type '{0}' does not exist and is not code generated. It will not be usable", dataTypeDescriptor.TypeManagerTypeName);
continue;
}

0 comments on commit b6bed91

Please sign in to comment.
You can’t perform that action at this time.