public HasCommentsHandler(
            IContentManager contentManager,
            IRepository<HasCommentsRecord> hasCommentsRepository,
            ICommentService commentService) {

            Filters.Add(StorageFilter.For(hasCommentsRepository));

            OnActivated<HasComments>((ctx, x) => {
                x.CommentsActive = true;
                x.CommentsShown = true;
            });

            OnLoading<HasComments>((context, comments) => {
                comments._comments.Loader(list => contentManager
                    .Query<Comment, CommentRecord>()
                    .Where(x => x.CommentedOn == context.ContentItem.Id && x.Status == CommentStatus.Approved)
                    .List().ToList());

                comments._pendingComments.Loader(list => contentManager
                    .Query<Comment, CommentRecord>()
                    .Where(x => x.CommentedOn == context.ContentItem.Id && x.Status == CommentStatus.Pending)
                    .List().ToList());
            });

            OnRemoved<HasComments>(
                (context, c) => {
                    foreach (var comment in commentService.GetCommentsForCommentedContent(context.ContentItem.Id)) {
                        contentManager.Remove(comment.ContentItem);
                    }
                });
        }
 public ChatApiController(IUserService service, IChatService service2, ICommentService service3, ILiveChat service4)
 {
     this._userService = service;
     this._chatService = service2;
     this._commentService = service3;
     this._LiveChat = service4;
 }
示例#3
0
 public EntryController(IEntryService entryService, ICommentService commentService, IBlogService blogService, ITagService tagService)
 {
     _entryService = entryService;
     _commentService = commentService;
     _blogService = blogService;
     _tagService = tagService;
 }
示例#4
0
 public PostController(IPostService service, ITagService ts, ICommentService commentService, IUserService us)
 {
     this.postService = service;
     this.tagService = ts;
     this.userService = us;
     this.commentService = commentService;
 }
示例#5
0
 public PostAppService(IPostService postService, ICommentService commentService, ICategoryService categoryService, IPostValidation postValidation)
 {
     this.postService = postService;
     this.commentService = commentService;
     this.categoryService = categoryService;
     this.postValidation = postValidation;
 }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            eventId = Convert.ToInt64(Request.Params.Get("eventId"));
            commentId = Convert.ToInt64(Request.Params.Get("commentId"));

            IUnityContainer container = (IUnityContainer)HttpContext.Current.Application["unityContainer"];
            commentService = container.Resolve<ICommentService>();

            if (!IsPostBack)
            {
                CommentInfo c = commentService.GetCommentById(commentId);
                List<Tag> tags = commentService.GetTagsByCommentId(commentId);

                string stags = ParseTags(tags);

                this.txtComment.Text = c.texto;
                this.txtTags.Text = stags;

            }
            if (!SessionManager.IsUserAuthenticated(Context))
            {
                /* Do action. */
                String url =
                    Settings.Default.PracticaMaD_applicationURL +
                                    "Pages/User/Authentication.aspx" + "?eventId=" + eventId;

                Response.Redirect(Response.ApplyAppPathModifier(url));
            }
            else
            {
                userId = SessionManager.GetUserSession(Context).UserProfileId;
            }
        }
 public BlogImportRepository(ISubtextContext context, ICommentService commentService, IEntryPublisher entryPublisher, IBlogMLImportMapper mapper)
 {
     SubtextContext = context;
     CommentService = commentService;
     EntryPublisher = entryPublisher;
     Mapper = mapper;
 }
示例#8
0
 public PostAppService()
 {
     this.postValidation = ValidationFactory.GetPostValidation();
     this.postService = ServiceFactory.GetPostService(RepositoryFactory.GetPostRepository(), this.postValidation);
     this.commentService = ServiceFactory.GetCommentService(RepositoryFactory.GetCommentRepository(), null);
     this.categoryService = ServiceFactory.GetCategoryService(RepositoryFactory.GetCategoryRepository(), null);
 }        
