Пример #1
0
    def _get_sobject_history_wdg(my):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()
        
        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']
        #sobject = Search.get_by_id(search_type, search_id)

        div = Widget()

        search = Search("sthpw/sobject_log")
        search.add_filter("search_type", search_type)
        search.add_filter("search_id", search_id)
        sobjects = search.get_sobjects()

        search = Search("sthpw/transaction_log")
        search.add_filters("id", [x.get_value("transaction_log_id") for x in sobjects] )
        sobjects = search.get_sobjects()


        table = TableWdg("sthpw/transaction_log", "table", css='table')
        table.set_show_property(False)
        table.set_sobjects(sobjects)
        div.add(table)
        div.add(HtmlElement.br(2))

        return div

     
        div.add(assigned_shot_wdg)
        div.add(HtmlElement.br(2))
        return div
Пример #2
0
    def get_camera_wdg(my):
        widget = Widget()

        div = DivWdg(css="filter_box")
        sequence_filter = SequenceFilterWdg()
        epi_code, sequence_code = sequence_filter.get_value()
        div.add(sequence_filter)

        search = Search("prod/camera")

        columns = ['shot_code', 'description']
        search_filter = SearchFilterWdg("camera_search", columns=columns,\
            has_persistence=False)

        search_filter.alter_search(search)
        div.add(search_filter)
        widget.add(div)

        if sequence_code:
            search.add_where(
                "shot_code in (select code from shot where sequence_code = '%s')"
                % sequence_code)

        table = TableWdg("prod/camera")
        table.set_search(search)
        widget.add(table)
        return widget
Пример #3
0
    def get_left_wdg(my, view="layout_left"):

        search_type = my.get_left_search_type()
        search = Search(search_type)

        # filter by project
        #project_code = Project.get_project_code()
        #search.add_filter("project_code", project_code )
        # use a holding place for these "special"
        #parent_search_type = my.get_right_search_type()
        #search.add_filter("search_type", "%s?project=%s" % \
        #    (parent_search_type, project_code) )

        search.add_filter("s_status", "__TEMPLATE__")

        left_div = DivWdg()
        left_div.add_style("margin: 10px")
        left_div.add(HtmlElement.h3("Template Task"))

        asset_filter = my.get_left_filter(search)
        filter_box = DivWdg(asset_filter, css='filter_box')
        left_div.add(filter_box)
        asset_filter.alter_search(search)

        assets_table = TableWdg(search_type, view)
        assets_table.set_sobjects(search.get_sobjects(), search)
        left_div.add(assets_table)

        return left_div
Пример #4
0
    def get_notes_wdg(my):
        widget = Widget()

        div = DivWdg(css="filter_box")
        columns = ['code', 'description']
        search_filter = SearchFilterWdg("note_search", columns=columns,\
            has_persistence=False)

        div.add(search_filter)
        sequence_filter = SequenceFilterWdg()

        div.add(sequence_filter)

        context_select = FilterSelectWdg("discussion_context")
        context_select.set_option("setting", "notes_preprod_context")
        context_select.add_empty_option("-- Any Context --")
        span = SpanWdg(css="med")
        span.add("Notes Context: ")
        span.add(context_select)
        hint = HintWdg('Submission notes for each shot are also included here')
        span.add(hint)
        div.add(span)

        widget.add(div)

        # create a search
        search = Search("prod/shot")
        sequence_filter.alter_search(search)

        search_filter.alter_search(search)

        table = TableWdg("prod/shot", "preprod_notes")
        table.set_search(search)
        widget.add(table)
        return widget
Пример #5
0
    def get_display(self):
        web = WebContainer.get_web()

        widget = Widget()

        search_type = web.get_form_value("parent_search_type")
        search_id = web.get_form_value("parent_search_id")

        if not search_type:
            widget.add("RenderSubmitInfo: parent type not found")
            return widget

        hidden = HiddenWdg("parent_search_type", search_type)
        widget.add(hidden)
        hidden = HiddenWdg("parent_search_id", search_id)
        widget.add(hidden)

        sobject = Search.get_by_id(search_type, search_id)
        table = TableWdg(search_type, css="embed")
        table.set_show_property(False)
        table.set_sobject(sobject)
        table.remove_widget("render")
        table.remove_widget("description")
        widget.add(table)

        return widget
Пример #6
0
    def get_camera_wdg(self):
        widget = Widget()

        div = DivWdg(css="filter_box")
        sequence_filter = SequenceFilterWdg()
        epi_code, sequence_code = sequence_filter.get_value()
        div.add(sequence_filter)

        search = Search("prod/camera")

        columns = ['shot_code', 'description']
        search_filter = SearchFilterWdg("camera_search", columns=columns,\
            has_persistence=False)
     
        search_filter.alter_search(search)
        div.add(search_filter)
        widget.add(div)

        if sequence_code:
            search.add_where("shot_code in (select code from shot where sequence_code = '%s')" % sequence_code)

        table = TableWdg("prod/camera")
        table.set_search(search)
        widget.add(table)
        return widget
Пример #7
0
    def get_left_wdg(my, view="layout_left"):

        search_type = my.get_left_search_type()
        search = Search(search_type)

        # filter by project
        #project_code = Project.get_project_code()
        #search.add_filter("project_code", project_code )
        # use a holding place for these "special"
        #parent_search_type = my.get_right_search_type()
        #search.add_filter("search_type", "%s?project=%s" % \
        #    (parent_search_type, project_code) )

        search.add_filter("s_status", "__TEMPLATE__")
        
        left_div = DivWdg()
        left_div.add_style("margin: 10px")
        left_div.add(HtmlElement.h3("Template Task") )


        asset_filter = my.get_left_filter(search)
        filter_box = DivWdg(asset_filter, css='filter_box')
        left_div.add(filter_box)
        asset_filter.alter_search(search)

        assets_table = TableWdg(search_type, view)
        assets_table.set_sobjects(search.get_sobjects(), search)
        left_div.add(assets_table)

        return left_div
