edit an item instance
@requiresRight id READ
550173
public function editItem()
    {
        $this->defaultData();

        $itemClass = $this->getCurrentClass();
        $item = $this->getCurrentInstance();

        if(!$this->isLocked($item, 'item_locked.tpl')){

            // my lock
            $lock = LockManager::getImplementation()->getLockData($item);
            if (!is_null($lock) && $lock->getOwnerId() == $this->getSession()->getUser()->getIdentifier()) {
                $this->setData('lockDate', $lock->getCreationTime());
                $this->setData('id', $item->getUri());
            }

            $formContainer = new SignedFormInstance($itemClass, $item);
            $myForm = $formContainer->getForm();

            $itemUri = $item->getUri();
            if ($this->hasWriteAccess($itemUri)) {
                if($myForm->isSubmited() && $myForm->isValid()){
                    $this->validateInstanceRoot($itemUri);

                    $properties = $myForm->getValues();
                    if (array_key_exists('warning', $properties)) {
                        $this->logWarning('Warning property is still in use', ['backend']);
                        unset($properties['warning']);
                    }

                    //bind item properties and set default content:
                    $binder = new tao_models_classes_dataBinding_GenerisFormDataBinder($item);
                    $item = $binder->bind($properties);

                    $this->getEventManager()->trigger(new ItemUpdatedEvent($item->getUri(), $properties));
                    $this->getEventManager()->trigger(new ItemRdfUpdatedEvent($item->getUri(), $properties));

                    //if item label has been changed, do not use getLabel() to prevent cached value from lazy loading
                    $label = $item->getOnePropertyValue(new core_kernel_classes_Property(OntologyRdfs::RDFS_LABEL));
                    $this->setData("selectNode", tao_helpers_Uri::encode($item->getUri()));
                    $this->setData('label', ($label != null) ? $label->literal : '');
                    $this->setData('message', __('Item saved'));
                    $this->setData('reload', true);
                }
            } else {
                $myForm->setActions([]);
            }

            $currentModel = $this->getClassService()->getItemModel($item);
            $hasPreview = false;
            $hasModel   = false;
            if(!empty($currentModel)) {
                $hasModel = true;
                $isDeprecated = $this->getClassService()->hasModelStatus($item, array(ItemModelStatus::INSTANCE_DEPRECATED));
                $hasPreview = !$isDeprecated && $this->getClassService()->hasItemContent($item);
            }

            $updatedAt = $this->getServiceLocator()->get(ResourceWatcher::SERVICE_ID)->getUpdatedAt($item);
            $this->setData('isPreviewEnabled', $hasPreview);
            $this->setData('updatedAt', $updatedAt);
            $this->setData('isAuthoringEnabled', $hasModel);

            $this->setData('formTitle', __('Edit Item'));
            $this->setData('myForm', $myForm->render());

            $this->setView('Items/editItem.tpl');
        }
    }
280879
function(index, item)
	{
		var length = this.length;
		
		var replaced = this.source[index];
		this.__updateBindings(replaced, false);
		
		this.source[index] = item;
		this.__updateBindings(item);
		
		if (this.length > length)
		{
			this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.ADD));
			this.dispatchChange('length');
		}
		
		this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.CHANGE, {item:item}));
		
		return replaced;
	}
1265520
protected function prepareEditorTpl($id = null)
    {
        $mode = $id === null ? 'create' : 'edit';
        /** @var \Colibri\Database\Model $item */
        $item = new $this->itemClass();

        // if must save any changes
        if ($_POST) {
            $this->save($id, $item);

            return;
        }

        $this->loadTemplate($mode);

        if ($mode == 'edit') {
            $item->load($id);
        }

        $this->initItem($item, $id);

        if ($_POST) { // if post data not valid ($_POST && isset($this->template->vars['errors']))
            $this->fillWithUserValues($item);
        }

        $this->template->vars['mode']            = $mode;
        $this->template->vars[$this->itemTplVar] = $item;
    }