示例#9
0
 public ArticleController(IBlogService blogService, IArticleService articleService, ITagService tagService, ICommentService commentService)
 {
     _blogService = blogService;
     _articleService = articleService;
     _tagService = tagService;
     _commentService = commentService;
 }
        public CommentPartHandler(
            IRepository<CommentPartRecord> commentsRepository,
            IContentManager contentManager,
            ICommentService commentService
            ) {

            Filters.Add(StorageFilter.For(commentsRepository));

            OnLoading<CommentPart>((context, comment) => {
                comment.CommentedOnContentItemField.Loader(
                    item => contentManager.Get(comment.CommentedOn)
                );

                comment.CommentedOnContentItemMetadataField.Loader(
                    item => contentManager.GetItemMetadata(comment.CommentedOnContentItem)
                );
            });

            OnRemoving<CommentPart>((context, comment) => {
                foreach(var response in contentManager.Query<CommentPart, CommentPartRecord>().Where(x => x.RepliedOn == comment.Id).List()) {
                    contentManager.Remove(response.ContentItem);
                }
            });

            // keep CommentsPart.Count in sync
            OnPublished<CommentPart>((context, part) => commentService.ProcessCommentsCount(part.CommentedOn));
            OnUnpublished<CommentPart>((context, part) => commentService.ProcessCommentsCount(part.CommentedOn));
            OnVersioned<CommentPart>((context, part, newVersionPart) => commentService.ProcessCommentsCount(newVersionPart.CommentedOn));
            OnRemoved<CommentPart>((context, part) => commentService.ProcessCommentsCount(part.CommentedOn));

            OnIndexing<CommentPart>((context, commentPart) => context.DocumentIndex
                                                                .Add("commentText", commentPart.Record.CommentText));
        }
示例#11
0
 public CommentTokens(
     IContentManager contentManager,
     ICommentService commentService) {
     _contentManager = contentManager;
     _commentService = commentService;
     T = NullLocalizer.Instance;
 }
        public CommentsPartHandler(
            IContentManager contentManager,
            IRepository<CommentsPartRecord> commentsRepository,
            ICommentService commentService) {

            Filters.Add(StorageFilter.For(commentsRepository));

            OnInitializing<CommentsPart>((ctx, part) => {
                part.CommentsActive = true;
                part.CommentsShown = true;
                part.Comments = new List<CommentPart>();
            });

            OnLoading<CommentsPart>((context, comments) => {
                comments.CommentsField.Loader(list => contentManager
                    .Query<CommentPart, CommentPartRecord>()
                    .Where(x => x.CommentsPartRecord == context.ContentItem.As<CommentsPart>().Record && x.Status == CommentStatus.Approved)
                    .OrderBy(x => x.Position)
                    .List().ToList());

                comments.PendingCommentsField.Loader(list => contentManager
                    .Query<CommentPart, CommentPartRecord>()
                    .Where(x => x.CommentsPartRecord == context.ContentItem.As<CommentsPart>().Record && x.Status == CommentStatus.Pending)
                    .List().ToList());
            });

            OnRemoved<CommentsPart>(
                (context, c) => {
                    var comments = commentService.GetCommentsForCommentedContent(context.ContentItem.Id).List();
                    foreach (var comment in comments) {
                        contentManager.Remove(comment.ContentItem);
                    }
                });
        }
 public CommentsController(IUsersService users, ICommentService comments, IHomeService homes, INeedService needs)
     : base(users)
 {
     this.comments = comments;
     this.homes = homes;
     this.needs = needs;
 }
 public CommentController(IOrchardServices services, ICommentService commentService, INotifier notifier)
 {
     Services = services;
     _commentService = commentService;
     _notifier = notifier;
     T = NullLocalizer.Instance;
 }