Пример #8
0
    def get_art_reference(self):

        widget = Widget()
        help = HelpItemWdg('References', 'References tab lets the user organize art references. Each reference can be [related] to one or more assets defined in TACTIC. It can be set up when you [Edit] the reference.')
        self.add(help)
        div = DivWdg(css="filter_box")
        
        widget.add(div)
        columns = ['description','keywords']
        search_filter = SearchFilterWdg("art_ref_search", columns=columns,\
            has_persistence=False)
       
        div.add(search_filter)
           
        select = FilterSelectWdg("art_ref_category", label='Category: ', css='snall')
        select.set_option("setting", "art_reference_category")
        select.add_empty_option('-- Any --')
        
        div.add( select )

        table = TableWdg("prod/art_reference")
        search = Search("prod/art_reference")
       
        search_filter.alter_search(search)
       
        value = select.get_value()
        if value != "":
            search.add_filter("category", value)
        table.set_search(search)
        widget.add(table)
        return widget
Пример #9
0
    def get_project_settings_wdg(my):
        widget = Widget()

        search = Search("prod/prod_setting")

        table = TableWdg("prod/prod_setting")
        table.set_search(search)

        widget.add(table)
        return widget
Пример #10
0
   def get_naming_wdg(my):
       widget = Widget()
 
       table = TableWdg("prod/naming")
       search = Search("prod/naming")
       sobjects = search.get_sobjects()
       table.set_sobjects(sobjects)
       widget.add(table)
   
       return widget
Пример #11
0
    def get_project_settings_wdg(my):
        widget = Widget()

        search = Search("prod/prod_setting")
        
        table = TableWdg("prod/prod_setting")
        table.set_search(search)

        widget.add(table)
        return widget
Пример #12
0
    def get_milestone_wdg(self):
        widget = Widget()

        search = Search("sthpw/milestone")
        
        table = TableWdg("sthpw/milestone")
        table.set_search(search)

        widget.add(table)
        return widget
Пример #13
0
    def get_milestone_wdg(my):
        widget = Widget()

        search = Search("sthpw/milestone")

        table = TableWdg("sthpw/milestone")
        table.set_search(search)

        widget.add(table)
        return widget
Пример #14
0
    def get_display(self):
        web = WebContainer.get_web()

        widget = Widget()

        search_type = web.get_form_value("parent_search_type")
        search_id = web.get_form_value("parent_search_id")

        if not search_type:
            widget.add("RenderSubmitInfo: parent type not found")
            return widget

        hidden = HiddenWdg("parent_search_type", search_type)
        widget.add(hidden)
        hidden = HiddenWdg("parent_search_id", search_id)
        widget.add(hidden)

        sobject = Search.get_by_id(search_type, search_id)
        table = TableWdg(search_type, css="embed")
        table.set_show_property(False)
        table.set_sobject(sobject)
        table.remove_widget("render")
        table.remove_widget("description")
        widget.add(table)

        return widget
Пример #15
0
    def get_render_policy_wdg(my):
        widget = Widget()
        #div = DivWdg(css="filter_box")
        #widget.add(div)

        table = TableWdg("prod/render_policy")
        search = Search("prod/render_policy")
        sobjects = search.get_sobjects()
        table.set_sobjects(sobjects)
        widget.add(table)

        return widget
Пример #16
0
    def get_render_policy_wdg(my):
        widget = Widget()
        #div = DivWdg(css="filter_box")
        #widget.add(div)

        table = TableWdg("prod/render_policy")
        search = Search("prod/render_policy")
        sobjects = search.get_sobjects()
        table.set_sobjects(sobjects)
        widget.add(table)
    
        return widget
Пример #17
0
    def get_naming_wdg(self):
        widget = Widget()
        #div = DivWdg(css="filter_box")
        #widget.add(div)

        table = TableWdg("prod/naming")
        search = Search("prod/naming")
        sobjects = search.get_sobjects()
        table.set_sobjects(sobjects)
        widget.add(table)
    
        return widget
Пример #18
0
    def get_naming_wdg(self):
        widget = Widget()
        #div = DivWdg(css="filter_box")
        #widget.add(div)

        table = TableWdg("prod/naming")
        search = Search("prod/naming")
        sobjects = search.get_sobjects()
        table.set_sobjects(sobjects)
        widget.add(table)

        return widget
Пример #19
0
    def get_storyboard_wdg(my):
        widget = Widget()
        help = HelpItemWdg(
            'Storyboards',
            'Storyboards tab lets the user organize storyboards. You are only required to [Insert] once per shot. Subsequent versions of the storyboard should be published via the [Publish] button.'
        )
        my.add(help)
        div = DivWdg(css="filter_box")

        sequence_filter = SequenceFilterWdg()
        epi_code, sequence_code = sequence_filter.get_value()
        div.add(sequence_filter)

        columns = ['code', 'shot_code']
        search_filter = SearchFilterWdg("storyboard_search", columns=columns,\
            has_persistence=False)

        div.add(search_filter)

        widget.add(div)

        # create a search
        search = Search("prod/storyboard")

        if sequence_code:
            search.add_where(
                "shot_code in (select code from shot where sequence_code = '%s')"
                % sequence_code)

        table = TableWdg("prod/storyboard")
        table.set_class("table")
        table.set_search_limit(25)
        table.set_search(search)
        widget.add(table)
        return widget
Пример #20
0
    def get_display(self):
        
        if not self.is_refresh:
            widget = DivWdg()
            self.set_as_panel(widget)
        else:
            widget = Widget() 


        sobject = Search.get_by_id(self.search_type, self.search_id)
        if sobject:
            search_type = sobject.get_base_search_type()
        else:
            widget.add('sobject not found with [%s,%s]' %(self.search_type, self.search_id))
            return widget

        # the filter for searching assets
        div = DivWdg(css="filter_box")
        filter = ProcessSelectWdg(label = 'Process: ', search_type=search_type,\
                css='med', has_empty=True)
        filter.set_persistence()
        filter.add_behavior({'type' : 'change',
            'cbjs_action': '%s;%s'%(filter.get_save_script(), filter.get_refresh_script())
            })
        div.add(filter)

        # note assuming process == context here
        contexts = filter.get_values()
        if contexts:
            contexts = contexts[0].split(",")
        else:
            contexts = None
        widget.add(div)


        snap_table = TableWdg(Snapshot.SEARCH_TYPE, "publish_browser")
        widget.add(snap_table)

        # add the search
        search = Search(Snapshot.SEARCH_TYPE)
        search.add_order_by("version desc")
        search.add_sobject_filter(sobject)
        if contexts:
            search.add_filters("context", contexts)

        snap_table.set_sobjects(search.get_sobjects())
        snap_table.set_search(search)

        return widget
