示例#1
0
    def get_display(my):
        top = my.top

        search = Search("sthpw/snapshot")
        search.add_order_by("timestamp desc")
        search.add_filter("code", "61239PG")
        snapshot = search.get_sobject()

        xml = snapshot.get_value("snapshot")
        files = snapshot.get_all_file_objects()

        ref_snapshots = snapshot.get_all_ref_snapshots()

        table = Table()
        top.add(table)
        table.add_row()

        td = table.add_cell()
        canvas = my.get_canvas()
        td.add(canvas)

        table.add_row()
        td = table.add_cell()

        from tactic.ui.panel import TableLayoutWdg
        file_table = TableLayoutWdg(search_type="sthpw/file", view='table')
        td.add(file_table)
        table.set_sobjects(files)

        xml = []
        xml.append("<dependency>")
        for file in files:
            file_name = file.get_value("file_name")
            xml.append('''<node name="%s"/>''' % file_name)

        xml.append('''<node name="%s"/>''' % snapshot.get_code())
        for ref_snapshot in ref_snapshots:
            code = ref_snapshot.get_code()
            xml.append('''<node name="%s"/>''' % code)
            xml.append('''<connect from="%s" to="%s"/>''' %
                       (code, snapshot.get_code()))

        xml.append("</dependency>")

        xml = "\n".join(xml)

        div = DivWdg()
        top.add(div)
        div.add_behavior({
            'type':
            'load',
            'xml':
            xml,
            'cbjs_action':
            '''
        var group = 'dependency';
        var color = '#336655';
        spt.pipeline.import_xml(bvr.xml, group, color);
        '''
        })

        return top