1154252
function(item, fieldName) {
			if (fieldName === "FriendlyPath") { //$NON-NLS-0$
				// Just update the "is valid" column
				var rowNode = document.getElementById(this.myTree._treeModel.getId(item));
				var oldCell = lib.$(".isValidCell", rowNode); //$NON-NLS-0$
				var col_no = lib.$$array("td", rowNode).indexOf(oldCell); //$NON-NLS-0$
				var cell = this.renderer.getIsValidCell(col_no, item, rowNode);
				// replace oldCell with cell
				oldCell.parentNode.replaceChild(cell, oldCell);
			}
		}
606619
function removeThis()
    {
        $itemOptionList = eZProductCollectionItemOption::fetchList( $this->attribute( 'id' ) );

        $db = eZDB::instance();
        $db->begin();
        foreach( $itemOptionList as $itemOption )
        {
            $itemOption->remove();
        }
        $this->remove();
        $db->commit();
    }
786476
def edit(name)
      Editor.new(Looksee.editor).edit(lookup_path.object, name)
    end
74385
function initAceEditor(themeId, folderName, fileName, text, mode) {
        hideImageHolder();
        $("#" + editorId).show();
        var doc = new Document(text);
        var session = new EditSession(doc, "ace/mode/" + mode);
        session.setUndoManager(new UndoManager());
        editor.setSession(session);

        //bind change event for text changes in opened file and save them.
        doc.on('change', function (e) {
            // e.type, etc
            console.log(e);
            saveFileChanges(themeId, folderName, fileName, doc.getValue());
        });
    }
178129
private String updateKeeIfRequired(Context context, @Nullable String kee) throws SQLException {
    if (kee == null || kee.length() <= VarcharColumnDef.UUID_SIZE) {
      return kee;
    }

    String newKee = uuidFactory.create();
    context.prepareUpsert("update permission_templates set kee=? where kee=?")
      .setString(1, newKee)
      .setString(2, kee)
      .execute();
    return newKee;
  }
725878
def _to_edit_kind(self, post_uid):
        '''
        
        '''
        if self.userinfo and self.userinfo.role[1] >= '3':
            pass
        else:
            self.redirect('/')
        postinfo = MPost.get_by_uid(post_uid, )
        json_cnt = json.dumps(postinfo.extinfo, indent=True)
        kwd = {}
        self.render('man_info/post_kind.html',
                    postinfo=postinfo,
                    sig_dic=router_post,
                    userinfo=self.userinfo,
                    json_cnt=json_cnt,
                    kwd=kwd)
688893
def edit_choice(self, choice_id, text, inline_region, name=''):
        """"""
        if inline_region not in self.my_osid_object_form._my_map['choices']:
            raise IllegalState('that inline region does not exist')
        for choice in self.my_osid_object_form._my_map['choices'][inline_region]:
            if choice['id'] == choice_id:
                if choice['text'] != text:
                    choice['text'] = text
                if choice['name'] != name and name != '':
                    choice['name'] = name
                break
120381
def smart_listing_item *args
      options = args.extract_options!
      if [:create, :create_continue, :destroy, :edit, :new, :remove, :update].include?(args[1])
        name = args[0]
        item_action = args[1]
        object = args[2]
        partial = args[3]
      else
        name = (options[:name] || controller_name).to_sym
        item_action = args[0]
        object = args[1]
        partial = args[2]
      end
      type = object.class.name.downcase.to_sym if object
      id = options[:id] || object.try(:id)
      valid = options[:valid] if options.has_key?(:valid)
      object_key = options.delete(:object_key) || :object
      new = options.delete(:new)

      render(:partial => "smart_listing/item/#{item_action.to_s}", :locals => {:name => name, :id => id, :valid => valid, :object_key => object_key, :object => object, :part => partial, :new => new})
    end
20668
def editTemplate(id, data):
        
        conn = Qubole.agent()
        return conn.put(Template.element_path(id), data)
488427
void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {

        if (!event.isCtrlKey() && !event.isShiftKey()) {

            changeValueIfNotMultiSelect(itemId);

            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (TableProperty.Icon.equals(propertyId))) {

                m_menu.setEntries(getMenuEntries(), (Set<String>)getValue());
                m_menu.openForTable(event, itemId, propertyId, this);
            } else if (event.getButton().equals(MouseButton.LEFT) && TableProperty.UserName.equals(propertyId)) {
                showUserInfoWindow(((Set<String>)getValue()).iterator().next());
            }
        }
    }