Пример #21
0
    def get_config_wdg(my):
        widget = Widget()

        search = Search("sthpw/widget_config")

        div = DivWdg(css="filter_box")

        span = SpanWdg(css="med")
        span.add("Search Type: ")

        select = FilterSelectWdg("config_search_type")
        select.add_empty_option("-- Select --")
        search_type_search = Search("sthpw/search_object")
        search_type_search.add_order_by("search_type")
        span.add(select)
        project = Project.get()
        project_type = project.get_base_type()
        filter = search.get_regex_filter("search_type", "login|task|note|timecard", "EQ")
        search_type_search.add_where(
            """
        namespace = '%s' or namespace = '%s' or %s
        """
            % (project_type, project.get_code(), filter)
        )
        select.set_search_for_options(search_type_search, value_column="search_type")
        div.add(span)

        search_type_value = select.get_value()

        span = SpanWdg()
        view_text = TextWdg("view")
        view_text.set_persist_on_submit()
        span.add("View: ")
        span.add(view_text)
        div.add(span)
        widget.add(div)
        view = view_text.get_value()
        if view:
            search.add_filter("view", view)
        if search_type_value:
            search.add_filter("search_type", search_type_value)

        table = TableWdg("sthpw/widget_config")
        table.set_search(search)

        widget.add(table)

        return widget
Пример #22
0
 def get_pipeline_wdg(my):
     search = Search("sthpw/pipeline")
     widget = Widget()
     widget.set_search(search)
     table = TableWdg("sthpw/pipeline", "manage")
     widget.add(table)
     return widget
Пример #23
0
    def get_config_wdg(self):
        widget = Widget()

        search = Search("sthpw/widget_config")

        div = DivWdg(css="filter_box")

        span = SpanWdg(css="med")
        span.add("Search Type: ")

        select = FilterSelectWdg("config_search_type")
        select.add_empty_option("-- Select --")
        search_type_search = Search("sthpw/search_object")
        search_type_search.add_order_by("search_type")
        span.add(select)
        project = Project.get()
        project_type = project.get_base_type()
        filter = search.get_regex_filter("search_type",
                                         "login|task|note|timecard", "EQ")
        search_type_search.add_where('''
        namespace = '%s' or namespace = '%s' or %s
        ''' % (project_type, project.get_code(), filter))
        select.set_search_for_options(search_type_search,
                                      value_column='search_type')
        div.add(span)

        search_type_value = select.get_value()

        span = SpanWdg()
        view_text = TextWdg("view")
        view_text.set_persist_on_submit()
        span.add("View: ")
        span.add(view_text)
        div.add(span)
        widget.add(div)
        view = view_text.get_value()
        if view:
            search.add_filter("view", view)
        if search_type_value:
            search.add_filter("search_type", search_type_value)

        table = TableWdg("sthpw/widget_config")
        table.set_search(search)

        widget.add(table)

        return widget
Пример #24
0
    def get_display(my):

        widget = Widget()

        # added a change password widget to the preferences tab.
        # This should be moved into the table eventually
        div = DivWdg()
        #div.add(ChangePasswordLinkWdg())
        div.set_style("font-size: 14px; padding-left: 10px; margin-top: 10px")
        widget.add(div)

        search = Search("sthpw/pref_list")
        sobjects = search.get_sobjects()
        table = TableWdg("sthpw/pref_list", "user")
        table.set_sobjects(sobjects)
        widget.add(table)

        return widget
Пример #25
0
    def get_extend_wdg(self):
        widget = Widget()
        search = Search("sthpw/widget_extend")

        div = DivWdg(css="filter_box")

        # add key filter
        span = SpanWdg(css="med")
        key_select = FilterSelectWdg("key")
        key_select.add_empty_option("-- Any Key --")
        key_select.set_option("query", "sthpw/widget_extend|key|key")
        span.add("Key: ")
        span.add(key_select)
        div.add(span)

 
        # add type filter
        span = SpanWdg(css="med")
        select = FilterSelectWdg("extend_type")
        select.add_empty_option("-- Any Type --")
        select.set_option("values", "TabWdg|TableWdg")
        span.add("Widget Extend Type: ")
        span.add(select)
        div.add(span)

        widget.add(div)

        extend_type = select.get_value()
        if extend_type:
            search.add_filter("type", extend_type)

        key = key_select.get_value()
        if key:
            search.add_filter("key", key)

        # add project filter
        #search.add_where( Project.get_project_filter() )

        table = TableWdg("sthpw/widget_extend")
        table.set_search( search )

        widget.add(table)

        return widget
Пример #26
0
    def _get_sobject_wdg(my, search_type):
        widget = Widget()
        if search_type =="flash/nat_pause":
            widget.add(HelpItemWdg('Nat Pause tab', '/doc/flash/nat_pause_tab.html', is_link=True))
        div = DivWdg(css="filter_box")
        episode_filter = EpisodeNavigatorWdg()
        div.add(episode_filter)
        div.add(SearchLimitWdg())
        widget.add(div)
        table = TableWdg(search_type)
        table.set_class("table")
        widget.add(table)
        search = Search(search_type)

        episode_code = episode_filter.get_value()
        if episode_code:
            search.add_filter("episode_code", episode_filter.get_value())
        widget.set_search(search)
        return widget
Пример #27
0
    def get_extend_wdg(self):
        widget = Widget()
        search = Search("sthpw/widget_extend")

        div = DivWdg(css="filter_box")

        # add key filter
        span = SpanWdg(css="med")
        key_select = FilterSelectWdg("key")
        key_select.add_empty_option("-- Any Key --")
        key_select.set_option("query", "sthpw/widget_extend|key|key")
        span.add("Key: ")
        span.add(key_select)
        div.add(span)

        # add type filter
        span = SpanWdg(css="med")
        select = FilterSelectWdg("extend_type")
        select.add_empty_option("-- Any Type --")
        select.set_option("values", "TabWdg|TableWdg")
        span.add("Widget Extend Type: ")
        span.add(select)
        div.add(span)

        widget.add(div)

        extend_type = select.get_value()
        if extend_type:
            search.add_filter("type", extend_type)

        key = key_select.get_value()
        if key:
            search.add_filter("key", key)

        # add project filter
        #search.add_where( Project.get_project_filter() )

        table = TableWdg("sthpw/widget_extend")
        table.set_search(search)

        widget.add(table)

        return widget