示例#2
0
    def get_display(my):
        div = DivWdg()

        search_type = "prod/asset"

        search_type_obj = SearchType.get(search_type)
        title = search_type_obj.get_title()
        title_wdg = DivWdg()
        title_wdg.add_style("font-size: 1.8em")
        title_wdg.add("%s" % (title) )

        div.add(title_wdg)
        div.add(HtmlElement.hr())


        table = Table()
        div.add(table)
        table.set_max_width()

        table.add_row()

        from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement

        td = table.add_cell()
        td.add_style("width: 250px")
        td.add_style("vertical-align: top")
        td.add_style("border-right: solid 1px")
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[?] [x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Info")
        td.add(title)
        thumb = ThumbWdg()
        thumb.set_sobject(sobject)
        td.add(thumb)
        from pyasm.prod.web import AssetInfoWdg
        info = AssetInfoWdg()
        info.thumb = thumb
        info.set_sobject(sobject)
        td.add(info)

        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")
       
        # notes
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Notes")
        td.add(title)
        discussion_wdg = DiscussionWdg()
        discussion_wdg.preprocess()
        discussion_wdg.set_sobject(sobject)
        td.add(discussion_wdg)

        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")
 

        # tasks
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Custom Properties")
        td.add(title)
        search = Search("prod/custom_property")
        search.add_filter("search_type", "sample3d/book")
        sobjects = search.get_sobjects()
        table = TableLayoutWdg(search_type="prod/custom_property", view='table')
        table.set_sobjects(sobjects)
        td.add(table)

        div.add(HtmlElement.hr())
        div.add(HtmlElement.br(clear="all"))





        title_wdg = DivWdg()
        title_wdg.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title_wdg.add(x)
        #title_wdg.add_style("font-size: 1.5em")
        title_wdg.add("Detail" )
        div.add(title_wdg)
        div.add(HtmlElement.br())



        # TEST getting schema
        search_type = sobject.get_base_search_type()
        schema = Schema.get_by_sobject(sobject)

        



        # add a second table
        table = Table()
        table.set_max_width()


        # show the snapshots for this sobject
        search_type = "sthpw/snapshot"
        search = Search(search_type)
        search.add_sobject_filter(sobject)
        search.set_limit(50)
        sobjects = search.get_sobjects()


        table.add_row()
        nav_td = table.add_cell()
        nav_td.add_style("width: 100px")
        nav_td.add_style("vertical-align: top")
        #section_wdg = my.get_section_wdg(sobject)
        #nav_td.add( section_wdg )

        #from tactic.ui.panel import ManageViewPanelWdg
        #defined = ManageViewPanelWdg()
        from tactic.ui.panel import ManageViewWdg
        defined = ManageViewWdg()
        nav_td.add(defined)

        #content_wdg = TableLayoutWdg(search_type=search_type, view='table')
        #content_wdg.set_sobjects(sobjects)
        #content_td = table.add_cell()
        #content_td.set_id("sobject_relation")
        #content_td.add_style("display: table-cell")
        #content_td.add_style("vertical-align: top")
        #content_td.add(content_wdg)

        div.add(table)

        return div
示例#3
0
    def get_display(self):
        top = self.top

        search = Search("sthpw/snapshot")
        search.add_order_by("timestamp desc")
        search.add_filter("code", "61239PG")
        snapshot = search.get_sobject()

        xml = snapshot.get_value("snapshot")
        files = snapshot.get_all_file_objects()

        ref_snapshots = snapshot.get_all_ref_snapshots()


        table = Table()
        top.add(table)
        table.add_row()

        td = table.add_cell()
        canvas = self.get_canvas()
        td.add(canvas)

        table.add_row()
        td = table.add_cell()

        from tactic.ui.panel import TableLayoutWdg
        file_table = TableLayoutWdg(search_type="sthpw/file", view='table')
        td.add(file_table)
        table.set_sobjects(files)

        xml = []
        xml.append("<dependency>")
        for file in files:
            file_name = file.get_value("file_name")
            xml.append('''<node name="%s"/>''' % file_name)

        xml.append('''<node name="%s"/>''' % snapshot.get_code())
        for ref_snapshot in ref_snapshots:
            code = ref_snapshot.get_code()
            xml.append('''<node name="%s"/>''' % code)
            xml.append('''<connect from="%s" to="%s"/>''' % (code, snapshot.get_code() ))


        

        xml.append("</dependency>")

        xml = "\n".join(xml)



        div = DivWdg()
        top.add(div)
        div.add_behavior( {
        'type': 'load',
        'xml': xml,
        'cbjs_action': '''
        var group = 'dependency';
        var color = '#336655';
        spt.pipeline.import_xml(bvr.xml, group, color);
        '''
        } )


        return top
示例#4
0
    def get_display(self):
        div = DivWdg()

        search_type = "prod/asset"

        search_type_obj = SearchType.get(search_type)
        title = search_type_obj.get_title()
        title_wdg = DivWdg()
        title_wdg.add_style("font-size: 1.8em")
        title_wdg.add("%s" % (title))

        div.add(title_wdg)
        div.add(HtmlElement.hr())

        table = Table()
        div.add(table)
        table.set_max_width()

        table.add_row()

        from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement

        td = table.add_cell()
        td.add_style("width: 250px")
        td.add_style("vertical-align: top")
        td.add_style("border-right: solid 1px")
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[?] [x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Info")
        td.add(title)
        thumb = ThumbWdg()
        thumb.set_sobject(sobject)
        td.add(thumb)
        from pyasm.prod.web import AssetInfoWdg
        info = AssetInfoWdg()
        info.thumb = thumb
        info.set_sobject(sobject)
        td.add(info)

        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")

        # notes
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Notes")
        td.add(title)
        discussion_wdg = DiscussionWdg()
        discussion_wdg.preprocess()
        discussion_wdg.set_sobject(sobject)
        td.add(discussion_wdg)

        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")

        # tasks
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Custom Properties")
        td.add(title)
        search = Search("prod/custom_property")
        search.add_filter("search_type", "sample3d/book")
        sobjects = search.get_sobjects()
        table = TableLayoutWdg(search_type="prod/custom_property",
                               view='table')
        table.set_sobjects(sobjects)
        td.add(table)

        div.add(HtmlElement.hr())
        div.add(HtmlElement.br(clear="all"))

        title_wdg = DivWdg()
        title_wdg.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title_wdg.add(x)
        #title_wdg.add_style("font-size: 1.5em")
        title_wdg.add("Detail")
        div.add(title_wdg)
        div.add(HtmlElement.br())

        # TEST getting schema
        search_type = sobject.get_base_search_type()
        schema = Schema.get_by_sobject(sobject)

        # add a second table
        table = Table()
        table.set_max_width()

        # show the snapshots for this sobject
        search_type = "sthpw/snapshot"
        search = Search(search_type)
        search.add_sobject_filter(sobject)
        search.set_limit(50)
        sobjects = search.get_sobjects()

        table.add_row()
        nav_td = table.add_cell()
        nav_td.add_style("width: 100px")
        nav_td.add_style("vertical-align: top")
        #section_wdg = self.get_section_wdg(sobject)
        #nav_td.add( section_wdg )

        #from tactic.ui.panel import ManageViewPanelWdg
        #defined = ManageViewPanelWdg()
        from tactic.ui.panel import ManageViewWdg
        defined = ManageViewWdg()
        nav_td.add(defined)

        #content_wdg = TableLayoutWdg(search_type=search_type, view='table')
        #content_wdg.set_sobjects(sobjects)
        #content_td = table.add_cell()
        #content_td.set_id("sobject_relation")
        #content_td.add_style("display: table-cell")
        #content_td.add_style("vertical-align: top")
        #content_td.add(content_wdg)

        div.add(table)

        return div