def execute(my): sobject = my.kwargs.get("sobject") if sobject: sobjects = [sobject] else: search_key = my.kwargs.get("search_key") if search_key: search_keys = [search_key] else: search_keys = my.kwargs.get("search_keys") if search_keys: sobjects = [] for search_key in search_keys: sobject = Search.get_by_search_key(search_key) sobjects.append(sobject) else: source = my.kwargs.get("source") if source == 'clipboard': sobjects = Clipboard.get_selected() dst_search_type = my.kwargs.get("dst_search_type") if not dst_search_type: dst_search_type = sobjects[0].get_base_search_type() context = my.kwargs.get("context") #if not context: # context = "publish" for sobject in sobjects: my.copy_sobject(sobject, dst_search_type, context)
def get_display(self): clipboards = Clipboard.get_all("select") from layout_wdg import TableWdg widget = Widget() widget.add("<h3>Clipboard</h3>") table = TableWdg("sthpw/clipboard", self.view) table.set_sobjects(clipboards) widget.add(table) return widget
def get_display(self): clipboards = Clipboard.get_all("select") from layout_wdg import TableWdg widget = Widget() widget.add( "<h3>Clipboard</h3>") table = TableWdg("sthpw/clipboard", self.view) table.set_sobjects(clipboards) widget.add(table) return widget
def get_clipboard_wdg(my): widget = Widget() # get all of the clipboard items value = "select" clipboards = Clipboard.get_all(value) table = TableWdg("sthpw/clipboard", "select") table.set_sobjects(clipboards) widget.add(table) return widget
def get_display(self): widget = Widget() checkbox = CheckboxWdg(self.get_input_name()) widget.add(checkbox) where = self.get_option("where") count = Clipboard.get_count(where=where) widget.add("Copy from clipboard: ( %s items )" % count) return widget
def execute(my): search_keys = my.kwargs.get("search_keys") if search_keys: sobjects = [] for search_key in search_keys: sobject = Search.get_by_search_key(search_key) sobjects.append(sobject) else: source = my.kwargs.get("source") if source == 'clipboard': sobjects = Clipboard.get_selected() dst_search_type = my.kwargs.get("dst_search_type")
def execute(self): name = self.get_input_name() web = WebContainer.get_web() if not web.get_form_value(self.get_input_name()): return clipboard_items = Clipboard.get_all(category='select') sobject = self.sobject context = self.get_option("context") if not context: context = 'reference' for item in clipboard_items: parent = item.get_parent() SObjectConnection.create(parent, sobject, context)
def execute(self): name = self.get_input_name() web = WebContainer.get_web() if not web.get_form_value( self.get_input_name() ): return clipboard_items = Clipboard.get_all(category='select') sobject = self.sobject context = self.get_option("context") if not context: context = 'reference' for item in clipboard_items: parent = item.get_parent() SObjectConnection.create(parent, sobject, context)
def get_watchlist_wdg(my): widget = Widget() WebContainer.register_cmd("pyasm.widget.ClipboardMoveToCategoryCbk") div = DivWdg(css="filter_box") select = FilterSelectWdg("clipboard_category",\ label="Current Watch List: ", css='med') select.set_option("values", "watch_list|watch_list2|watch_list3") select.add_empty_option("-- Any Category --") div.add(select) search_type_sel = SearchTypeFilterWdg() div.add(search_type_sel) widget.add(div) div = DivWdg() from pyasm.prod.web import ProdIconSubmitWdg copy = ProdIconSubmitWdg(ClipboardMoveToCategoryCbk.COPY_BUTTON) copy.add_style("float: right") #clear = ProdIconSubmitWdg("Clear All") #clear.add_style("float: right") div.add(copy) #div.add(clear) div.add(HtmlElement.br(2)) widget.add(div) # get all of the clipboard items value = select.get_value() search = Clipboard.get_search(category=value) search_type_sel.alter_search(search) table = TableWdg("sthpw/clipboard", "watch_list") table.set_search(search) widget.add(table) return widget
def execute(my): search_keys = my.kwargs.get("search_keys") if search_keys: sobjects = [] for search_key in search_keys: sobject = Search.get_by_search_key(search_key) sobjects.append(sobject) else: source = my.kwargs.get("source") if source == 'clipboard': sobjects = Clipboard.get_selected() dst_search_type = my.kwargs.get("dst_search_type") context = my.kwargs.get("context") #if not context: # context = "publish" for sobject in sobjects: my.copy_sobject(sobject, dst_search_type, context)
def execute(self): sobject = self.kwargs.get("sobject") if sobject: sobjects = [sobject] else: search_key = self.kwargs.get("search_key") if search_key: search_keys = [search_key] else: search_keys = self.kwargs.get("search_keys") if search_keys: sobjects = [] for search_key in search_keys: sobject = Search.get_by_search_key(search_key) sobjects.append(sobject) else: source = self.kwargs.get("source") if source == 'clipboard': sobjects = Clipboard.get_selected() dst_search_type = self.kwargs.get("dst_search_type") if not dst_search_type: dst_search_type = sobjects[0].get_base_search_type() context = self.kwargs.get("context") #if not context: # context = "publish" for sobject in sobjects: self.copy_sobject(sobject, dst_search_type, context)
def execute(my): search_keys = my.kwargs.get("search_keys") Clipboard.add_to_selected(search_keys)
def execute(self): clipboard_items = Clipboard.get_all(category="select") for item in clipboard_items: item.set_value("category", self.category) item.commit()
def execute(self): search_keys = self.kwargs.get("search_keys") Clipboard.clear_selected() Clipboard.add_to_selected(search_keys)
def execute(self): search_keys = self.kwargs.get("search_keys") print "search_keys: ", search_keys for search_key in search_keys: sobject = Search.get_by_search_key(search_key) Clipboard.reference_selected(sobject)