当前位置: 首页>>代码示例>>Python>>正文


Python Boolean.toString方法代码示例

本文整理汇总了Python中java.lang.Boolean.toString方法的典型用法代码示例。如果您正苦于以下问题:Python Boolean.toString方法的具体用法?Python Boolean.toString怎么用?Python Boolean.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.lang.Boolean的用法示例。


在下文中一共展示了Boolean.toString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __search

# 需要导入模块: from java.lang import Boolean [as 别名]
# 或者: from java.lang.Boolean import toString [as 别名]
 def __search(self):
     requireEscape = False
     recordsPerPage = self.__portal.recordsPerPage
     uri = URLDecoder.decode(self.request.getAttribute("RequestURI"))
     query = None
     pagePath = self.__portal.getName() + "/" + self.pageName
     if query is None or query == "":
         query = self.formData.get("query")
         requireEscape = True
     if query is None or query == "":
         query = "*:*"
     
     if query == "*:*":
         self.__query = ""
     else:
         self.__query = query
         if requireEscape:
             query = self.__escapeQuery(query)
         query = "%s:%s" % (self.__searchField, query)
     self.sessionState.set("query", self.__query)
     
     # find objects with annotations matching the query
     if query != "*:*":
         anotarQuery = self.__query
         if requireEscape:
             anotarQuery = self.__escapeQuery(anotarQuery)
         annoReq = SearchRequest(anotarQuery)
         annoReq.setParam("facet", "false")
         annoReq.setParam("rows", str(99999))
         annoReq.setParam("sort", "dateCreated asc")
         annoReq.setParam("start", str(0))
         anotarOut = ByteArrayOutputStream()
         self.services.indexer.annotateSearch(annoReq, anotarOut)
         resultForAnotar = SolrResult(ByteArrayInputStream(anotarOut.toByteArray()))
         resultForAnotar = resultForAnotar.getResults()
         ids = HashSet()
         for annoDoc in resultForAnotar:
             annotatesUri = annoDoc.getFirst("annotatesUri")
             ids.add(annotatesUri)
             self.log.debug("Found annotation for %s" % annotatesUri)
         # add annotation ids to query
         query += ' OR id:("' + '" OR "'.join(ids) + '")'
     
     portalSearchQuery = self.__portal.searchQuery
     if portalSearchQuery == "":
         portalSearchQuery = query
     else:
         if query != "*:*":
             query += " AND " + portalSearchQuery
         else:
             query = portalSearchQuery
     
     req = SearchRequest(query)
     req.setParam("facet", "true")
     req.setParam("rows", str(recordsPerPage))
     req.setParam("facet.field", self.__portal.facetFieldList)
     req.setParam("facet.sort", Boolean.toString(self.__portal.getFacetSort()))
     req.setParam("facet.limit", str(self.__portal.facetCount))
     req.setParam("sort", self.__sortBy)
     
     # setup facets
     if self.__useSessionNavigation:
         action = self.formData.get("verb")
         value = self.formData.get("value")
         fq = self.sessionState.get("fq")
         if fq is not None:
             self.__pageNum = 1
             req.setParam("fq", fq)
         if action == "add_fq":
             self.__pageNum = 1
             req.addParam("fq", URLDecoder.decode(value, "UTF-8"))
         elif action == "remove_fq":
             self.__pageNum = 1
             req.removeParam("fq", URLDecoder.decode(value, "UTF-8"))
         elif action == "clear_fq":
             self.__pageNum = 1
             req.removeParam("fq")
         elif action == "select-page":
             self.__pageNum = int(value)
     else:
         navUri = uri[len(pagePath):]
         self.__pageNum, fq, self.__fqParts = self.__parseUri(navUri)
         savedfq = self.sessionState.get("savedfq")
         limits = []
         if savedfq:
             limits.extend(savedfq)
         if fq:
             limits.extend(fq)
             self.sessionState.set("savedfq", limits)
             for q in fq:
                 req.addParam("fq", URLDecoder.decode(q, "UTF-8"))
     
     portalQuery = self.__portal.query
     if portalQuery:
         req.addParam("fq", portalQuery)
     req.addParam("fq", 'item_type:"object"')
     if req.getParams("fq"):
         self.__selected = ArrayList(req.getParams("fq"))
     
     if self.__useSessionNavigation:
#.........这里部分代码省略.........
开发者ID:kiranba,项目名称:the-fascinator,代码行数:103,代码来源:search.py


注:本文中的java.lang.Boolean.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。