Beispiel #1
0
    def genernate_jiaoyanshipin_content(self, webpart):
        cache_key = "sbj" + str(self.subject.subjectId) + "_" + str(
            webpart.getSubjectWebpartId()) + self.cacheKeyFix
        content = cache.get(cache_key)
        if content != None:
            request.setAttribute(cache_key, content)
            return

        map = HashMap()
        qry = VideoQuery(
            """ v.videoId, v.title, v.createDate, v.href, v.flvHref, v.userId, u.loginName, u.nickName, v.summary,v.flvThumbNailHref """
        )
        qry.orderType = VideoQuery.ORDER_TYPE_VIDEOID_DESC
        qry.subjectId = self.metaSubjectId
        qry.gradeId = self.metaGradeId
        if self.unitId != None and self.unitId != 0:
            qry.unitId = self.unitId
        new_video_list = qry.query_map(4)
        map.put("new_video_list", new_video_list)
        map.put("subject", self.subject)
        map.put("SubjectRootUrl", self.subjectRootUrl)
        map.put("webpart", webpart)
        map.put("unitId", self.unitId)
        content = self.templateProcessor.processTemplate(
            map, "/WEB-INF/subjectpage/" + self.templateName + "/video.ftl",
            "utf-8")
        request.setAttribute(cache_key, content)
        cache.put(cache_key, content)
Beispiel #2
0
    def get_method(self):
        self.collectionQueryString()

        qry = VideoQuery(
            """ v.title, v.videoId, v.flvThumbNailHref, v.createDate, v.href,
                        v.flvHref, v.categoryId, v.addIp, v.typeState, v.userId, v.auditState,u.loginName
                         """)
        qry.subjectId = self.subject.metaSubject.msubjId
        qry.gradeId = self.subject.metaGrade.gradeId
        if self.approveState == "" or self.approveState.isdigit() == False:
            qry.auditState = None
        else:
            qry.auditState = int(self.approveState)
        qry.k = self.params.safeGetStringParam("k")
        qry.f = self.params.safeGetStringParam("f")
        pager = self.params.createPager()
        pager.itemName = u"视频"
        pager.itemUnit = u"个"
        pager.pageSize = 25
        pager.totalRows = qry.count()
        video_list = qry.query_map(pager)
        request.setAttribute("video_list", video_list)
        request.setAttribute("pager", pager)
        request.setAttribute("subject", self.subject)
        request.setAttribute("k", qry.k)
        request.setAttribute("f", qry.f)
        return "/WEB-INF/subjectmanage/video.ftl"
Beispiel #3
0
 def get_video_list(self):
     qry = VideoQuery(
         """ v.videoId, v.title, v.createDate, v.href, v.flvHref, v.userId, u.loginName, u.nickName, v.summary,v.flvThumbNailHref """
     )
     qry.orderType = VideoQuery.ORDER_TYPE_VIDEOID_DESC
     qry.subjectId = self.subject.metaSubject.msubjId
     qry.gradeId = self.subject.metaGrade.gradeId
     if self.unitId != None and self.unitId != 0:
         qry.unitId = self.unitId
     pager = self.createPager()
     pager.totalRows = qry.count()
     video_list = qry.query_map(pager)
     request.setAttribute("video_list", video_list)
     request.setAttribute("pager", pager)