Пример #28
0
    def get_display(my):

        web = WebContainer.get_web()
        args = web.get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        planner_search_type = my.get_search_type()


        # get parent instances first
        '''
        all_instances = []
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(planner_search_type)
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            instances = search.get_sobjects()

            all_instances.extend(instances)
        '''


        search = Search(planner_search_type)
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        instances = search.get_sobjects()
        #all_instances.extend(instances)

        widget = DivWdg()
        widget.add( HiddenWdg("planner_search_type", planner_search_type) )
        widget.add_style("width: 95%")
        widget.add_style("float: right")
        table = TableWdg(search_type, "layout", css='minimal')
        table.table.set_max_width(use_css=True)
        #table.set_sobjects(all_instances)
        table.set_search(search)
        table.do_search()
        table.set_show_property(False)

        #aux_data = ShotInstance.get_aux_data(all_instances)
        #table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Пример #29
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("sthpw/task", "layout_right")
        from pyasm.biz import Task
        tasks = Task.get_by_sobject(sobject)
        table.set_sobjects(tasks)
        table.set_show_property(False)
        widget.add(table)

        return widget
Пример #30
0
    def get_display(my):

        widget = Widget()
         
        # added a change password widget to the preferences tab.  
        # This should be moved into the table eventually
        div = DivWdg()
        #div.add(ChangePasswordLinkWdg())
        div.set_style("font-size: 14px; padding-left: 10px; margin-top: 10px" )
        widget.add(div)



        search = Search("sthpw/pref_list")
        sobjects = search.get_sobjects()
        table = TableWdg("sthpw/pref_list", "user")
        table.set_sobjects(sobjects)
        widget.add(table)


        return widget
Пример #31
0
    def _get_sobject_history_wdg(self):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']
        #sobject = Search.get_by_id(search_type, search_id)

        div = Widget()

        search = Search("sthpw/sobject_log")
        search.add_filter("search_type", search_type)
        search.add_filter("search_id", search_id)
        sobjects = search.get_sobjects()

        search = Search("sthpw/transaction_log")
        search.add_filters(
            "id", [x.get_value("transaction_log_id") for x in sobjects])
        sobjects = search.get_sobjects()

        table = TableWdg("sthpw/transaction_log", "table", css='table')
        table.set_show_property(False)
        table.set_sobjects(sobjects)
        div.add(table)
        div.add(HtmlElement.br(2))

        return div

        div.add(assigned_shot_wdg)
        div.add(HtmlElement.br(2))
        return div
Пример #32
0
    def _get_sobject_wdg(my, search_type):
        widget = Widget()
        if search_type == "flash/nat_pause":
            widget.add(
                HelpItemWdg('Nat Pause tab',
                            '/doc/flash/nat_pause_tab.html',
                            is_link=True))
        div = DivWdg(css="filter_box")
        episode_filter = EpisodeNavigatorWdg()
        div.add(episode_filter)
        div.add(SearchLimitWdg())
        widget.add(div)
        table = TableWdg(search_type)
        table.set_class("table")
        widget.add(table)
        search = Search(search_type)

        episode_code = episode_filter.get_value()
        if episode_code:
            search.add_filter("episode_code", episode_filter.get_value())
        widget.set_search(search)
        return widget
Пример #33
0
    def get_display(self):
        search_type = self.options.get("search_type")
        view = self.options.get("view")
        filter = self.options.get("filter")
        if type(filter) in types.StringTypes:
            filters = [filter]
        elif not filter:
            filters = []
        else:
            filters = filter

        # create the search
        search = Search(search_type)

        widget = Widget()
        div = DivWdg(css="filter_box")
        widget.add(div)

        for i, filter in enumerate(filters):

            if filter.find("|") != -1:
                filter_name, expression = filter.split("|", 1)
            else:
                filter_name = filter
                expression = None

            span = SpanWdg(css="med")

            filter_wdg = Container.get_dict("widgets", filter_name)
            if not filter_wdg:
                filter_wdg = Common.create_from_class_path(filter_name)
                span.add(filter_wdg)
                div.add(span)
            else:
                span.add("%s: " % filter_wdg.get_name())

            if expression:
                name = filter_wdg.get_name()
                value = filter_wdg.get_value()
                if value != "":
                    expression = expression.replace("{name}", name)
                    expression = expression.replace("{value}", value)
                    search.add_where(expression)
            else:
                filter_wdg.alter_search(search)

            filter_wdg.set_name(filter_name)

            span = SpanWdg(css="med")
            span.add("%s: " % filter_name)
            span.add(filter_wdg)
            div.add(span)

        table = TableWdg(search_type, view)
        table.set_search(search)
        table.do_search()

        widget.add(table)
        return widget
Пример #34
0
    def get_notes_wdg(self):
        widget = Widget()

        div = DivWdg(css="filter_box")
        columns = ['code', 'description']
        search_filter = SearchFilterWdg("note_search", columns=columns,\
            has_persistence=False)
     
        
        div.add(search_filter)
        sequence_filter = SequenceFilterWdg()
        
        div.add(sequence_filter)

        context_select = FilterSelectWdg("discussion_context")
        context_select.set_option("setting", "notes_preprod_context")
        context_select.add_empty_option("-- Any Context --")
        span = SpanWdg(css="med")
        span.add("Notes Context: ")
        span.add(context_select)
        hint = HintWdg('Submission notes for each shot are also included here')
        span.add(hint)
        div.add(span)

       

        widget.add(div)

        # create a search
        search = Search("prod/shot")
        sequence_filter.alter_search(search)

        search_filter.alter_search(search)

        table = TableWdg("prod/shot", "preprod_notes")
        table.set_search(search)
        widget.add(table)
        return widget