示例#15
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="log"></param>
        /// <param name="localizationService"></param>
        /// <param name="siteService"></param>
        /// <param name="userService"></param>
        /// <param name="contentItemService"></param>
        /// <param name="contentItemServiceForPage"></param>
        /// <param name="commentService"></param>
        /// <param name="categoryService"></param>
        /// <param name="tagService"></param>
        /// <param name="searchService"></param>
        /// <param name="widgetService"></param>
        /// <param name="messageService"></param>
        protected ContentControllerBase( ILog log, 
                                       ILocalizationService localizationService,
                                       ISiteService siteService,
                                       IUserService userService,
                                       IContentItemService<Post> contentItemService,
                                       IContentItemService<Page> contentItemServiceForPage,
                                       ICommentService commentService,
                                       ICategoryService categoryService,
                                       ITagService tagService,
                                       ISearchService searchService,
                                       IWidgetService widgetService,
                                       IMessageService messageService)
        {
            this.log = log;
             this.localizationService = IoC.Resolve<ILocalizationService>();
             this.userService = IoC.Resolve<IUserService>();
             this.siteService = IoC.Resolve<ISiteService>();
             this.categoryService = IoC.Resolve<ICategoryService>();
             this.tagService = IoC.Resolve<ITagService>();
             this.contentItemService = contentItemService;
             this.contentItemServiceForPage = contentItemServiceForPage;
             this.commentService = commentService;
             this.searchService = searchService;
             this.widgetService = widgetService;
             this.messageService = messageService;

             registeredWidgetComponents = new List<IWidgetComponent>();

             currentCulture = Thread.CurrentThread.CurrentUICulture;
        }
        static ProductDetails() {
            IUnityContainer container =
             (IUnityContainer)HttpContext.Current.Application["unityContainer"];

            productService   = container.Resolve<IProductService>();
            commentService = container.Resolve<ICommentService>();
        }
 public CommentController(ICommentMapper commentMapper, IImageAlbumService imageAlbumService, ICommentService commentService, IMembershipService membershipService)
 {
     this._commentMapper = commentMapper;
     this._imageAlbumService = imageAlbumService;
     this._commentService = commentService;
     this._membershipService = membershipService;
 }
示例#18
0
 public AdminCommentController(ILog log, IContentItemService<Post> contentItemService, ICommentService commentService, ILocalizationService localizationService, IUserService userService, ISiteService siteService)
     : base(log, localizationService, userService, siteService)
 {
     this.log = log;
      this.commentService = commentService;
      this.contentItemService = contentItemService;
 }
示例#19
0
 public CommentsController(ICommentService comments, IAnimalService animals, IUserService users, ISanitizer sanitizeService)
 {
     this.comments = comments;
     this.animals = animals;
     this.users = users;
     this.sanitizeService = sanitizeService;
 }
示例#20
0
 public PostController(DbContext dbContext, IPostService postService, ICommentService commentService, IPagingHandler<Post> pagingHandler)
     : base(dbContext)
 {
     this._postService = postService;
     _commentService = commentService;
     _pagingHandler = pagingHandler;
 }
示例#21
0
 public PostsController(IPostService service, ITagService ts, ICommentService commentService, IUserService us, ICategoryService cs)
 {
     this.postService = service;
     this.tagService = ts;
     this.userService = us;
     this.commentService = commentService;
     this.categoryService = cs;
 }
示例#22
0
 public HomeController(IUserService userService, IRoleService roleService, ICommentService commentService, IBlogService blogService, IArticleService articleService)
 {
     this.userService = userService;
     this.roleService = roleService;
     this.commentService = commentService;
     this.blogService = blogService;
     this.articleService = articleService;
 }
 public AdministratorController(IBlogService blogService, IEntryService entryService, IUserService userService, ITagService tagService, ICommentService commentService)
 {
     _blogService = blogService;
     _entryService = entryService;
     _userService = userService;
     _tagService = tagService;
     _commentService = commentService;
 }
 public ArticleController(IUserService service, IBlogService blogService,
     IArticleService articleService, ICommentService commentService)
 {
     _userService = service;
     _blogService = blogService;
     _articleService = articleService;
     _commentService = commentService;
 }
示例#25
0
 public SidebarController(IUserService userService, IArticleService articleService, ICategoryService categoryService, ICommentService commentService, ISettingService settionService)
 {
     _articleService = articleService;
     _categoryService = categoryService;
     _settionService = settionService;
     _commentService = commentService;
     _userService = userService;
 }
 public ArticleController(IUserService userService, IArticleService articleService, IRoleService roleService,ITagService tagService,ICommentService commentService)
 {
     this.userService = userService;
     this.articleService = articleService;
     this.roleService = roleService;
     this.tagService = tagService;
     this.commentService = commentService;
 }
示例#27
0
 public AdminController(ICategoryService categoryService, IUserService userService, IRoleService roleService, IQuestionService questionService, ICommentService commentService)
 {
     _roleService = roleService;
     _categoryService = categoryService;
     _userService = userService;
     _questionService = questionService;
     _commentService = commentService;
 }
