Beispiel #1
0
        public Yield GetArchivePageSubpages(DreamContext context, DreamMessage request, Result <DreamMessage> response)
        {
            PermissionsBL.CheckUserAllowed(DekiContext.Current.User, Permissions.ADMIN);
            XDoc responseXml = PageArchiveBL.GetArchivedSubPagesXml(context.GetParam <uint>("pageid"));

            response.Return(DreamMessage.Ok(responseXml));
            yield break;
        }
Beispiel #2
0
        public Yield GetArchivePageContents(DreamContext context, DreamMessage request, Result <DreamMessage> response)
        {
            PermissionsBL.CheckUserAllowed(DekiContext.Current.User, Permissions.ADMIN);
            DreamMessage ret = PageArchiveBL.BuildDeletedPageContents(context.GetParam <uint>("pageid"));

            response.Return(ret);
            yield break;
        }
Beispiel #3
0
        public Yield PostArchivePagesPageIdRestore(DreamContext context, DreamMessage request, Result <DreamMessage> response)
        {
            PermissionsBL.CheckUserAllowed(DekiContext.Current.User, Permissions.ADMIN);
            uint   pageid        = context.GetParam <uint>("pageid");
            string targetPathStr = context.GetParam("to", string.Empty);
            string reason        = context.GetParam("reason", string.Empty);
            Title  targetPath    = null;

            if (!string.IsNullOrEmpty(targetPathStr))
            {
                targetPath = Title.FromUIUri(null, context.GetParam("to"), false);
            }
            XDoc responseXml = PageArchiveBL.RestoreDeletedPage(pageid, targetPath, reason);

            response.Return(DreamMessage.Ok(responseXml));
            yield break;
        }
Beispiel #4
0
        public Yield GetArchivePages(DreamContext context, DreamMessage request, Result <DreamMessage> response)
        {
            PermissionsBL.CheckUserAllowed(DekiContext.Current.User, Permissions.ADMIN);
            uint          limit, offset;
            SortDirection sortDir;
            string        sortField;

            Utils.GetOffsetAndCountFromRequest(context, 100, out limit, out offset, out sortDir, out sortField);
            Title  filterTitle = null;
            string titleStr    = context.GetParam("title", null);

            if (!string.IsNullOrEmpty(titleStr))
            {
                filterTitle = Title.FromUIUri(null, titleStr, false);
            }
            XDoc responseXml = PageArchiveBL.GetArchivedPagesXml(limit, offset, filterTitle);

            response.Return(DreamMessage.Ok(responseXml));
            yield break;
        }