Пример #35
0
    def get_display(self):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        #instances = sobject.get_all_children("prod/instance")

        all_instances = []

        # get parent instances first
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(self.get_search_type())
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            search.add_filter("type", "asset")
            instances = search.get_sobjects()

            all_instances.extend(instances)


        search = Search(self.get_search_type())
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        search.add_filter("type", "asset")
        instances = search.get_sobjects()
        all_instances.extend(instances)

        widget = DivWdg()
        
        widget.add_style("width: 95%")
        
        widget.add_style("float: right")
        table = TableWdg(self.get_search_type(),"layout", css='simple')
        table.set_sobjects(all_instances)
        table.set_show_property(False)

        aux_data = ShotInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Пример #36
0
    def get_display(self):

        web = WebContainer.get_web()
        args = web.get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        planner_search_type = self.get_search_type()


        # get parent instances first
        '''
        all_instances = []
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(planner_search_type)
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            instances = search.get_sobjects()

            all_instances.extend(instances)
        '''


        search = Search(planner_search_type)
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        instances = search.get_sobjects()
        #all_instances.extend(instances)

        widget = DivWdg()
        widget.add( HiddenWdg("planner_search_type", planner_search_type) )
        widget.add_style("width: 95%")
        widget.add_style("float: right")
        table = TableWdg(search_type, "layout", css='minimal')
        table.table.set_max_width(use_css=True)
        #table.set_sobjects(all_instances)
        table.set_search(search)
        table.do_search()
        table.set_show_property(False)

        #aux_data = ShotInstance.get_aux_data(all_instances)
        #table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Пример #37
0
    def get_art_reference(my):

        widget = Widget()
        help = HelpItemWdg(
            'References',
            'References tab lets the user organize art references. Each reference can be [related] to one or more assets defined in TACTIC. It can be set up when you [Edit] the reference.'
        )
        my.add(help)
        div = DivWdg(css="filter_box")

        widget.add(div)
        columns = ['description', 'keywords']
        search_filter = SearchFilterWdg("art_ref_search", columns=columns,\
            has_persistence=False)

        div.add(search_filter)

        select = FilterSelectWdg("art_ref_category",
                                 label='Category: ',
                                 css='snall')
        select.set_option("setting", "art_reference_category")
        select.add_empty_option('-- Any --')

        div.add(select)

        table = TableWdg("prod/art_reference")
        search = Search("prod/art_reference")

        search_filter.alter_search(search)

        value = select.get_value()
        if value != "":
            search.add_filter("category", value)
        table.set_search(search)
        widget.add(table)
        return widget
Пример #38
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        #instances = sobject.get_all_children("prod/instance")

        all_instances = []

        # get parent instances first
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(my.get_search_type())
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            search.add_filter("type", "asset")
            instances = search.get_sobjects()

            all_instances.extend(instances)


        search = Search(my.get_search_type())
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        search.add_filter("type", "asset")
        instances = search.get_sobjects()
        all_instances.extend(instances)

        widget = DivWdg()
        
        widget.add_style("width: 95%")
        
        widget.add_style("float: right")
        table = TableWdg(my.get_search_type(),"layout", css='simple')
        table.set_sobjects(all_instances)
        table.set_show_property(False)

        aux_data = ShotInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Пример #39
0
    def get_display(self):

        if not self.is_refresh:
            widget = DivWdg()
            self.set_as_panel(widget)
        else:
            widget = Widget()

        sobject = Search.get_by_id(self.search_type, self.search_id)
        if sobject:
            search_type = sobject.get_base_search_type()
        else:
            widget.add('sobject not found with [%s,%s]' %
                       (self.search_type, self.search_id))
            return widget

        # the filter for searching assets
        div = DivWdg(css="filter_box")
        filter = ProcessSelectWdg(label = 'Process: ', search_type=search_type,\
                css='med', has_empty=True)
        filter.set_persistence()
        filter.add_behavior({
            'type':
            'change',
            'cbjs_action':
            '%s;%s' % (filter.get_save_script(), filter.get_refresh_script())
        })
        div.add(filter)

        # note assuming process == context here
        contexts = filter.get_values()
        if contexts:
            contexts = contexts[0].split(",")
        else:
            contexts = None
        widget.add(div)

        snap_table = TableWdg(Snapshot.SEARCH_TYPE, "publish_browser")
        widget.add(snap_table)

        # add the search
        search = Search(Snapshot.SEARCH_TYPE)
        search.add_order_by("version desc")
        search.add_sobject_filter(sobject)
        if contexts:
            search.add_filters("context", contexts)

        snap_table.set_sobjects(search.get_sobjects())
        snap_table.set_search(search)

        return widget
Пример #40
0
    def _get_sobject_wdg(self):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        sobj_search_type = args['sobj_search_type']
        search_id = args['search_id']
        view = args['view']
        sobject = Search.get_by_id(sobj_search_type, search_id)

        content = Widget()
        table = TableWdg(search_type, view, css='table')
        table.set_show_property(False)
        content.add(table)
        content.add(HtmlElement.br(2))

        search = self._get_sobject_search(sobject, search_type)

        sobjects = search.get_sobjects()
        if search_type.startswith("sthpw/note"):
            # this assumes that a project has submission!
            from pyasm.prod.biz import Submission
            from pyasm.search import SqlException
            try:
                notes = Submission.get_all_notes(sobject)
                sobjects.extend(notes)
            except SqlException:
                pass

            def compare(x, y):
                return cmp(y.get_value("timestamp"), x.get_value("timestamp"))

            sobjects.sort(cmp=compare)

        table.set_search(search)
        table.set_sobjects(sobjects)
        return content
Пример #41
0
    def _get_sobject_wdg(my):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()
        
        # get the args in the URL
        search_type = args['search_type']
        sobj_search_type = args['sobj_search_type']
        search_id = args['search_id']
        view = args['view']
        sobject = Search.get_by_id(sobj_search_type, search_id)

        content = Widget()
        table = TableWdg(search_type, view, css='table')
        table.set_show_property(False)
        content.add(table)
        content.add(HtmlElement.br(2))

        search = my._get_sobject_search(sobject, search_type)
           
        sobjects = search.get_sobjects()
        if search_type.startswith("sthpw/note"):
            # this assumes that a project has submission!
            from pyasm.prod.biz import Submission
            from pyasm.search import SqlException
            try:
                notes = Submission.get_all_notes(sobject)
                sobjects.extend( notes )
            except SqlException:
                pass

            def compare(x,y):
                return cmp( y.get_value("timestamp"), x.get_value("timestamp") )

            sobjects.sort(cmp=compare)

        table.set_search(search)
        table.set_sobjects(sobjects)
        return content
