Ejemplo n.º 1
0
 /// <summary>
 /// Instantiates the content transformator
 /// </summary>
 /// <param name="page">Client side page that will be updates</param>
 /// <param name="pageTransformation">Transformation information</param>
 public ContentTransformator(ClientSidePage page, PageTransformation pageTransformation)
 {
     this.page = page ?? throw new ArgumentException("Page cannot be null");
     this.pageTransformation = pageTransformation ?? throw new ArgumentException("pageTransformation cannot be null");
     this.functionProcessor  = new FunctionProcessor(this.page, this.pageTransformation);
     this.siteTokens         = CreateSiteTokenList(page.Context);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Instantiates the content transformator
 /// </summary>
 /// <param name="page">Client side page that will be updates</param>
 /// <param name="pageTransformation">Transformation information</param>
 public ContentTransformator(ClientContext sourceClientContext, ClientSidePage page, PageTransformation pageTransformation, Dictionary <string, string> mappingProperties)
 {
     this.page = page ?? throw new ArgumentException("Page cannot be null");
     this.pageTransformation  = pageTransformation ?? throw new ArgumentException("pageTransformation cannot be null");
     this.globalTokens        = CreateGlobalTokenList(page.Context, mappingProperties);
     this.functionProcessor   = new FunctionProcessor(sourceClientContext, this.page, this.pageTransformation);
     this.sourceClientContext = sourceClientContext;
     this.isCrossSiteTransfer = IsCrossSiteTransfer();
 }
Ejemplo n.º 3
0
        private static void BuildDocumentation(string content, List <string> matches)
        {
            ICollection <PgFunction> functions = FunctionProcessor.GetFunctions(Program.SchemaPattern, Program.xSchemaPattern);

            content = content.Replace("[DBName]", Program.Database.ToUpperInvariant());

            content = Parsers.FunctionParser.Parse(content, matches, functions);

            FileHelper.WriteFile(content, OutputPath);
            SequencesRunner.Run();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Main constructor for the mapping provider
 /// </summary>
 /// <param name="logger">Logger for tracing activities</param>
 /// <param name="spOptions">Configuration options</param>
 /// <param name="functionProcessor">The SharePoint Function processor</param>
 /// <param name="serviceProvider">Service provider</param>
 public SharePointWebPartMappingProvider(ILogger <SharePointWebPartMappingProvider> logger,
                                         IOptions <SharePointTransformationOptions> spOptions,
                                         FunctionProcessor functionProcessor,
                                         IServiceProvider serviceProvider)
 {
     this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     this.spOptions         = spOptions ?? throw new ArgumentNullException(nameof(spOptions));
     this.functionProcessor = functionProcessor ?? throw new ArgumentNullException(nameof(functionProcessor));
     this.serviceProvider   = serviceProvider;
     this.memoryCache       = this.serviceProvider.GetService <IMemoryCache>();
 }
        /// <summary>
        /// Instantiates the content transformator
        /// </summary>
        /// <param name="page">Client side page that will be updates</param>
        /// <param name="pageTransformation">Transformation information</param>
        public ContentTransformator(ClientContext sourceClientContext, ClientSidePage page, PageTransformation pageTransformation, BaseTransformationInformation transformationInformation, IList <ILogObserver> logObservers = null) : base()
        {
            //Register any existing observers
            if (logObservers != null)
            {
                foreach (var observer in logObservers)
                {
                    base.RegisterObserver(observer);
                }
            }

            this.page = page ?? throw new ArgumentException("Page cannot be null");
            this.pageTransformation = pageTransformation ?? throw new ArgumentException("pageTransformation cannot be null");
            this.globalTokens       = CreateGlobalTokenList(page.Context, transformationInformation.MappingProperties);
            this.functionProcessor  = new FunctionProcessor(sourceClientContext, this.page, this.pageTransformation, transformationInformation, base.RegisteredLogObservers);

            this.sourceClientContext = sourceClientContext;
            this.isCrossSiteTransfer = IsCrossSiteTransfer();
        }