示例#28
0
 public CommentTokens(
     IContentManager contentManager,
     IWorkContextAccessor workContextAccessor,
     ICommentService commentService) {
     _contentManager = contentManager;
     _workContextAccessor = workContextAccessor;
     _commentService = commentService;
     T = NullLocalizer.Instance;
 }
示例#29
0
 public static void MyClassInitialize(TestContext testContext)
 {
     container = TestManager.ConfigureUnityContainer("unity");
     UserService = container.Resolve<IUserService>();
     CommentService = container.Resolve<ICommentService>();
     commentDao = container.Resolve<ICommentDao>();
     tagDao = container.Resolve<ITagDao>();
     userDao = container.Resolve<IUserDao>();
 }
        static SeeCommentByTag()
        {
            IUnityContainer container =
             (IUnityContainer)HttpContext.Current.Application["unityContainer"];

            //productService   = container.Resolve<IProductService>();
            commentService = container.Resolve<ICommentService>();

        }
示例#31
0
 public RecipesController(IRecipeService recipeService, ICommentService commentService)
 {
     this.recipeService  = recipeService;
     this.commentService = commentService;
 }
 public CommentServiceTests()
 {
     _commentService = new CommentService(ImmedisDbContext);
 }
 public CommentController(ICommentService _commentService)
 {
     commentService = _commentService;
 }
示例#34
0
 public NotificationController(IGoalService goalService, IUpdateService updateService, ICommentService commentService, IGroupInvitationService groupInvitationService, ISupportInvitationService supportInvitationService, IFollowRequestService followRequestService, IUserService userService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.updateService            = updateService;
     this.groupInvitationService   = groupInvitationService;
     this.commentService           = commentService;
     this.followRequestService     = followRequestService;
     this.userService = userService;
 }
示例#35
0
 public CommentController(ICommentService commentService)
 {
     this.commentService = commentService;
 }
 public CommentsContainerPartDriver(ICommentService commentService)
 {
     _commentService = commentService;
 }
示例#37
0
 public MovieController(IMovieService _movieService, ICountryMovieService _countryMovieService, IMapper _mapper, IUserLoginService _userLoginService, ICommentService _commentService)
 {
     moviesService       = _movieService;
     countryMovieService = _countryMovieService;
     mapper           = _mapper;
     userLoginService = _userLoginService;
     commentService   = _commentService;
 }
示例#38
0
 public CommentController(ICommentService commentService)
 {
     _comService = commentService;
 }
 public CommentViewComponent(ICommentService commentService, UserManager <User> userManager)
 {
     _commentService = commentService;
     _userManager    = userManager;
 }
示例#40
0
 public CommentModel(ICommentService commentService) : base(commentService)
 {
 }
 public CommentController(ICommentService commentService, IMapper mapper, IHubContext <CommentHub> hubContext)
 {
     _commentService = commentService;
     _mapper         = mapper;
     _hubContext     = hubContext;
 }
示例#42
0
 public ArticleController(IArticleService articleService, ICategoryService categoryService, ICommentService commentService, ITagService tagService)
 {
     this.articleService  = articleService;
     this.categoryService = categoryService;
     this.commentService  = commentService;
     this.tagService      = tagService;
 }
示例#43
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService            = metricService;
     this.focusService             = focusService;
     this.supportService           = supportService;
     this.updateService            = updateService;
     this.commentService           = commentService;
     this.userService          = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService    = goalStatusService;
     this.commentUserService   = commentUserService;
     this.updateSupportService = updateSupportService;
 }
 public ProductCommentController(IOrderService iOrderService, ICommentService iCommentService, ITypeService iTypeService)
 {
     _iOrderService   = iOrderService;
     _iCommentService = iCommentService;
     _iTypeService    = iTypeService;
 }
示例#45
0
 public BlogsController(IBlogService blogService, IMapper mapper, ICommentService commentService)
 {
     _commentService = commentService;
     _blogService    = blogService;
     _mapper         = mapper;
 }
示例#46
0
 public CommentTreeBuilder(ICommentService commentService)
 {
     _commentService = commentService;
 }