Пример #42
0
    def get_storyboard_wdg(self):
        widget = Widget()
        help = HelpItemWdg('Storyboards', 'Storyboards tab lets the user organize storyboards. You are only required to [Insert] once per shot. Subsequent versions of the storyboard should be published via the [Publish] button.')
        self.add(help)
        div = DivWdg(css="filter_box")

        sequence_filter = SequenceFilterWdg()
        epi_code, sequence_code = sequence_filter.get_value()
        div.add(sequence_filter)


        columns = ['code','shot_code']
        search_filter = SearchFilterWdg("storyboard_search", columns=columns,\
            has_persistence=False)
     
       
        div.add(search_filter)

        

        widget.add(div)


        # create a search
        search = Search("prod/storyboard")
        
        if sequence_code:
            search.add_where("shot_code in (select code from shot where sequence_code = '%s')" % sequence_code)



        table = TableWdg("prod/storyboard")
        table.set_class("table")
        table.set_search_limit(25)
        table.set_search(search)
        widget.add(table)
        return widget
Пример #43
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type, search_id))

        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("sthpw/task", "layout_right")
        from pyasm.biz import Task
        tasks = Task.get_by_sobject(sobject)
        table.set_sobjects(tasks)
        table.set_show_property(False)
        widget.add(table)

        return widget
Пример #44
0
 def get_script_wdg(my):
     table = TableWdg("prod/script")
     table.set_class("table")
     search = Search("prod/script")
     table.set_search(search)
     return table
Пример #45
0
 def get_time_card_wdg(my):
     table = TableWdg('sthpw/timecard')
     search = Search('sthpw/timecard')
     table.set_search(search)
     return table
Пример #46
0
    def get_display(my):

        web = WebContainer.get_web()
        search_key = web.get_form_value("search_key")

        widget = Widget()

        sobject = Search.get_by_search_key(search_key)

        table = TableWdg( sobject.get_search_type(), "render" )
        table.set_sobject(sobject)
        widget.add(table)



        # get all of the snapshots with a context render
        sobject_snapshot = Snapshot.get_latest_by_sobject(sobject,"render")
        if sobject_snapshot:
            search_type = sobject.get_search_type()
            search_id = sobject.get_value('search_id')
            
            render_snapshots = Snapshot.get_by_search_type(search_type,search_id,"render")

            table = TableWdg("sthpw/snapshot")
            table.set_sobjects(render_snapshots)
            widget.add(table)



        widget.add(HtmlElement.h3("Rendered Frames"))
        if sobject_snapshot:
            widget.add("Render version: v%0.3d" % sobject_snapshot.get_value("version") )

        # get latest snapshot of the render
        renders = Render.get_all_by_sobject(sobject)
        if not renders:
            widget.add("<h4>No renders found</h4>")
            return widget

        render = renders[0]
        snapshot = Snapshot.get_latest_by_sobject(render,"render")
        if snapshot == None:
            widget.add("<h4>No snapshots found</h4>")
            return widget


        # get the images
        web_dir = snapshot.get_web_dir()
        lib_dir = snapshot.get_lib_dir()

        xml = snapshot.get_xml_value("snapshot")
        file_nodes = xml.get_nodes("snapshot/file")
        file_name = icon_file_name = ''
        frame_range = icon_frame_range = None
        
        for file_node in file_nodes: 
            if Xml.get_attribute(file_node, 'type') == 'main':
                file_name, frame_range = my._get_frame_info(file_node, sobject)
            if Xml.get_attribute(file_node, 'type') == 'icon':
                icon_file_name, icon_frame_range = my._get_frame_info(file_node, sobject)
            
        file_names = [file_name]
        icon_file_names = [icon_file_name]        

        if "##" in file_name:
            file_names = FileGroup.expand_paths(file_name, frame_range)
        if "##" in icon_file_name:
            icon_file_names = FileGroup.expand_paths(icon_file_name, \
                icon_frame_range)    
        
        div = DivWdg()
        for k in range(len(file_names)):
            file_name = file_names[k]

            # ignore frames that don't exist
            lib_path = "%s/%s" % (lib_dir, file_name)
            if not os.path.exists(lib_path):
                continue
           
            try:
                icon_file_name = icon_file_names[k]
            except IndexError:
                icon_file_name = file_names[k]
                
            file_path = "%s/%s" % (web_dir, file_name)
            icon_file_path = "%s/%s" % (web_dir, icon_file_name)
            
            img = HtmlElement.img(icon_file_path)
            img.set_attr("width", "60")
            img.add_event("onmouseover","hint_bubble.show(event,'Ctrl + Click to open in new window')")

            href = HtmlElement.href(img, file_path)
            div.add(href)

        widget.add(div)

        widget.add( "<h3>Render History</h3>" )
        widget.add( my.get_render_history(renders) )

        return widget
Пример #47
0
 def get_render_history(my, renders):
     table = TableWdg("prod/render", "history")
     table.set_sobjects( renders )
     return table
Пример #48
0
            filter_div.add("Filter: ")
            filter_div.add(filter)
            #filter_div.add(IconWdg("Remove Filter", IconWdg.RETIRE))
            filter_div.add(HtmlElement.br(2))

        widget.add(filter_div)

        search = Search(search_type)
        search.set_limit(5)
        filter.alter_search(search)

        if not handler:
            if view in ["edit", "insert"]:
                table = EditWdg(search_type, view)
            else:
                table = TableWdg(search_type, view)
        else:
            table = eval("%s(search_type,view)" % handler)

        #table.alter_search(search)
        sobjects = search.get_sobjects()

        if not sobjects and view in ["edit", "insert"]:
            sobjects = [SObjectFactory.create(search_type)]
        table.set_sobjects(sobjects)
        widget.add(table)

        # show the custom properties
        widget.add("<h3>Custom Properties [%s]</h3>" % search_type)
        search = Search("prod/custom_property")
        search.add_filter("search_type", search_type)
