Exemplo n.º 1
0
        private void NotifyEditing(IEngine engine, HttpContextWrapper context)
        {
            var selection = new SelectionUtility(context, engine);
            if (Convert.ToBoolean(context.Request["changes"]))
                engine.AddActivity(new ManagementActivity { Operation = "Edit", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path });

            var activities = ManagementActivity.GetActivity(engine, selection.SelectedItem);
            context.Response.ContentType = "application/json";
            context.Response.Write(ManagementActivity.ToJson(activities));
        }
Exemplo n.º 2
0
        private void NotifyViewing(IEngine engine, HttpContextWrapper context)
        {
            var selection = new SelectionUtility(context, engine);

            if (selection.SelectedItem != null)
            {
                engine.AddActivity(new ManagementActivity {
                    Operation = "View", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path
                });
            }
        }
Exemplo n.º 3
0
        private void NotifyEditing(IEngine engine, HttpContextWrapper context)
        {
            var selection = new SelectionUtility(context, engine);
            if (Convert.ToBoolean(context.Request["changes"]))
                engine.AddActivity(new ManagementActivity { Operation = "Edit", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path });

            var activities = ManagementActivity.GetActivity(engine, selection.SelectedItem);
			var messages = engine.Resolve<N2.Edit.Collaboration.ManagementMessageCollector>()
				.GetMessages(CollaborationContext.Create(engine.Resolve<IProfileRepository>(), selection.SelectedItem, context))
				.ToList();
            context.Response.ContentType = "application/json";
			context.Response.Write(ManagementActivity.ToJson(activities, messages));
        }
Exemplo n.º 4
0
        private void NotifyViewing(IEngine engine, HttpContextWrapper context)
        {
            var selection = new SelectionUtility(context, engine);
            if (selection.SelectedItem != null)
                engine.AddActivity(new ManagementActivity { Operation = "View", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path });

			context.Response.WriteJson(new
			{
				Messages = engine.Resolve<ManagementMessageCollector>()
				.GetMessages(CollaborationContext.Create(engine.Resolve<IProfileRepository>(), selection.SelectedItem, context))
					.ToList()
			});
        }
Exemplo n.º 5
0
        private void NotifyEditing(IEngine engine, HttpContextWrapper context)
        {
            var selection = new SelectionUtility(context, engine);

            if (Convert.ToBoolean(context.Request["changes"]))
            {
                engine.AddActivity(new ManagementActivity {
                    Operation = "Edit", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path
                });
            }

            var activities = ManagementActivity.GetActivity(engine, selection.SelectedItem);

            context.Response.ContentType = "application/json";
            context.Response.Write(ManagementActivity.ToJson(activities));
        }
Exemplo n.º 6
0
        private void NotifyViewing(IEngine engine, HttpContextWrapper context)
        {
            var selection = new SelectionUtility(context, engine);

            if (selection.SelectedItem != null)
            {
                engine.AddActivity(new ManagementActivity {
                    Operation = "View", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path
                });
            }

            context.Response.WriteJson(new
            {
                Messages = engine.Resolve <ManagementMessageCollector>()
                           .GetMessages(CollaborationContext.Create(engine.Resolve <IProfileRepository>(), selection.SelectedItem, context))
                           .ToList()
            });
        }
Exemplo n.º 7
0
        private void NotifyEditing(IEngine engine, HttpContextWrapper context)
        {
            var selection = new SelectionUtility(context, engine);

            if (Convert.ToBoolean(context.Request["changes"]))
            {
                engine.AddActivity(new ManagementActivity {
                    Operation = "Edit", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path
                });
            }

            var activities = ManagementActivity.GetActivity(engine, selection.SelectedItem);
            var messages   = engine.Resolve <N2.Edit.Collaboration.ManagementMessageCollector>()
                             .GetMessages(CollaborationContext.Create(engine.Resolve <IProfileRepository>(), selection.SelectedItem, context))
                             .ToList();

            context.Response.ContentType = "application/json";
            context.Response.Write(ManagementActivity.ToJson(activities, messages));
        }
Exemplo n.º 8
0
 private void NotifyViewing(IEngine engine, HttpContextWrapper context)
 {
     var selection = new SelectionUtility(context, engine);
     if (selection.SelectedItem != null)
         engine.AddActivity(new ManagementActivity { Operation = "View", PerformedBy = context.User.Identity.Name, ID = selection.SelectedItem.ID, Path = selection.SelectedItem.Path });
 }