def show_one_server_object(meta):

    success, searchFile, reverseLists = ReverseLists.open_searchfile_reverselists(
        "WebUpload_ryw.show_one_server_object:"
    )
    if not success:
        return None

    print Browse.script_str()

    # displayObject = ryw_view.DisplayObject(RepositoryRoot,
    #                                       calledByVillageSide = False,
    #                                       missingFileFunc = None)
    displayObject = ryw_view.DisplayObject(
        RepositoryRoot,
        calledByVillageSide=False,
        missingFileFunc=Browse.reqDownloadFunc,
        searchFile=searchFile,
        reverseLists=reverseLists,
    )

    displayObject.begin_print()
    displayObject.show_an_object_compact(meta)
    displayObject.end_print()

    reverseLists.done()
    return searchFile
def show_one_server_object(meta, searchFile):
    """like WebUpload_ryw.show_one_server_object() except that
    the searchFile is passed in."""
    
    print "<BR>"
    print Browse.script_str()
    #displayObject = ryw_view.DisplayObject(RepositoryRoot,
    #                                       calledByVillageSide = False,
    #                                       missingFileFunc = None)

    success,reverseLists = ReverseLists.open_reverse_lists(
        'EditObject:', '', '',
        os.path.join(RepositoryRoot, 'ReverseLists'), True,
        searchFile = searchFile,
        repositoryRoot = RepositoryRoot)
    if not (success and reverseLists):
        ryw.give_bad_news('EditObject: failed to open ReverseLists.',
                          logging.critical)
        if reverseLists:
            reverseLists.done()
        return False

    displayObject = ryw_view.DisplayObject(
        RepositoryRoot, calledByVillageSide = False,
        missingFileFunc = Browse.reqDownloadFunc,
        searchFile = searchFile,
        reverseLists = reverseLists)
    
    displayObject.begin_print()
    displayObject.show_an_object_compact(meta)
    displayObject.end_print()
    reverseLists.done()
def print_title(objID, version, name, searchFile):
    if not searchFile:
        raise NameError('DisplaySelection.print_title: no searchFile')

    success,meta = searchFile.get_meta(objID, version)
    #success,meta,objroot = ryw_meta.get_meta2(RepositoryRoot,
    #                                          objID, version)

    if not success:
        ryw.give_bad_news('DisplaySelection: failed to find this selection.',
                          logging.error)
        return False
    
    if success and meta.has_key('title'):
        name = meta['title']
    obj = meta['id'] + '#' + str(meta['version'])
    print_header(name, objstr = obj)
    print Browse.script_str()
    print ryw_view.popup_js()
    return True
def print_title():
    print_header()
    print Browse.script_str()
import Browse

logDir = os.path.join(RepositoryRoot, 'WWW', 'logs')
logFile = 'upload.log'

ryw.check_logging(logDir, logFile)
logging.info('search_su: entered...')

searchFile = os.path.join(RepositoryRoot, 'SearchFile')

#
# 02/20/08
# moved to inside Search.py
# this breaks the village side,
# which probably has been long broken.
# should be easy to fix if I want to.
#
#displayObject = ryw_view.DisplayObject(RepositoryRoot,
#                                       calledByVillageSide = False,
#                                       missingFileFunc=Browse.reqDownloadFunc)

scriptName = '/cgi-bin/search_su.py'

resourcesPath = os.path.join(RepositoryRoot, 'Resources.txt')
repResources = ryw.get_resources(resourcesPath)

Search.main(logDir, logFile, searchFile, scriptName, resources = repResources)

print Browse.script_str(calledByVillageSide = False)

def print_header(selectionName):
    print Browse.script_str()
    print '<FONT SIZE=2>Selection <B><I>' + selectionName + ':</I></B></FONT>'
    print '<BR>'
    print """