コード例 #1
0
ファイル: webBase.py プロジェクト: msapunov/DIRACWeb
def getSchemaContents( section = "" ):
  subContents = []
  for subSection in gWebConfig.getSchemaSections( section ):
    subSectionPath = "%s/%s" % ( section, subSection )
    subJSTxt = getSchemaContents( subSectionPath )
    if len( subJSTxt ) > 0:
      subContents.append( "{ text: '%s', menu : %s }" % ( subSection.capitalize(), subJSTxt ) )
  for page in gWebConfig.getSchemaPages( section ):
    pageData = gWebConfig.getSchemaPageData( "%s/%s" % ( section, page ) )
    if len( pageData ) < 3 or checkPropertiesWithUser( pageData[2:] ):
      if pageData[0].find( "http" ) == 0:
        pagePath = pageData[0]
      else:
        pagePath = diracURL( "/%s" % ( pageData[0] ) )
      subContents.append( "{ text : '%s', url : '%s' }" % ( page, pagePath ) )
  return "[%s]" % ",".join( subContents )
コード例 #2
0
ファイル: webBase.py プロジェクト: msapunov/DIRACWeb
def jsSchemaSection( area, section ):
  jsTxt = "["
  for subSection in gWebConfig.getSchemaSections( section ):
    subSectionPath = "%s/%s" % ( section, subSection )
    subJSTxt = jsSchemaSection( area, subSectionPath )
    if len( subJSTxt ) > 0:
      jsTxt += "{ text: '%s', submenu : { id: '%s', itemdata : %s } }, " % ( subSection, subSectionPath, subJSTxt )
  for page in gWebConfig.getSchemaPages( section ):
    pageData = gWebConfig.getSchemaPageData( "%s/%s" % ( section, page ) )
    if page != "Delimiter" or len( pageData ) < 3 or 'all' in pageData[2:] or credentials.getSelectedGroup() in pageData[2:]:
      if pageData[0].find( "http" ) == 0:
        pagePath = pageData[0]
      else:
        pagePath = diracURL( "/%s/%s" % ( area, pageData[0] ) )
      jsTxt += "{ text : '%s', url : '%s' }," % ( page, pagePath )
  jsTxt += "]"
  return jsTxt
コード例 #3
0
def jsSchemaSection( area, section ):
  jsTxt = "["
  for subSection in gWebConfig.getSchemaSections( section ):
    subSectionPath = "%s/%s" % ( section, subSection )
    subJSTxt = jsSchemaSection( area, subSectionPath )
    if len( subJSTxt ) > 0:
      jsTxt += "{ text: '%s', submenu : { id: '%s', itemdata : %s } }, " % ( subSection, subSectionPath, subJSTxt )
  for page in gWebConfig.getSchemaPages( section ):
    pageData = gWebConfig.getSchemaPageData( "%s/%s" % ( section, page ) )
    if page != "Delimiter" or len( pageData ) < 3 or 'all' in pageData[2:] or credentials.getSelectedGroup() in pageData[2:]:
      if pageData[0].find( "http" ) == 0:
        pagePath = pageData[0]
      else:
        pagePath = diracURL( "/%s/%s" % ( area, pageData[0] ) )
      jsTxt += "{ text : '%s', url : '%s' }," % ( page, pagePath )
  jsTxt += "]"
  return jsTxt
コード例 #4
0
ファイル: webBase.py プロジェクト: msapunov/DIRACWeb
def getSchemaContents(section=""):
    subContents = []
    for subSection in gWebConfig.getSchemaSections(section):
        subSectionPath = "%s/%s" % (section, subSection)
        subJSTxt = getSchemaContents(subSectionPath)
        if len(subJSTxt) > 0:
            subContents.append("{ text: '%s', menu : %s }" %
                               (subSection.capitalize(), subJSTxt))
    for page in gWebConfig.getSchemaPages(section):
        pageData = gWebConfig.getSchemaPageData("%s/%s" % (section, page))
        if len(pageData) < 3 or checkPropertiesWithUser(pageData[2:]):
            if pageData[0].find("http") == 0:
                pagePath = pageData[0]
            else:
                pagePath = diracURL("/%s" % (pageData[0]))
            subContents.append("{ text : '%s', url : '%s' }" %
                               (page, pagePath))
    return "[%s]" % ",".join(subContents)