GetDatasetLatestIds() public method

Returns the list of identifiers of all the matching datasets. If includeCheckouts is false, just the datasets having the latest version checked-in are included , otherwise the datasets with versions either checked-in or checked-out will be included.
public GetDatasetLatestIds ( bool includeCheckouts = false ) : List
includeCheckouts bool Determines whether the checked out versions should be included in the result.
return List
Ejemplo n.º 1
0
        /// <summary>
        /// Show all Datasetids with export functions
        /// </summary>
        /// <returns></returns>
        // GET: api/Export
        public IEnumerable<long> Get()
        {
            DatasetManager dm = new DatasetManager();
            var datasetIds = dm.GetDatasetLatestIds();

            return datasetIds;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>        
        public void Index()
        {
            configureBexisIndexing(true);
            // there is no need for the metadataAccess class anymore. Talked with David and deleted. 30.18.13. Javad/ compare to the previous version to see the deletions
            DatasetManager dm = new DatasetManager();
            IList<long> ids = dm.GetDatasetLatestIds();

            //ToDo only enitities from type dataset should be indexed in this index

            foreach (var id in ids)
            {
                //the values in the dictionary are already xml documents or null. Javad
                writeBexisIndex(id, dm.GetDatasetLatestMetadataVersion(id));

            }

            indexWriter.Optimize();
            autoCompleteIndexWriter.Optimize();

            if (!reIndex)
            {
                indexWriter.Dispose();
                autoCompleteIndexWriter.Dispose();
            }
        }
Ejemplo n.º 3
0
        // GET: api/Metadata
        public IEnumerable<MetadataViewObject> Get()
        {
            DatasetManager dm = new DatasetManager();
            var datasetIds = dm.GetDatasetLatestIds();

            List<MetadataViewObject> tmp = new List<MetadataViewObject>();

            foreach (var id in datasetIds)
            {
                MetadataViewObject mvo = new MetadataViewObject();
                mvo.DatasetId = id;

                List<string> t = XmlDatasetHelper.GetAllTransmissionInformation(id, TransmissionType.mappingFileExport, AttributeNames.name).ToList();

                mvo.Format = t.ToArray();

                tmp.Add(mvo);
            }

            return tmp;
        }
Ejemplo n.º 4
0
        public ActionResult _CustomMyDatasetBinding()
        {
            DataTable model = new DataTable();

            ViewData["PageSize"] = 10;
            ViewData["CurrentPage"] = 1;

            #region header
            List<HeaderItem> headerItems = new List<HeaderItem>();

            HeaderItem headerItem = new HeaderItem()
            {
                Name = "ID",
                DisplayName = "ID",
                DataType = "Int64"
            };
            headerItems.Add(headerItem);

            ViewData["Id"] = headerItem;

            headerItem = new HeaderItem()
            {
                Name = "Title",
                DisplayName = "Title",
                DataType = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name = "Description",
                DisplayName = "Description",
                DataType = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name = "View",
                DisplayName = "View",
                DataType = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name = "Update",
                DisplayName = "Update",
                DataType = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name = "Delete",
                DisplayName = "Delete",
                DataType = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name = "Download",
                DisplayName = "Download",
                DataType = "String"
            };
            headerItems.Add(headerItem);

            headerItem = new HeaderItem()
            {
                Name = "Grant",
                DisplayName = "Grant",
                DataType = "String"
            };
            headerItems.Add(headerItem);

            ViewData["DefaultHeaderList"] = headerItems;

            #endregion

            model = CreateDataTable(headerItems);

            DatasetManager datasetManager = new DatasetManager();
            PermissionManager permissionManager = new PermissionManager();
            SubjectManager subjectManager = new SubjectManager();

            List<long> gridCommands = datasetManager.GetDatasetLatestIds();
            gridCommands.Skip(Convert.ToInt16(ViewData["CurrentPage"])).Take(Convert.ToInt16(ViewData["PageSize"]));

            foreach (long datasetId in gridCommands)
            {
                //get permissions
                List<int> rights = permissionManager.GetAllRights(subjectManager.GetUserByName(GetUsernameOrDefault()).Id, 1, datasetId).ToList();

                if (rights.Count > 0)
                {
                    DataRow dataRow = model.NewRow();
                    Object[] rowArray = new Object[8];

                    if (datasetManager.IsDatasetCheckedIn(datasetId))
                    {
                        DatasetVersion dsv = datasetManager.GetDatasetLatestVersion(datasetId);

                        MetadataStructureManager msm = new MetadataStructureManager();
                        dsv.Dataset.MetadataStructure = msm.Repo.Get(dsv.Dataset.MetadataStructure.Id);

                        string title = XmlDatasetHelper.GetInformation(dsv, NameAttributeValues.title);
                        string description = XmlDatasetHelper.GetInformation(dsv, NameAttributeValues.description);

                        rowArray[0] = Convert.ToInt64(datasetId);
                        rowArray[1] = title;
                        rowArray[2] = description;
                    }
                    else
                    {
                        rowArray[0] = Convert.ToInt64(datasetId);
                        rowArray[1] = "";
                        rowArray[2] = "Dataset is just in processing.";
                    }

                    if (rights.Contains(1))
                    {
                        rowArray[3] = "✔";
                    }
                    else
                    {
                        rowArray[3] = "✘";
                    }
                    if (rights.Contains(2))
                    {
                        rowArray[4] = "✔";
                    }
                    else
                    {
                        rowArray[4] = "✘";
                    }
                    if (rights.Contains(3))
                    {
                        rowArray[5] = "✔";
                    }
                    else
                    {
                        rowArray[5] = "✘";
                    }
                    if (rights.Contains(4))
                    {
                        rowArray[6] = "✔";
                    }
                    else
                    {
                        rowArray[6] = "✘";
                    }
                    if (rights.Contains(5))
                    {
                        rowArray[7] = "✔";
                    }
                    else
                    {
                        rowArray[7] = "✘";
                    }

                    dataRow = model.NewRow();
                    dataRow.ItemArray = rowArray;
                    model.Rows.Add(dataRow);
                }
            }

            return View(new GridModel(model));
        }