コード例 #1
0
    def execute(self):
        if self.loginUser == None:
            self.addActionError(u"请先登录。")
            return self.LOGIN

        accessControlService = __spring__.getBean("accessControlService")
        if False == accessControlService.isSystemContentAdmin(self.loginUser):
            self.addActionError(u"管理专题需要管理员权限。")
            return self.ERROR

        if request.getMethod() == "POST":
            ss_svc = __spring__.getBean("specialSubjectService")
            guids = self.params.safeGetIntValues("guid")
            for g in guids:
                ss_svc.deleteSpecialSubjectById(g)

        qry = SpecialSubjectQuery(
            """ ss.specialSubjectId, ss.logo, ss.title,ss.createUserId, ss.createDate,ss.expiresDate """
        )
        pager = self.params.createPager()
        pager.itemName = u"专题"
        pager.itemUnit = u"个"
        pager.pageSize = 20
        pager.totalRows = qry.count()
        ss_list = qry.query_map(pager)
        request.setAttribute("ss_list", ss_list)
        request.setAttribute("pager", pager)
        return "/WEB-INF/ftl/specialsubject/admin_specialsubject_list.ftl"
コード例 #2
0
 def get_method(self):
     qry = SpecialSubjectQuery(
         """ ss.specialSubjectId, ss.objectGuid, ss.logo, ss.title,ss.createUserId, ss.createDate,ss.expiresDate """
     )
     qry.objectType = "subject"
     qry.objectId = self.subject.subjectId
     pager = self.params.createPager()
     pager.itemName = u"专题"
     pager.itemUnit = u"个"
     pager.pageSize = 20
     pager.totalRows = qry.count()
     ss_list = qry.query_map(pager)
     request.setAttribute("ss_list", ss_list)
     request.setAttribute("pager", pager)
     request.setAttribute("subject", self.subject)
     return "/WEB-INF/subjectmanage/managespecialsubject.ftl"
コード例 #3
0
 def show_specialsubject_list(self):
     qry = SpecialSubjectQuery(
         """ ss.specialSubjectId, ss.objectGuid, ss.title,ss.logo,ss.description,ss.createDate,ss.expiresDate """
     )
     qry.objectId = self.subject.subjectId
     qry.objectType = "subject"
     pager = self.params.createPager()
     pager.itemName = u"学科专题"
     pager.itemUnit = u"个"
     pager.pageSize = 20
     pager.totalRows = qry.count()
     specialsubject_list = qry.query_map(pager)
     request.setAttribute("specialsubject_list", specialsubject_list)
     request.setAttribute("pager", pager)
     request.setAttribute("specialSubject", self.specialSubject)
     request.setAttribute("subject", self.subject)
     request.setAttribute("head_nav", "specialsubject")
     return "/WEB-INF/subjectpage/" + self.templateName + "/show_more_specialsubject_list.ftl"