Пример #49
0
    def init(my):

        search = Search("sthpw/queue")
        search.add_order_by("priority desc")
        search.add_order_by("timestamp desc")

        widget = Widget()

        div = DivWdg(css="filter_box")

        span = SpanWdg(css="med")

        from pyasm.prod.web import SearchFilterWdg
        search_filter = SearchFilterWdg(columns=Queue.get_search_columns())
        search_filter.alter_search(search)
        span.add(search_filter)
        div.add(span)

        span = SpanWdg(css="med")
        priority_wdg = TextWdg("priority_search")
        priority_wdg.set_persistence()
        priority = priority_wdg.get_value()
        if priority:
            search.add_filter("priority", priority)
        span.add("Priority: ")
        span.add(priority_wdg)
        div.add(span)

        select = SelectWdg("queue_state")
        select.set_option("values", "|pending|locked|error|done")
        select.set_option("labels", "All|pending|locked|error|done")
        select.add_event("onchange", "document.form.submit()")
        select.set_persistence()

        span = SpanWdg(css="med")
        span.add("State: ")
        span.add(select)
        div.add(span)
        queue_state = select.get_value()
        if queue_state != "":
            search.add_filter("state", queue_state)

        user_select = SelectWdg("user_select")
        user_select.add_empty_option()

        user_search = Search("sthpw/login")
        user_select.set_search_for_options(user_search, "login", "login")
        user_select.add_event("onchange", "document.form.submit()")
        user_select.set_persistence()

        div.add("User: "******"":
            search.add_filter("login", queue_user)

        search_limit = SearchLimitWdg()
        search_limit.set_limit(10)
        div.add(search_limit)
        search_limit.alter_search(search)

        widget.add(div)

        sobjects = search.get_sobjects()

        table = TableWdg("sthpw/queue")
        table.set_sobjects(sobjects)
        widget.add(table)

        my.add(widget)
Пример #50
0
    def get_display(my):
        search_type = my.options.get("search_type")
        view = my.options.get("view")
        filter = my.options.get("filter")
        if type(filter) in types.StringTypes:
            filters = [filter]
        elif not filter:
            filters = []
        else:
            filters = filter

        # create the search
        search = Search(search_type)

        widget = Widget()
        div = DivWdg(css="filter_box")
        widget.add(div)

        for i, filter in enumerate(filters):

            if filter.find("|") != -1:
                filter_name, expression = filter.split("|", 1)
            else:
                filter_name = filter
                expression = None


            span = SpanWdg(css="med")

            filter_wdg = Container.get_dict("widgets", filter_name)
            if not filter_wdg:
                filter_wdg = Common.create_from_class_path(filter_name)
                span.add(filter_wdg)
                div.add(span)
            else:
                span.add("%s: " % filter_wdg.get_name())

            if expression:
                name = filter_wdg.get_name()
                value = filter_wdg.get_value()
                if value != "":
                    expression = expression.replace("{name}", name)
                    expression = expression.replace("{value}", value)
                    search.add_where(expression)
            else:
                filter_wdg.alter_search(search)

            filter_wdg.set_name(filter_name)

            span = SpanWdg(css="med")
            span.add("%s: " % filter_name)
            span.add(filter_wdg)
            div.add(span)


        table = TableWdg(search_type, view)
        table.set_search(search)
        table.do_search()
        
        widget.add(table)
        return widget
Пример #51
0
 def get_script_wdg(self):
     table = TableWdg("prod/script")
     table.set_class("table")
     search = Search("prod/script")
     table.set_search(search)
     return table
Пример #52
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        search = Search("prod/sequence_instance")
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        all_instances = search.get_sobjects()
        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("prod/sequence_instance", "layout", css="minimal")
        table.set_show_property(False)
        table.set_show_header(False)
        table.set_sobjects(all_instances)
        table.set_search(search)
        widget.add(table)

        aux_data = SequenceInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        return widget
Пример #53
0
    def init(my):

        search = Search("sthpw/queue")
        search.add_order_by("priority desc")
        search.add_order_by("timestamp desc")

        widget = Widget()

        div = DivWdg(css="filter_box")

        span = SpanWdg(css="med")

        from pyasm.prod.web import SearchFilterWdg

        search_filter = SearchFilterWdg(columns=Queue.get_search_columns())
        search_filter.alter_search(search)
        span.add(search_filter)
        div.add(span)

        span = SpanWdg(css="med")
        priority_wdg = TextWdg("priority_search")
        priority_wdg.set_persistence()
        priority = priority_wdg.get_value()
        if priority:
            search.add_filter("priority", priority)
        span.add("Priority: ")
        span.add(priority_wdg)
        div.add(span)

        select = SelectWdg("queue_state")
        select.set_option("values", "|pending|locked|error|done")
        select.set_option("labels", "All|pending|locked|error|done")
        select.add_event("onchange", "document.form.submit()")
        select.set_persistence()

        span = SpanWdg(css="med")
        span.add("State: ")
        span.add(select)
        div.add(span)
        queue_state = select.get_value()
        if queue_state != "":
            search.add_filter("state", queue_state)

        user_select = SelectWdg("user_select")
        user_select.add_empty_option()

        user_search = Search("sthpw/login")
        user_select.set_search_for_options(user_search, "login", "login")
        user_select.add_event("onchange", "document.form.submit()")
        user_select.set_persistence()

        div.add("User: "******"":
            search.add_filter("login", queue_user)

        search_limit = SearchLimitWdg()
        search_limit.set_limit(10)
        div.add(search_limit)
        search_limit.alter_search(search)

        widget.add(div)

        sobjects = search.get_sobjects()

        table = TableWdg("sthpw/queue")
        table.set_sobjects(sobjects)
        widget.add(table)

        my.add(widget)
Пример #54
0
    def init(my):

        # get the args in the URL
        args = WebContainer.get_web().get_form_args()
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_id(search_type, search_id)

        main_div = DivWdg()
        main_div.add_style("width: 95%")
        main_div.add_style("float: right")
        my.add(main_div)

        
        if isinstance(sobject, Shot):

            content_id ='summary_story_%s' %sobject.get_id()
            title_id = 'story_head_%s' %sobject.get_id()
            story_div = DivWdg(id=content_id)
            story_div.add_style('display','block')
            
            story_head = HtmlElement.h3("Storyboard")
            my.add_title_style(story_head, title_id, content_id)
            
            main_div.add(story_head)
            main_div.add(story_div)

            storyboard_table = TableWdg("prod/storyboard", "summary", css='minimal')
            search = Search("prod/storyboard")
            search.add_filter( sobject.get_foreign_key(), sobject.get_code() )
            sobjects = search.get_sobjects()
            storyboard_table.set_sobjects(sobjects)
            story_div.add(storyboard_table)


        # add reference material
        search = Search("sthpw/connection")
        search.add_filter("src_search_type", search_type)
        search.add_filter("src_search_id", search_id)
        connections = search.get_sobjects()

        if connections:
            content_id ='summary_ref_%s' %sobject.get_id()
            title_id = 'ref_head_%s' %sobject.get_id()

            ref_head = HtmlElement.h3("Reference")
            my.add_title_style(ref_head, title_id, content_id)
            
            ref_div = DivWdg(id = content_id)
            ref_div.add_style('display','block')
            
            for connection in connections:
                thumb = ThumbWdg()
                thumb.set_name("snapshot")
                dst_search_type = connection.get_value("dst_search_type")
                dst_search_id = connection.get_value("dst_search_id")
                dst = Search.get_by_id(dst_search_type, dst_search_id)
                thumb.set_sobject(dst)
                ref_div.add(thumb)

            
            main_div.add(ref_head)
            main_div.add(ref_div)


       
        task_head = HtmlElement.h3("Tasks")
        content_id ='summary_task_%s' %sobject.get_id()
        title_id = 'task_head_%s' %sobject.get_id()
        my.add_title_style(task_head, title_id, content_id)
        
        main_div.add(task_head)

        task_div = DivWdg(id=content_id)
        task_div.add_style('display','block')
        
        main_div.add(task_div)
        
        search = Search("sthpw/task")
        #if process != "":
        #    search.add_filter("process", process)

        search.add_filter("search_type", search_type)
        search.add_filter("search_id", search_id)

        #search.set_limit(4)
        task_table = TableWdg("sthpw/task", "summary", css='minimal')
        task_table.set_id('sthpw/task%s' % search_id)
        task_table.set_search(search)
        task_div.add(task_table)

        content_id ='summary_hist_%s' %sobject.get_id()
        title_id = 'hist_head_%s' %sobject.get_id()
        hist_head = HtmlElement.h3("Checkin History")
        my.add_title_style(hist_head, title_id, content_id)
        
        hist_div = DivWdg(id=content_id)
        hist_div.add_style('display','block')
        
        
        main_div.add(hist_head)
        main_div.add(hist_div)
        from flash_asset_history_wdg import FlashAssetHistoryWdg
        history = FlashAssetHistoryWdg()
        hist_div.add(history)
        main_div.add(HtmlElement.br())
Пример #55
0
    def get_display(my):

        web = WebContainer.get_web()
        search_key = web.get_form_value("search_key")

        widget = Widget()

        sobject = Search.get_by_search_key(search_key)

        table = TableWdg(sobject.get_search_type(), "render")
        table.set_sobject(sobject)
        widget.add(table)

        # get all of the snapshots with a context render
        sobject_snapshot = Snapshot.get_latest_by_sobject(sobject, "render")
        if sobject_snapshot:
            search_type = sobject.get_search_type()
            search_id = sobject.get_value('search_id')

            render_snapshots = Snapshot.get_by_search_type(
                search_type, search_id, "render")

            table = TableWdg("sthpw/snapshot")
            table.set_sobjects(render_snapshots)
            widget.add(table)

        widget.add(HtmlElement.h3("Rendered Frames"))
        if sobject_snapshot:
            widget.add("Render version: v%0.3d" %
                       sobject_snapshot.get_value("version"))

        # get latest snapshot of the render
        renders = Render.get_all_by_sobject(sobject)
        if not renders:
            widget.add("<h4>No renders found</h4>")
            return widget

        render = renders[0]
        snapshot = Snapshot.get_latest_by_sobject(render, "render")
        if snapshot == None:
            widget.add("<h4>No snapshots found</h4>")
            return widget

        # get the images
        web_dir = snapshot.get_web_dir()
        lib_dir = snapshot.get_lib_dir()

        xml = snapshot.get_xml_value("snapshot")
        file_nodes = xml.get_nodes("snapshot/file")
        file_name = icon_file_name = ''
        frame_range = icon_frame_range = None

        for file_node in file_nodes:
            if Xml.get_attribute(file_node, 'type') == 'main':
                file_name, frame_range = my._get_frame_info(file_node, sobject)
            if Xml.get_attribute(file_node, 'type') == 'icon':
                icon_file_name, icon_frame_range = my._get_frame_info(
                    file_node, sobject)

        file_names = [file_name]
        icon_file_names = [icon_file_name]

        if "##" in file_name:
            file_names = FileGroup.expand_paths(file_name, frame_range)
        if "##" in icon_file_name:
            icon_file_names = FileGroup.expand_paths(icon_file_name, \
                icon_frame_range)

        div = DivWdg()
        for k in range(len(file_names)):
            file_name = file_names[k]

            # ignore frames that don't exist
            lib_path = "%s/%s" % (lib_dir, file_name)
            if not os.path.exists(lib_path):
                continue

            try:
                icon_file_name = icon_file_names[k]
            except IndexError:
                icon_file_name = file_names[k]

            file_path = "%s/%s" % (web_dir, file_name)
            icon_file_path = "%s/%s" % (web_dir, icon_file_name)

            img = HtmlElement.img(icon_file_path)
            img.set_attr("width", "60")
            img.add_event(
                "onmouseover",
                "hint_bubble.show(event,'Ctrl + Click to open in new window')")

            href = HtmlElement.href(img, file_path)
            div.add(href)

        widget.add(div)

        widget.add("<h3>Render History</h3>")
        widget.add(my.get_render_history(renders))

        return widget
Пример #56
0
 def get_render_history(my, renders):
     table = TableWdg("prod/render", "history")
     table.set_sobjects(renders)
     return table
Пример #57
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type, search_id))

        search = Search("prod/sequence_instance")
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        all_instances = search.get_sobjects()
        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("prod/sequence_instance", "layout", css="minimal")
        table.set_show_property(False)
        table.set_show_header(False)
        table.set_sobjects(all_instances)
        table.set_search(search)
        widget.add(table)

        aux_data = SequenceInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        return widget