Ejemplo n.º 1
0
        public void CreateFlatFileExtractTemplate(
            [Parameter("The name to give to the template")]
            string templateName,
            [Parameter("Whether to include dynamic accounts",
                       DefaultValue = false)]
            bool includeDynamicAccounts,
            [Parameter("Whether to include calculated data",
                       DefaultValue = true)]
            bool includeCalculatedData,
            [Parameter("Whether to include derived data",
                       DefaultValue = true)]
            bool includeDerivedData,
#if LATE_BIND || HFM_11_1_2_2
            [Parameter("Level of detail to be extracted for line item detail accounts",
                       DefaultValue = ELineItems.Summary, Since = "11.1.2.2")]
            ELineItems lineItems,
#endif
            [Parameter("The field delimiter to use",
                       DefaultValue = ";")]
            string delimiter,
            ExtractSpecification slice)
        {
            // TODO: Complete this
            StringBuilder sb = new StringBuilder();

            sb.Append("<povTemplate><povEA>");
            sb.Append(slice);
            sb.Append("</povEA><options><tablePrefix>");
            //sb.Append(spec.TablePrefix);
            sb.Append("</tablePrefix><exportOption>");
            //sb.Append((int)spec.ExtractType);
            sb.Append("</exportOption><selectedDSN>");
            //sb.Append(spec.DataSource);
            sb.Append("</selectedDSN><excludeDynAccts>");
            sb.Append(includeDynamicAccounts ? 0 : -1);
            sb.Append("</excludeDynAccts></options></povTemplate>");

            HFM.Try("Creating star schema template {0}", templateName,
                    () => HsvStarSchemaTemplates.SetTemplate(templateName, sb.ToString(), true));
        }
Ejemplo n.º 2
0
        public void ExtractDataToFlatFile(
            [Parameter("The path to the extract file to be created")]
            string extractFile,
            [Parameter("Include file header containing extract details",
                       DefaultValue = false)]
            bool includeHeader,
            [Parameter("Flag specifying whether extract file should be decompressed; " +
                       "extracts are generated in GZip (.gz) format, so compressed files " +
                       "are faster to create and smaller in size",
                       DefaultValue = true)]
            bool decompress,
            [Parameter("Whether to include data",
                       DefaultValue = true, Since = "11.1.2.2.300")]
            bool includeData,
            [Parameter("Whether to include dynamic accounts",
                       DefaultValue = false)]
            bool includeDynamicAccounts,
            [Parameter("Whether to include calculated data",
                       DefaultValue = true)]
            bool includeCalculatedData,
            [Parameter("Whether to include derived data",
                       DefaultValue = true)]
            bool includeDerivedData,
#if LATE_BIND || HFM_11_1_2_2
            [Parameter("Level of detail to be extracted for line item detail accounts",
                       DefaultValue = ELineItems.Summary, Since = "11.1.2.2")]
            ELineItems lineItems,
#endif
            [Parameter("The field delimiter to use",
                       DefaultValue = ";")]
            string delimiter,
            [Parameter("The path to where the EA extract log file should be generated; " +
                       "if omitted, no log file is created.", DefaultValue = null)]
            string logFile,
            ExtractSpecification slice,
            IOutput output,
            Client client)
        {
            int taskId = DoEAExtract("", "EA_FILE", (SS_PUSH_OPTIONS)EPushType.Create,
                                     (EA_EXTRACT_TYPE_FLAGS)(includeHeader ? EFileExtractType.FlatFile :
                                                             EFileExtractType.FlatFileNoHeader),
                                     includeData, includeDynamicAccounts, includeCalculatedData, includeDerivedData,
                                     false, false,
#if LATE_BIND || HFM_11_1_2_2
                                     (EA_LINEITEM_OPTIONS)lineItems,
#endif
                                     delimiter, logFile, slice,
                                     output);

            // Get the path to the extract file
            string path = null;

            HFM.Try("Retrieving extract file path",
                    () => Session.SystemInfo.HsvSystemInfo.GetRunningTaskLogFilePathName(taskId, out path));
            _log.DebugFormat("Path: {0}", path);

            // Returns a string containing 3 parts, separated by semi-colons:
            // - the root directory where Oracle middleware is installed
            // - the path relative to that root where the log file is located
            // - the path relative to that root where the data file is located
            var parts      = path.Split(';');
            var serverFile = Path.Combine(parts[0], parts[2]);

            // Download the extract file
            var ft = Session.Server.FileTransfer;

            ft.RetrieveFile(Session, serverFile, extractFile, decompress, output);
        }