Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using MongoDB.Bson;
- using PaperSoftKernelAPI.DataStructures;
- using PaperSoftKernelAPI.Entities.Authorization;
- using PaperSoftKernelAPI.Entities.Authorization.Environment;
- using PaperSoftKernelAPI.Entities.Classification;
- using PaperSoftKernelAPI.Entities.Enumerators;
- using PaperSoftKernelAPI.Entities.Operations.BackOffice;
- using PaperSoftKernelAPI.Entities.Operations.Billboards;
- using PaperSoftKernelAPI.Entities.Operations.EForm;
- using PaperSoftKernelAPI.Entities.Operations.OnDocuments;
- using PaperSoftKernelAPI.Entities.Operations.Search;
- using PaperSoftKernelAPI.Entities.Operations.Upload;
- using PaperSoftKernelAPI.Services.Factories;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace QAJackieDataGenerator.Sets.Business.Web
- {
- public class SetMacasProd : AbstractSet
- {
- public SetMacasProd(JackieFactorySupport pSupportShell, string pPrefix) : base(pSupportShell, pPrefix) { }
- public SetMacasProd(JackieFactorySupport pSupportShell, string pPrefix, string pName) : base(pSupportShell, pPrefix, pName) { }
- #region Settings
- private static string _defaultPassword = "papersoft";
- public static PpsClient _ClientDefault = new PpsClient()
- {
- Code = "DEMO",
- Name = "DEMO",
- Description = "For demonstrations",
- EnvironmentsConfigurations = new List<PpsClientEnvironmentConfiguration>()
- {
- new PpsClientEnvironmentConfiguration() {
- SessionTimeOut = 30,
- Envirmonment = SetUtils.EnvMobile
- },
- new PpsClientEnvironmentConfiguration() {
- SessionTimeOut = 30,
- Envirmonment = SetUtils.EnvWeb
- }
- }
- };
- private static PpsDatabase pDestinationDatabase = new PpsDatabase()
- {
- ConnectionString = "Data Source=172.16.3.13\\sql2012;Initial Catalog=PaperSoft113_MACAS;User Id=sa;Password=Zeppelin1940;",
- InstanceName = "PaperSoft113_DEMO",
- Description = "PaperSoftt 113 DEMO"
- };
- public static PpsPapersoftAddress pDestinationAddress = new PpsPapersoftAddress()
- {
- Database = pDestinationDatabase,
- ClientID = 1,
- ProcessID = Guid.NewGuid()
- };
- #endregion
- public static string BaseOperationsHTTPEnd = "http://localhost:59726";
- public static string PortalHttpEnd = "http://10.200.177.133:7500";
- public static string BaseEnd = BaseOperationsHTTPEnd + "/WebBusinessService.svc/json/";
- protected override void ValidSet(string pPrefix)
- {
- WriteEndPoints("Portal's Endpoint", PortalHttpEnd);
- WriteEndPoints("Operations's Endpoint", BaseEnd);
- SupportShell.CreateNewAboutRepository().Add(SetUtils.CreateAbout(PortalHttpEnd));
- var operationRep = SupportShell.CreateNewOperationRepository();
- //Groups and Roles
- /**
- * M-Commerce
- * Risk Management
- * Finance
- * IT&Billing
- **/
- #region Action Names
- var downloadDocument = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- downloadDocument.Add(LanguagesIdentifiers.enGB, "Download");
- downloadDocument.Add(LanguagesIdentifiers.ptPT, "Descarregar");
- var attachDocument = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- attachDocument.Add(LanguagesIdentifiers.enGB, "Attach");
- attachDocument.Add(LanguagesIdentifiers.ptPT, "Anexar");
- var viewDocument = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- viewDocument.Add(LanguagesIdentifiers.enGB, "View");
- viewDocument.Add(LanguagesIdentifiers.ptPT, "Visualizar");
- var search = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- search.Add(LanguagesIdentifiers.enGB, "Search");
- search.Add(LanguagesIdentifiers.ptPT, "Pesquisa");
- var reportDocument = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- reportDocument.Add(LanguagesIdentifiers.enGB, "Report");
- reportDocument.Add(LanguagesIdentifiers.ptPT, "Relatório");
- var importerCSV = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- importerCSV.Add(LanguagesIdentifiers.enGB, "Recycle Agent");
- importerCSV.Add(LanguagesIdentifiers.ptPT, "Reciclar Agente");
- var manageUsers = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- manageUsers.Add(LanguagesIdentifiers.enGB, "User Management");
- manageUsers.Add(LanguagesIdentifiers.ptPT, "Gestão de Utilizadores");
- var manageGroups = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- manageGroups.Add(LanguagesIdentifiers.enGB, "Group Management");
- manageGroups.Add(LanguagesIdentifiers.ptPT, "Gestão de Grupos");
- var manageRoles = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- manageRoles.Add(LanguagesIdentifiers.enGB, "Role Management");
- manageRoles.Add(LanguagesIdentifiers.ptPT, "Gestão de Funções");
- var configCsv = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- configCsv.Add(LanguagesIdentifiers.enGB, "Csv Importer");
- configCsv.Add(LanguagesIdentifiers.ptPT, "Importar Csv");
- var dragAndDrop = new Dictionary<PaperSoftKernelAPI.Entities.Enumerators.LanguagesIdentifiers, string>();
- dragAndDrop.Add(LanguagesIdentifiers.enGB, "Upload");
- dragAndDrop.Add(LanguagesIdentifiers.ptPT, "Enviar");
- #endregion
- #region Child Actions
- var attachAction = CreateAttachAction(attachDocument, new List<string>() { "application/pdf" }, new List<string>() { "10000" }, "9009");
- var viewActionAudit = CreateViewAction(viewDocument, true, true, true, null, new List<PpsOperation>()
- {
- //{
- // //CreateDownloadAction(downloadDocument)
- //}
- });
- var viewAction = CreateViewAction(viewDocument, true, true, false, null, new List<PpsOperation>()
- {
- //{
- // //CreateDownloadAction(downloadDocument)
- //}
- });
- var reportAction = CreateReportAction(reportDocument, "Report", ";", "csv", new List<int>() { 1, 2, 3, 4, 5 });
- #endregion
- #region Workflows
- PpsOpWorkflowBillboard workflowStateAggregator= CreateWorkflowAction(
- new Dictionary<LanguagesIdentifiers, string>() {
- { LanguagesIdentifiers.enGB, "Error Aggregator" },
- { LanguagesIdentifiers.ptPT, "Erro Aggregator" }
- }, "1000", "10000", new List<PpsOperation>() { attachAction, viewActionAudit });
- PpsOpWorkflowBillboard workflowStateMoneyProvider = CreateWorkflowAction(
- new Dictionary<LanguagesIdentifiers, string>() {
- { LanguagesIdentifiers.enGB, "Error Money" },
- { LanguagesIdentifiers.ptPT, "Erro Money" }
- }, "1001", "10000", new List<PpsOperation>() { attachAction, viewActionAudit });
- PpsOpWorkflowBillboard workflowStateStandalone = CreateWorkflowAction(
- new Dictionary<LanguagesIdentifiers, string>() {
- { LanguagesIdentifiers.enGB, "Error Standalone" },
- { LanguagesIdentifiers.ptPT, "Erro Standalone" }
- }, "1002", "10000", new List<PpsOperation>() { attachAction, viewActionAudit });
- PpsOpWorkflowBillboard workflowStateSubAgent = CreateWorkflowAction(
- new Dictionary<LanguagesIdentifiers, string>() {
- { LanguagesIdentifiers.enGB, "Error Sub Agent" },
- { LanguagesIdentifiers.ptPT, "Erro Sub Agent" }
- }, "1003", "10000", new List<PpsOperation>() { attachAction, viewActionAudit });
- PpsOpWorkflowBillboard workflowStateB2c = CreateWorkflowAction(
- new Dictionary<LanguagesIdentifiers, string>() {
- { LanguagesIdentifiers.enGB, "Error B2c" },
- { LanguagesIdentifiers.ptPT, "Erro B2c" }
- }, "1004", "10000", new List<PpsOperation>() { attachAction, viewActionAudit });
- PpsOpWorkflowBillboard workflowStateC2b = CreateWorkflowAction(
- new Dictionary<LanguagesIdentifiers, string>() {
- { LanguagesIdentifiers.enGB, "Error C2b" },
- { LanguagesIdentifiers.ptPT, "Erro C2b" }
- }, "1005", "10000", new List<PpsOperation>() { attachAction, viewActionAudit });
- PpsOpWorkflowBillboard workflowStateSpecialAgent = CreateWorkflowAction(
- new Dictionary<LanguagesIdentifiers, string>() {
- { LanguagesIdentifiers.enGB, "Error Special Agent" },
- { LanguagesIdentifiers.ptPT, "Erro Special Agent" }
- }, "1006", "10000", new List<PpsOperation>() { attachAction, viewActionAudit });
- #endregion
- #region Search Actions
- #region Search
- Dictionary<int, string> searchableStates = new Dictionary<int,string>();
- searchableStates.Add(9001, "IMPORTED DOCUMENT");
- searchableStates.Add(10000, "INCOMPLETE");
- searchableStates.Add(10001, "VALID");
- searchableStates.Add(10002, "RECYCLED");
- Dictionary<short, string> searchableTemplates = new Dictionary<short, string>();
- searchableTemplates.Add(1000, "AGGREGATOR");
- searchableTemplates.Add(1001, "MONEY PROVIDER");
- searchableTemplates.Add(1002,"STANDALONE");
- searchableTemplates.Add(1003,"SUB-AGENT");
- searchableTemplates.Add(1004,"B2C");
- searchableTemplates.Add(1005,"C2B");
- searchableTemplates.Add(1006,"SPECIAL AGENT");
- var searchOperationReportAndAudit = CreateTableSearchAction(search, searchableStates, searchableTemplates, 20, "9", "10000", new List<PpsOperation>() { viewActionAudit, reportAction, attachAction });
- //var searchOperationReport = CreateTableSearchAction(search, searchableStates, searchableTemplates, 20, "9", "9008", new List<PpsOperation>() { viewAction, reportAction });
- //var searchOperation = CreateTableSearchAction(search, searchableStates, searchableTemplates, 20, "9", "9008", new List<PpsOperation>() { viewActionAudit });
- var csvImporter = new PpsOpImporterCsv()
- {
- Id = ObjectId.Parse("56cadeb891169035303382eb"),
- Route = _routeImporterCsv,
- Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- {
- PresentationZone.WebSidebar,
- new PpsPresentation()
- {
- Zone = PresentationZone.WebSidebar,
- Order = 1,
- Appearance = PresentationAppearance.Normal,
- Name = importerCSV,
- IconCss = PpsWebIcons.Upload.GetEnumDescription()
- }
- }
- },
- KeyField = "TILL_NUMBER",
- ListAvailableFields = new PpsDocumentData[1] {
- new PpsDocumentData()
- {
- //FieldId=5,
- Keyword = "TILL_NUMBER",
- Type = (int)FieldType.Text
- }
- },
- StatusUpdated = 10002,
- AvailableTokens = new char[2] { ',', ';' },
- FileNamingConvention = @"^.+(\.*CSV)$",
- ListProcess = new Guid[7] {
- Guid.Parse("8D459A97-223B-41C1-9E1E-15C26BF3231B"),
- Guid.Parse("783A108D-FCE6-437C-B52D-7D18B5A99749"),
- Guid.Parse("A902328E-BE31-44E1-973F-4F31F62DAA9C"),
- Guid.Parse("DE27736E-0F0F-42DD-8487-C44CEFBD046B"),
- Guid.Parse("D02DC736-2A00-486E-8084-73F20AEA51EC"),
- Guid.Parse("E482713B-ECDD-42E7-BA6B-A019B4A1FBA4"),
- Guid.Parse("3561B1C1-8599-494A-9F83-B978C01C0DE9")
- },
- //Token = ',',
- //PageAmountToSend=10,
- Environment = new List<PpsEnvironment>() { new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- } },
- PapersoftAddress = pDestinationAddress
- };
- csvImporter.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/" + csvImporter.Id.ToString()
- };
- PpsOpManageUsers pManUser = new PpsOpManageUsers();
- pManUser.FecthOperation = true;
- pManUser.RecordsPerPage = 10;
- pManUser.Environment = new List<PpsEnvironment>() { new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- } };
- pManUser.Route = _routeBackOfficeUser;
- pManUser.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/" + pManUser.Id.ToString()
- };
- pManUser.PapersoftAddress = pDestinationAddress;
- pManUser.Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- {
- PresentationZone.WebSidebar,
- new PpsPresentation()
- {
- Zone = PresentationZone.WebSidebar,
- Order = 1,
- Appearance = PresentationAppearance.Normal,
- Name = manageUsers,
- IconCss = PpsWebIcons.User.GetEnumDescription()
- }
- }
- };
- pManUser.CanAdd = true;
- pManUser.CanDelete = true;
- pManUser.CanEdit = true;
- PpsOpManageGroups pManGroup = new PpsOpManageGroups();
- pManGroup.FecthOperation = true;
- pManGroup.Environment = new List<PpsEnvironment>() { new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- } };
- pManGroup.Route = _routeBackOfficeGroup; //
- pManGroup.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/" + pManGroup.Id.ToString()
- };
- pManGroup.PapersoftAddress = pDestinationAddress;
- pManGroup.Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- {
- PresentationZone.WebSidebar,
- new PpsPresentation()
- {
- Zone = PresentationZone.WebSidebar,
- Order = 1,
- Appearance = PresentationAppearance.Normal,
- Name = manageGroups, //
- IconCss = PpsWebIcons.GroupManagement.GetEnumDescription()
- }
- }
- };
- pManGroup.CanEdit = true;
- pManGroup.CanAdd = true;
- pManGroup.CanDelete = true;
- PpsOpManageRoles pManRole = new PpsOpManageRoles();
- pManRole.FecthOperation = true;
- pManRole.Environment = new List<PpsEnvironment>() { new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- } };
- pManRole.Route = _routeBackOfficeRole; //
- pManRole.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/" + pManRole.Id.ToString()
- };
- pManRole.PapersoftAddress = pDestinationAddress;
- pManRole.CanEdit = true;
- pManRole.Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- {
- PresentationZone.WebSidebar,
- new PpsPresentation()
- {
- Zone = PresentationZone.WebSidebar,
- Order = 1,
- Appearance = PresentationAppearance.Normal,
- Name = manageRoles, //
- IconCss = PpsWebIcons.RoleManagement.GetEnumDescription()
- }
- }
- };
- PpsOpManageOperation<PpsOpImporterCsv> configImporter = new PpsOpManageOperation<PpsOpImporterCsv>(csvImporter.Id);
- configImporter.FecthOperation = true;
- configImporter.Environment = new List<PpsEnvironment>() { new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- } };
- configImporter.Route = _routeBackOfficeCsvOperation; //
- configImporter.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/Backoffice/GetOperation/" + configImporter.OperationToConfigureId.ToString()
- };
- configImporter.PapersoftAddress = pDestinationAddress;
- configImporter.Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- {
- PresentationZone.WebSidebar,
- new PpsPresentation()
- {
- Zone = PresentationZone.WebSidebar,
- Order = 1,
- Appearance = PresentationAppearance.Normal,
- Name = importerCSV, //
- IconCss = PpsWebIcons.Upload.GetEnumDescription()
- }
- }
- };
- #endregion
- #endregion
- var opDragAndDrop = new PpsOpDragAndDrop();
- //opDragAndDrop.FecthOperation = true;
- opDragAndDrop.Environment = new List<PpsEnvironment>() { new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- } };
- opDragAndDrop.Route = _routeDragAndDrop; //
- opDragAndDrop.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/" + opDragAndDrop.Id.ToString()
- };
- opDragAndDrop.PapersoftAddress = pDestinationAddress;
- opDragAndDrop.Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- {
- PresentationZone.WebSidebar,
- new PpsPresentation()
- {
- Zone = PresentationZone.WebSidebar,
- Order = 1,
- Appearance = PresentationAppearance.Normal,
- Name = dragAndDrop, //
- IconCss = PpsWebIcons.Upload.GetEnumDescription()
- }
- }
- };
- operationRep.Add(opDragAndDrop);
- operationRep.Add(workflowStateAggregator);
- operationRep.Add(workflowStateB2c);
- operationRep.Add(workflowStateC2b);
- operationRep.Add(workflowStateMoneyProvider);
- operationRep.Add(workflowStateSpecialAgent);
- operationRep.Add(workflowStateStandalone);
- operationRep.Add(workflowStateSubAgent);
- operationRep.Add(searchOperationReportAndAudit);
- //operationRep.Add(searchOperationReport);
- //operationRep.Add(searchOperation);
- operationRep.Add(csvImporter);
- operationRep.Add(pManUser);
- operationRep.Add(pManGroup);
- operationRep.Add(pManRole);
- //operationRep.Add(configImporter);
- #region Roles
- //PpsRole roleAccessSearch = new PpsRole() {
- // Id = ObjectId.Parse("56cc9cef9116904a748dcb0f"),
- // Description = "Role.Access1",
- // Name = "Access 1",
- // Operations = new List<PpsOperation>() {
- // //searchOperation.ToSerialize()
- // }
- //};
- PpsRole roleWorkflowAggr = new PpsRole() {
- Description = "Workflow - State Aggregator",
- Name = "State Aggregator",
- Operations = new List<PpsOperation>() {
- workflowStateAggregator.ToSerialize(),
- opDragAndDrop.ToSerialize()
- }
- };
- PpsRole roleWorkflowMoney = new PpsRole()
- {
- Description = "Workflow - State Money",
- Name = "State Money",
- Operations = new List<PpsOperation>() {
- workflowStateMoneyProvider.ToSerialize(),
- }
- };
- PpsRole roleWorkflowStand = new PpsRole()
- {
- Description = "Workflow - State Standalone",
- Name = "State Standalone",
- Operations = new List<PpsOperation>() {
- workflowStateStandalone.ToSerialize(),
- }
- };
- PpsRole roleWorkflowSub = new PpsRole()
- {
- Description = "Workflow - State Sub Agent",
- Name = "State Sub Agent",
- Operations = new List<PpsOperation>() {
- workflowStateSubAgent.ToSerialize(),
- }
- };
- PpsRole roleWorkflowB2c = new PpsRole()
- {
- Description = "Workflow - State B2c",
- Name = "State B2C",
- Operations = new List<PpsOperation>() {
- workflowStateB2c.ToSerialize(),
- }
- };
- PpsRole roleWorkflowC2b = new PpsRole()
- {
- Description = "Workflow - State C2b",
- Name = "State C2b",
- Operations = new List<PpsOperation>() {
- workflowStateC2b.ToSerialize(),
- }
- };
- PpsRole roleAccessSearch = new PpsRole()
- {
- Description = "Search",
- Name = "Search",
- Operations = new List<PpsOperation>() {
- searchOperationReportAndAudit.ToSerialize(),
- }
- };
- PpsRole RoleAgentRecycle = new PpsRole()
- {
- Description = "Agent Recycle",
- Name = "Agent Recycle ",
- Operations = new List<PpsOperation>() {
- csvImporter.ToSerialize()
- }
- };
- PpsRole roleAdmin = new PpsRole() {
- Id = ObjectId.Parse("56cc9cef9116904a748dcb11"),
- Description = "Administration Role",
- Name = "Admin",
- Operations = new List<PpsOperation>() {
- pManUser.ToSerialize(),
- pManGroup.ToSerialize(),
- pManRole.ToSerialize(),
- }
- };
- #endregion
- #region Groups
- //PpsGroup groupITBilling = new PpsGroup()
- //{
- // Name = "IT Billing",
- // Description = "Mcas IT Billing",
- // Client = _ClientDefault,
- // Roles = new List<PpsRole>() { }
- //};
- //PpsGroup groupMFinance = new PpsGroup()
- //{
- // Name = "Finance",
- // Description = "Mcas Finance",
- // Client = _ClientDefault,
- // Roles = new List<PpsRole>() { }
- //};
- PpsGroup groupAll = new PpsGroup() {
- Name = "Functionalities",
- Description = "Basic Macas Functionalities",
- Roles = new List<PpsRole>() { roleAccessSearch, roleWorkflowAggr, roleWorkflowB2c, roleWorkflowC2b, roleWorkflowMoney, roleWorkflowStand, roleWorkflowSub, RoleAgentRecycle },
- Client = _ClientDefault
- };
- //PpsGroup groupRiskManagement = new PpsGroup() {
- // Name = "Risk Management",
- // Description = "Risk Management",
- // Roles = new List<PpsRole>() { roleAccessSearch, roleAccessAggr, roleAccessB2c, roleAccessC2b, roleAccessMoney, roleAccessStand, roleAccessSub },
- // Client = _ClientDefault
- //};
- PpsGroup groupGod = new PpsGroup()
- {
- Id = ObjectId.Parse("56cc9dac91169017a88d0d95"),
- Name = "Admin",
- Description = "Administration Group",
- Roles = new List<PpsRole>() { roleAdmin },
- Client = _ClientDefault
- };
- #endregion
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "camille", "camille", SetUtils.defaultFemaleUserPicture, "antonio.silva@papersoft.pt", SetUtils.LangEnGB, _defaultPassword, true,false, "QA","", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "admin", "admin", SetUtils.defaultFemaleUserPicture, "eurico.batista@papersoft-dms.com", SetUtils.LangEnGB, "admin", true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupGod });
- //SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "bruno", "bruno", SetUtils.defaultFemaleUserPicture, "bruno.roda@papersoft.pt", SetUtils.LangEnGB, "bruno", true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupGod });
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "Epembi", "Epembi", SetUtils.defaultFemaleUserPicture, "elie.pembi@vodacom.cd", SetUtils.LangEnGB, _defaultPassword, true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "JMazenzo", "JMazenzo", SetUtils.defaultFemaleUserPicture, "JeandeDieu.Mazenzo@vodacom.cd", SetUtils.LangEnGB, _defaultPassword, true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "Sfwasa", "Sfwasa", SetUtils.defaultFemaleUserPicture, "Steve.Fwasa@vodacom.cd", SetUtils.LangEnGB, _defaultPassword, true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "FKazadi1", "FKazadi1", SetUtils.defaultFemaleUserPicture, "francis.KazadiMinga@vodacom.cd", SetUtils.LangEnGB, _defaultPassword, true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "Rbakonda", "Rbakonda", SetUtils.defaultFemaleUserPicture, "Roger.Bakonda@vodacom.cd", SetUtils.LangEnGB, _defaultPassword, true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "Jmabiala", "Jmabiala", SetUtils.defaultFemaleUserPicture, "Junior.Mabiala@vodacom.cd", SetUtils.LangEnGB, _defaultPassword, true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- for(int i = 0; i < 100; i++) {
- SetUtils.CreateNewUserCascade(ObjectId.GenerateNewId(), "user" + i, "user" + i, SetUtils.defaultFemaleUserPicture, "user"+i+"@papersoft.com", SetUtils.LangEnGB, _defaultPassword, true, false, "QA", "", SetUtils.EmptyBlacklisted, new List<PpsGroup> { groupAll });
- }
- WriteToConsole(string.Format("Total Users created: {0}", SupportShell.CreateNewUserRepository().Count()));
- WriteToConsole(string.Format("Total Groups created: {0}", SupportShell.CreateNewGroupRepository().Count()));
- WriteToConsole(string.Format("Total Operartions created: {0}", operationRep.Count()));
- GenerateSetReport();
- }
- private PpsOpWorkflowBillboard CreateWorkflowAction(Dictionary<LanguagesIdentifiers, string> pPresentationNames, string pFindByTemplateID, string pFindByState, List<PpsOperation> pChilds)
- {
- PpsOpWorkflowBillboard workflowBillboard = new PpsOpWorkflowBillboard();
- workflowBillboard.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/" + workflowBillboard.Id.ToString()
- };
- workflowBillboard.PapersoftAddress = pDestinationAddress;
- workflowBillboard.Environment = new List<PpsEnvironment>()
- {
- new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- }
- };
- workflowBillboard.Name = pPresentationNames;
- workflowBillboard.FecthOperation = true;
- workflowBillboard.Presentation.Add(PresentationZone.WebMain, new PpsPresentation()
- {
- Name = pPresentationNames,
- Appearance = PaperSoftKernelAPI.Entities.Enumerators.PresentationAppearance.Normal,
- Order = 0,
- IconCss = PpsWebIcons.System.GetEnumDescription(),
- Zone = PaperSoftKernelAPI.Entities.Enumerators.PresentationZone.WebMain,
- ValidateOnDisplay = false
- });
- workflowBillboard.Route = _routeBillboard;
- workflowBillboard.Retrieval = new PpsDocumentInference();
- PpsDocumentInferenceData inferenceByTemplate = new PpsDocumentInferenceData();
- inferenceByTemplate.Type = DocumentInferenceDataOperation.Equal;
- inferenceByTemplate.Value = new List<string>() { pFindByTemplateID };
- inferenceByTemplate.FieldId = (int)SearchableDocumentMetadata.TemplateId;
- var bstRetriveDocState = new BinaryTree<PpsDocumentInferenceNode>();
- PpsDocumentInferenceFunction rootDocState = new PpsDocumentInferenceFunction();
- rootDocState.Type = DocumentInferenceOperation.And;
- PpsDocumentInferenceData docState = new PpsDocumentInferenceData();
- docState.Type = DocumentInferenceDataOperation.Equal;
- docState.Value = new List<string>() { pFindByState };
- docState.FieldId = (int)SearchableDocumentMetadata.RdocStatus;
- bstRetriveDocState.Root = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = rootDocState,
- Left = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = docState
- },
- Right = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = inferenceByTemplate
- }
- };
- workflowBillboard.Retrieval.MetadataInclusion = bstRetriveDocState;
- workflowBillboard.Childs = pChilds;
- return workflowBillboard;
- }
- /// <summary>
- /// to don't group set pGroupByBatchField to 'na'
- /// </summary>
- /// <param name="pPresentationNames"></param>
- /// <param name="pSearchableStates"></param>
- /// <param name="pSearchableTemplates"></param>
- /// <param name="pRecordsPerPage"></param>
- /// <param name="pGroupByBatchField"></param>
- /// <param name="pChilds"></param>
- /// <returns></returns>
- private PpsOpTableSearch CreateTableSearchAction(
- Dictionary<LanguagesIdentifiers, string> pPresentationNames, Dictionary<int, string> pSearchableStates, Dictionary<short, string> pSearchableTemplates,
- int pRecordsPerPage, string pGroupByBatchField, string pStateToExcludeGrouping, List<PpsOperation> pChilds)
- {
- var searchOperation = PpsOpTableSearch.InitSearchList();
- searchOperation.Name = pPresentationNames;
- searchOperation.Route = _routeSearch;
- Dictionary<int, string> searchableStates = pSearchableStates;
- Dictionary<short, string> searchableTemplates = pSearchableTemplates;
- searchOperation.SearchableStates = searchableStates;
- searchOperation.SearchableTemplates = searchableTemplates;
- searchOperation.TablePresentation.RecordsPerPage = pRecordsPerPage;
- if (pGroupByBatchField != "na")
- {
- searchOperation.GroupBy = new List<string>() { GroupByClauses.ByBatch.GetEnumDescription() + "-" + pGroupByBatchField };
- searchOperation.BatchGroupExclusion = new BinaryTree<PpsDocumentInferenceNode>()
- {
- Root = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = new PpsDocumentInferenceFunction()
- {
- Type = DocumentInferenceOperation.And
- },
- Left = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = new PpsDocumentInferenceData()
- {
- Type = DocumentInferenceDataOperation.Equal,
- Value = new List<string>() { pStateToExcludeGrouping },
- FieldId = (int)SearchableDocumentMetadata.RdocStatus
- }
- }
- }
- };
- }
- searchOperation.Environment = new List<PpsEnvironment>() { new PpsEnvironment() {
- Type = PpsEnvironmentType.Web
- } };
- searchOperation.EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/" + searchOperation.Id.ToString()
- };
- searchOperation.PapersoftAddress = pDestinationAddress;
- searchOperation.Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- {
- PresentationZone.WebSidebar,
- new PpsPresentation()
- {
- Zone = PresentationZone.WebSidebar,
- Order = 1,
- Appearance = PresentationAppearance.Normal,
- Name = pPresentationNames,
- IconCss = PpsWebIcons.Search.GetEnumDescription()
- }
- }
- //{
- // PresentationZone.WebFirstBarRigth,
- // new PpsPresentation()
- // {
- // Zone = PresentationZone.WebFirstBarRigth,
- // Order = 1,
- // Appearance = PresentationAppearance.Normal,
- // Name = pPresentationNames,
- // IconCss = PpsWebIcons.Search.GetEnumDescription()
- // }
- //}
- };
- searchOperation.Childs = pChilds;
- return searchOperation;
- }
- private PpsOpViewDocument CreateViewAction(Dictionary<LanguagesIdentifiers, string> pPresentationNames, bool pShowBlob, bool pShowMetadata, bool pShowAuditTrail, List<string> pAcceptedStates, List<PpsOperation> pChilds)
- {
- var viewAction = new PpsOpViewDocument()
- {
- Name = pPresentationNames,
- Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- { PresentationZone.WebRowLineAction, new PpsPresentation()
- {
- Name = pPresentationNames,
- Appearance = PresentationAppearance.Normal,
- Order = 0,
- IconCss = "view",
- Zone = PresentationZone.WebRowLineAction,
- ValidateOnDisplay = false
- }
- }
- },
- EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd
- },
- PapersoftAddress = pDestinationAddress,
- Route = _routeView,
- Childs = pChilds,
- ShowAuditTrail = pShowAuditTrail,
- ShowImage = pShowBlob,
- ShowMetadata = pShowMetadata
- };
- if (pAcceptedStates != null && pAcceptedStates.Any())
- {
- viewAction.Validation = new PpsDocumentInference()
- {
- MetadataInclusion = new BinaryTree<PpsDocumentInferenceNode>()
- {
- Root = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = new PpsDocumentInferenceFunction()
- {
- Type = DocumentInferenceOperation.And
- },
- Left = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = new PpsDocumentInferenceData()
- {
- Type = DocumentInferenceDataOperation.In,
- Value = pAcceptedStates,
- FieldId = (int)SearchableDocumentMetadata.RdocStatus
- }
- }
- }
- }
- };
- }
- return viewAction;
- }
- private PpsOpAttachDocument CreateAttachAction(Dictionary<LanguagesIdentifiers, string> pPresentationNames, List<string> pAcceptedFileTypes, List<string> pAcceptedStates, string pFinalState)
- {
- var attachAction = new PpsOpAttachDocument()
- {
- Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- { PresentationZone.WebRowLineAction,
- new PpsPresentation() {
- Name = pPresentationNames,
- IconCss = EnumUtil.GetEnumDescription(PpsWebIcons.Attachmerge),
- Zone = PresentationZone.WebRowLineAction
- }
- }
- },
- EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/AttachDocument"
- },
- PapersoftAddress = pDestinationAddress,
- AcceptedFileTypes = pAcceptedFileTypes,
- MaxFiles = 1,
- //MaxFileSize = 5,
- Route = _routeAttach,
- Transformation = new BinaryTree<PpsDocumentInferenceNode>()
- {
- Root = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = new PpsDocumentInferenceData()
- {
- Value = new List<string>() { pFinalState },
- FieldId = (int)SearchableDocumentMetadata.RdocStatus
- }
- }
- },
- Validation = new PpsDocumentInference()
- {
- MetadataInclusion = new BinaryTree<PpsDocumentInferenceNode>()
- {
- Root = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = new PpsDocumentInferenceFunction()
- {
- Type = DocumentInferenceOperation.And
- },
- Left = new BinaryTreeNode<PpsDocumentInferenceNode>()
- {
- Value = new PpsDocumentInferenceData()
- {
- Type = DocumentInferenceDataOperation.In,
- Value = pAcceptedStates,
- FieldId = (int)SearchableDocumentMetadata.RdocStatus
- }
- }
- }
- }
- }
- };
- return attachAction;
- }
- private PpsOpDownloadDocument CreateDownloadAction(Dictionary<LanguagesIdentifiers, string> pPresentationNames)
- {
- var download = new PpsOpDownloadDocument()
- {
- Name = pPresentationNames,
- Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- { PresentationZone.WebViewBarRigth,
- new PpsPresentation() {
- Zone = PresentationZone.WebViewBarRigth,
- Name = pPresentationNames,
- IconCss = PpsWebIcons.Download.GetEnumDescription()
- }
- }
- },
- Route = _routeDownload,
- EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/DownloadDocument"
- },
- PapersoftAddress = pDestinationAddress
- };
- return download;
- }
- private PpsOpReportDocument CreateReportAction(Dictionary<LanguagesIdentifiers, string> pPresentationNames, string pFilename, string pSeparator, string pExtension, List<int> pFieldsToPresent)
- {
- var report = new PpsOpReportDocument()
- {
- Presentation = new Dictionary<PresentationZone, PpsPresentation>() {
- { PresentationZone.WebSecBarRigth,
- new PpsPresentation() {
- Name = pPresentationNames,
- IconCss = EnumUtil.GetEnumDescription(PpsWebIcons.Process),
- Zone = PresentationZone.WebSecBarRigth
- }
- }
- },
- Route = _routeReport,
- PapersoftAddress = pDestinationAddress,
- EndPoint = new PpsEndPoint()
- {
- Url = BaseEnd + "/User/Operations/ReportDocument"
- },
- FileName = pFilename,
- Seperator = pSeparator,
- Extension = pExtension,
- FieldsToPresent = pFieldsToPresent
- };
- return report;
- }
- protected override void InvalidSet(string pPrefix)
- {
- return;
- }
- public override string ToString()
- {
- return string.Empty;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement