Пример #1
0
        /// <summary>
        /// Gets the mappings for the specified entity and worksheet
        /// </summary>
        /// <returns></returns>
        public Message GetEntityMappings()
        {
            Message         responseMsg   = null;
            ImportUtilities importUtility = new ImportUtilities();
            SPDataAccess    spDataAccess  = new SPDataAccess();
            MappedColumns   mappedColumns = new MappedColumns();

            WorksheetUtilities worksheetUtilities = new WorksheetUtilities(spDataAccess);

            MappingData mappingData = this.ValidateRequest(spDataAccess, false);

            // get the columns from the supplied worksheet
            mappedColumns.WSColumns = worksheetUtilities.GetWorksheetColumns(mappingData);

            // checks to see if the columns pulled from sheet map to
            // a predefined template e.g. Bulk Import or Goals Export
            mappedColumns.TemplateType = ImportUtilities.GetImportTemplateType(mappedColumns.WSColumns);

            // get the entity columns with the default values for choice columns
            mappedColumns.ColumnDefinitions = importUtility.GetEntityColumnDefaultValues(spDataAccess, mappingData.ListName);

            responseMsg = ctx.CreateJsonResponse <MappedColumns>(mappedColumns);

            return(responseMsg);
        }
Пример #2
0
        /// <summary>
        /// Get the column definitions for the specified list
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        public Message GetItemColumnDefinitions(string listName)
        {
            Message                 responseMsg   = null;
            ImportUtilities         importUtility = new ImportUtilities();
            SPDataAccess            spDataAccess  = new SPDataAccess();
            List <ColumnDefinition> fields        = importUtility.GetEntityColumnDefaultValues(spDataAccess, listName);

            responseMsg = ctx.CreateJsonResponse <List <ColumnDefinition> >(fields);

            return(responseMsg);
        }