Beispiel #1
0
 /// <summary>
 /// jstreedata
 /// </summary>
 /// <param name="inbox"></param>
 /// <param name="initalState"></param>
 public JSTreeData(SlimEntity inbox, State initalState = State.leaf)
 {
     data = inbox.Name;
     attr = new JSTreeAttr()
     {
         Id = "jstree-" + inbox.Id.ToString(), Title = inbox.Name
     };
     state    = initalState.ToString();
     metadata = new
     {
         EffectivePermissions = inbox.EffectivePermissions,
     };
     children = new JSTreeData[0];
 }
Beispiel #2
0
        private void LoadData()
        {
            var importData = _bulkData.GetImportData();

            if (!ErrorHandler(businessException: importData.Error))
            {
                Message = Constants.i18n("noContentTypesAvailable");
                return;
            }

            ClientServiceUri = importData.Result.ClientServiceURI;
            NavigatorPlugin  = importData.Result.NavigatorPluginURI;
            ContentTypes     = importData.Result.ContentTypes;

            if (ContentTypes == null)
            {
                ContentTypes = new ContentType[0];
            }

            if (ContentTypes.Length == 0)
            {
                Message = Constants.i18n("noContentTypesAvailable");
            }

            var ctibx = ContentTypes.Where(r => r.DefaultInboxId.HasValue).ToDictionary(k => k.Id.ToString(), v => v.DefaultInboxId.Value.ToString());
            var ctwf  = ContentTypes.Where(r => r.DefaultWorkflowId.HasValue).ToDictionary(k => k.Id.ToString(), v => v.DefaultWorkflowId.Value.ToString());

            ContentTypeDefInboxes   = JsonConvert.SerializeObject(ctibx);
            ContentTypeDefWorkflows = JsonConvert.SerializeObject(ctwf);

            SecurityClasses = importData.Result.SecurityClasses;

            var length = importData.Result.Inboxes.Length + 1;

            Inboxes = new SlimEntity[length];
            for (int i = 1; i < length; i++)
            {
                Inboxes[i] = importData.Result.Inboxes[i - 1];
            }
            Inboxes[0] = new SlimEntity(Guid.Empty, " ", PermissionType.Full);

            length    = importData.Result.Workflows.Length + 1;
            Workflows = new SlimEntity[length];
            for (int i = 1; i < length; i++)
            {
                Workflows[i] = importData.Result.Workflows[i - 1];
            }
            Workflows[0] = new SlimEntity(Guid.Empty, " ", PermissionType.Full);
        }
Beispiel #3
0
        /// <summary>
        /// convert given object to jstree format
        /// </summary>
        /// <param name="inbox"></param>
        /// <returns></returns>
        public static JSTreeData ConvertToJSTreeFormat(SlimEntity inbox)
        {
            var result = new JSTreeData(inbox);

            return(result);
        }