843661
public void replaceItem(CmsListItem item) {

        CmsListItem oldItem = getList().getItem(item.getId());
        if (oldItem != null) {
            int index = getList().getWidgetIndex(oldItem);
            getList().removeItem(oldItem);
            if (index >= getList().getWidgetCount()) {
                getList().addItem(item);
            } else {
                getList().insertItem(item, index);
            }
        }
    }
445173
function initModelRead (args) {
    var controller = this
    var model = this.model
    // if model does not have id column then cannot use default controller
    if (!model.columnName('id')) {
        return
    }
    // make sure args is object
    args = requireValidOptionalObject(args)
    // make sure read is defined
    args.read = requireValidOptionalObject(args.read)
    // make sure query args are object
    var queryArgs = requireValidOptionalObject(args.read.query)
    // if specific with records not specified then default to model relations
    if (!defined(queryArgs.with)) {
        queryArgs.with = {}
        // load related records
        _.each(model.relations, (relation, relationName) => {
            // add all related models - limit results to 20
            queryArgs.with[relationName] = {
                limit: 20,
            }
        })
    }
    // if with is false do not load any related records
    if (queryArgs.with === false) {
        delete queryArgs.with;
    }
    // get role
    var role = args.defaultRole || 'all'
    // save forms
    var forms = args.read && args.read.forms
    // index inputs
    var input = {
        // get current revision of instance
        current: 'query.current',
        // get record even if deleted
        deleted: 'query.deleted',
        // instance id
        id: 'params.id',
    }
    // links to display at top of page
    var links
    // use links from read view
    if (Array.isArray(args.read.links)) {
        links = _.cloneDeep(args.read.links)
    }
    // use global controller links
    else if (Array.isArray(args.links)) {
        links = _.cloneDeep(args.links)
    }
    // set default links
    else {
        links = []
    }
    // create path if it does not exist
    if (!this.paths['/:id']) {
        this.paths['/:id'] = {}
    }
    // add handler for GET /:id to get model instance
    this.paths['/:id'].get = [
        {
            before: function (args) {
                return beforeRead(controller, args, forms, queryArgs)
            },
            input: input,
            method: function (args) {
                // format response
                return read(controller, args, links)
            },
            methodName: 'read',
            role: role,
            template: 'instance',
        },
    ]
}
582018
def currentItemChanged(self, _currentIndex=None, _previousIndex=None):
        
        self.editor.clear()
        self.editor.setTextColor(QCOLOR_REGULAR)

        regItem = self.getCurrentRegItem()

        if regItem is None:
            return

        if self._importOnSelect and regItem.successfullyImported is None:
            self.importRegItem(regItem)

        if regItem.successfullyImported is None:
            self.editor.setTextColor(QCOLOR_NOT_IMPORTED)
            self.editor.setPlainText('<plugin not yet imported>')
        elif regItem.successfullyImported is False:
            self.editor.setTextColor(QCOLOR_ERROR)
            self.editor.setPlainText(str(regItem.exception))
        elif regItem.descriptionHtml:
            self.editor.setHtml(regItem.descriptionHtml)
        else:
            self.editor.setPlainText(regItem.docString)
1319504
public function editItemClass()
    {
        $this->defaultData();

        $clazz = $this->getClass($this->getRequestParameter('id'));

        if($this->hasRequestParameter('property_mode')){
            $this->setSessionAttribute('property_mode', $this->getRequestParameter('property_mode'));
        }

        $myForm = $this->getClassForm($clazz, $this->getClassService()->getRootClass());

        if ($this->hasWriteAccess($clazz->getUri())) {
            if($myForm->isSubmited()){
                if($myForm->isValid()){
                    if($clazz instanceof core_kernel_classes_Resource){
                        $this->setData("selectNode", tao_helpers_Uri::encode($clazz->getUri()));
                    }
                    $this->setData('message', __('Class schema saved'));
                    $this->setData('reload', false);
                }
            }
        } else {
            $myForm->setActions(array());
        }
        $this->setData('formTitle', __('Manage item class schema'));
        $this->setData('myForm', $myForm->render());
        $this->setView('form.tpl', 'tao');
    }