Pass through to provider BookAdminSession.get_book_form_for_update
1891
def get_book_form(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.get_bin_form_for_update_template
        # This method might be a bit sketchy. Time will tell.
        if isinstance(args[-1], list) or 'book_record_types' in kwargs:
            return self.get_book_form_for_create(*args, **kwargs)
        else:
            return self.get_book_form_for_update(*args, **kwargs)
439394
def get_bin_form(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.get_bin_form_for_update_template
        # This method might be a bit sketchy. Time will tell.
        if isinstance(args[-1], list) or 'bin_record_types' in kwargs:
            return self.get_bin_form_for_create(*args, **kwargs)
        else:
            return self.get_bin_form_for_update(*args, **kwargs)
195118
def save_gradebook(self, gradebook_form, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.update_bin
        if gradebook_form.is_for_update():
            return self.update_gradebook(gradebook_form, *args, **kwargs)
        else:
            return self.create_gradebook(gradebook_form, *args, **kwargs)
710673
def request_param_update(self, complete_name):
        
        self.param_updater.request_param_update(
            self.toc.get_element_id(complete_name))
670516
def get_log_entry_form(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceAdminSession.get_resource_form_for_update
        # This method might be a bit sketchy. Time will tell.
        if isinstance(args[-1], list) or 'log_entry_record_types' in kwargs:
            return self.get_log_entry_form_for_create(*args, **kwargs)
        else:
            return self.get_log_entry_form_for_update(*args, **kwargs)
1191212
def update_book(self, id, body, doc_type='book'):
        ''' 
        '''
        # note that we are NOT overwriting all the _source, just merging
        book = self.get_book_by_id(id)
        book['_source'].update(body)
        validated = validate_book(book['_source'])
        ret = self.es.index(index=self.index_name, id=id,
                            doc_type=doc_type, body=validated, version=book['_version'])
        return ret
667559
function getEditForm($id = null, $fields = null) {
		$record = null;

		if(!$id){
			$id = $this->getCurrentPageID();
		}

		if ($id && $id != "root") {
			$record = $this->getRecord($id);
		}

		if ($record) {
			$fields = $record->getCMSFields();

			// If we're editing an external source or item, and it can be imported
			// then add the "Import" tab.
			$isSource = $record instanceof ExternalContentSource;
			$isItem = $record instanceof ExternalContentItem;

			if (($isSource || $isItem) && $record->canImport()) {
				$allowedTypes = $record->allowedImportTargets();
				if (isset($allowedTypes['sitetree'])) {
					$fields->addFieldToTab('Root.Import', new TreeDropdownField("MigrationTarget", _t('ExternalContent.MIGRATE_TARGET', 'Page to import into'), 'SiteTree'));
				}

				if (isset($allowedTypes['file'])) {
					$fields->addFieldToTab('Root.Import', new TreeDropdownField("FileMigrationTarget", _t('ExternalContent.FILE_MIGRATE_TARGET', 'Folder to import into'), 'Folder'));
				}

				$fields->addFieldToTab('Root.Import', new CheckboxField("IncludeSelected", _t('ExternalContent.INCLUDE_SELECTED', 'Include Selected Item in Import')));
				$fields->addFieldToTab('Root.Import', new CheckboxField("IncludeChildren", _t('ExternalContent.INCLUDE_CHILDREN', 'Include Child Items in Import'), true));

				$duplicateOptions = array(
					ExternalContentTransformer::DS_OVERWRITE => ExternalContentTransformer::DS_OVERWRITE,
					ExternalContentTransformer::DS_DUPLICATE => ExternalContentTransformer::DS_DUPLICATE,
					ExternalContentTransformer::DS_SKIP => ExternalContentTransformer::DS_SKIP,
				);

				$fields->addFieldToTab('Root.Import', new OptionsetField(
						"DuplicateMethod",
						_t('ExternalContent.DUPLICATES', 'Select how duplicate items should be handled'),
						$duplicateOptions,
						$duplicateOptions[ExternalContentTransformer::DS_SKIP]
					)
				);

				if (class_exists('QueuedJobDescriptor')) {
					$repeats = array(
						0		=> 'None',
						300		=> '5 minutes',
						900		=> '15 minutes',
						1800	=> '30 minutes',
						3600	=> '1 hour',
						33200	=> '12 hours',
						86400	=> '1 day',
						604800	=> '1 week',
					);
					$fields->addFieldToTab('Root.Import', new DropdownField('Repeat', 'Repeat import each ', $repeats));
				}

				$migrateButton = FormAction::create('migrate', _t('ExternalContent.IMPORT', 'Start Importing'))
					->setAttribute('data-icon', 'arrow-circle-double')
					->setUseButtonTag(true);

				$fields->addFieldToTab('Root.Import', new LiteralField('MigrateActions', "<div class='Actions'>{$migrateButton->forTemplate()}</div>"));
			}

			$fields->push($hf = new HiddenField("ID"));
			$hf->setValue($id);

			$fields->push($hf = new HiddenField("Version"));
			$hf->setValue(1);

			$actions = new FieldList();

			$actions = CompositeField::create()->setTag('fieldset')->addExtraClass('ss-ui-buttonset');
			$actions = new FieldList($actions);

			// Only show save button if not 'assets' folder
			if ($record->canEdit()) {
				$actions->push(
					FormAction::create('save',_t('ExternalContent.SAVE','Save'))
						->addExtraClass('ss-ui-action-constructive')
						->setAttribute('data-icon', 'accept')
						->setUseButtonTag(true)
				);
			}

			if($isSource && $record->canDelete()){
				$actions->push(
					FormAction::create('delete',_t('ExternalContent.DELETE','Delete'))
						->addExtraClass('delete ss-ui-action-destructive')
						->setAttribute('data-icon', 'decline')
						->setUseButtonTag(true)
				);
			}




			$form = new Form($this, "EditForm", $fields, $actions);
			if ($record->ID) {
				$form->loadDataFrom($record);
			} else {
				$form->loadDataFrom(array(
					"ID" => "root",
					"URL" => Director::absoluteBaseURL() . self::$url_segment,
				));
			}

			if (!$record->canEdit()) {
				$form->makeReadonly();
			}

		} else {
			// Create a dummy form
			$fields = new FieldList();
			$form = new Form($this, "EditForm", $fields, new FieldList());
		}

		$form->addExtraClass('cms-edit-form center ss-tabset ' . $this->BaseCSSClasses());
		$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
		$form->setAttribute('data-pjax-fragment', 'CurrentForm');
		$this->extend('updateEditForm', $form);

		return $form;
	}
754722
def get_form_kwargs(self, **kwargs):
        '''
        
        '''
        kwargs = super(BookPrivateLessonView, self).get_form_kwargs(**kwargs)
        kwargs['user'] = self.request.user if hasattr(self.request,'user') else None
        return kwargs
1035946
def save_item(self, item_form, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceAdminSession.update_resource
        if item_form.is_for_update():
            return self.update_item(item_form, *args, **kwargs)
        else:
            return self.create_item(item_form, *args, **kwargs)
761424
def update_context(app, pagename, templatename, context, doctree):  # pylint: disable=unused-argument
    
    context['feedback_form_url'] = feedback_form_url(app.config.project, pagename)
297647
def get_catalog_form(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.get_bin_form_for_update_template
        # This method might be a bit sketchy. Time will tell.
        if isinstance(args[-1], list) or 'catalog_record_types' in kwargs:
            return self.get_catalog_form_for_create(*args, **kwargs)
        else:
            return self.get_catalog_form_for_update(*args, **kwargs)
10955
def get_gradebook_column_form(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceAdminSession.get_resource_form_for_update
        # This method might be a bit sketchy. Time will tell.
        if isinstance(args[-1], list) or 'gradebook_column_record_types' in kwargs:
            return self.get_gradebook_column_form_for_create(*args, **kwargs)
        else:
            return self.get_gradebook_column_form_for_update(*args, **kwargs)
275769
def update(self, **kwargs):
        ""
        kw = dict(index=self.name, doc_type=self.doc_type, ignore=[404])
        kw.update(**kwargs)
        return self._client.update(**kw)
769998
private void doUpdateDatasource() throws PageException {
	int allow = (getBoolV("allowed_select", false) ? DataSource.ALLOW_SELECT : 0) + (getBoolV("allowed_insert", false) ? DataSource.ALLOW_INSERT : 0)
		+ (getBoolV("allowed_update", false) ? DataSource.ALLOW_UPDATE : 0) + (getBoolV("allowed_delete", false) ? DataSource.ALLOW_DELETE : 0)
		+ (getBoolV("allowed_alter", false) ? DataSource.ALLOW_ALTER : 0) + (getBoolV("allowed_drop", false) ? DataSource.ALLOW_DROP : 0)
		+ (getBoolV("allowed_revoke", false) ? DataSource.ALLOW_REVOKE : 0) + (getBoolV("allowed_grant", false) ? DataSource.ALLOW_GRANT : 0)
		+ (getBoolV("allowed_create", false) ? DataSource.ALLOW_CREATE : 0);
	if (allow == 0) allow = DataSource.ALLOW_ALL;

	String cn = getString("admin", action, "classname");
	if ("com.microsoft.jdbc.sqlserver.SQLServerDriver".equals(cn)) {
	    cn = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
	}

	ClassDefinition cd = new ClassDefinitionImpl(cn, getString("bundleName", null), getString("bundleVersion", null), config.getIdentification());

	// customParameterSyntax
	Struct sct = getStruct("customParameterSyntax", null);
	ParamSyntax ps = (sct != null && sct.containsKey("delimiter") && sct.containsKey("separator")) ? ParamSyntax.toParamSyntax(sct) : ParamSyntax.DEFAULT;

	//
	boolean literalTimestampWithTSOffset = getBoolV("literalTimestampWithTSOffset", false);
	boolean alwaysSetTimeout = getBoolV("alwaysSetTimeout", false);

	String id = getString("id", null);
	String dsn = getString("admin", action, "dsn");
	String name = getString("admin", action, "name");
	String newName = getString("admin", action, "newName");
	String username = getString("admin", action, "dbusername");
	String password = getString("admin", action, "dbpassword");
	String host = getString("host", "");
	String timezone = getString("timezone", "");
	String database = getString("database", "");
	int port = getInt("port", -1);
	int connLimit = getInt("connectionLimit", -1);
	int connTimeout = getInt("connectionTimeout", -1);
	long metaCacheTimeout = getLong("metaCacheTimeout", 60000);
	boolean blob = getBoolV("blob", false);
	boolean clob = getBoolV("clob", false);
	boolean validate = getBoolV("validate", false);
	boolean storage = getBoolV("storage", false);
	boolean verify = getBoolV("verify", true);
	Struct custom = getStruct("custom", new StructImpl());
	String dbdriver = getString("dbdriver", "");

	// config.getDatasourceConnectionPool().remove(name);
	DataSource ds = null;
	try {
	    ds = new DataSourceImpl(config, name, cd, host, dsn, database, port, username, password, null, connLimit, connTimeout, metaCacheTimeout, blob, clob, allow, custom,
		    false, validate, storage, null, dbdriver, ps, literalTimestampWithTSOffset, alwaysSetTimeout, config.getLog("application"));
	}
	catch (Exception e) {
	    throw Caster.toPageException(e);
	}

	if (verify) _doVerifyDatasource(ds, username, password);
	// print.out("limit:"+connLimit);
	admin.updateDataSource(id, name, newName, cd, dsn, username, password, host, database, port, connLimit, connTimeout, metaCacheTimeout, blob, clob, allow, validate, storage,
		timezone, custom, dbdriver, ps, literalTimestampWithTSOffset, alwaysSetTimeout);
	store();
	adminSync.broadcast(attributes, config);
    }
1086254
def generate_update_view(self):
        """"""

        name = model_class_form(self.model + 'UpdateView')
        update_args = dict(
            form_class=self.get_actual_form('update'),
            model=self.get_model_class,
            template_name=self.get_template('update'),
            permissions=self.view_permission('update'),
            permission_required=self.check_permission_required,
            login_required=self.check_login_required,
            inlineformset=self.inlineformset,
            custom_form=self.createupdate_forms or self.custom_modelform,
            success_url=reverse_lazy('{}-{}-list'.format(self.app, self.custom_postfix_url)),
            custom_postfix_url=self.custom_postfix_url
        )

        parent_classes = [self.get_createupdate_mixin(), UpdateView]
        if self.custom_update_view_mixin:
            parent_classes.insert(0, self.custom_update_view_mixin)

        update_class = type(
            name,
            tuple(parent_classes),
            update_args
        )
        self.classes[name] = update_class
        return update_class
1229224
private void doUpdateScope() throws PageException {

	admin.updateScopeCascadingType(getString("admin", action, "scopeCascadingType"));
	admin.updateAllowImplicidQueryCall(getBoolObject("admin", action, "allowImplicidQueryCall"));
	admin.updateMergeFormAndUrl(getBoolObject("admin", action, "mergeFormAndUrl"));
	admin.updateSessionManagement(getBoolObject("admin", action, "sessionManagement"));
	admin.updateClientManagement(getBoolObject("admin", action, "clientManagement"));
	admin.updateDomaincookies(getBoolObject("admin", action, "domainCookies"));
	admin.updateClientCookies(getBoolObject("admin", action, "clientCookies"));
	// admin.updateRequestTimeout(getTimespan("admin",action,"requestTimeout"));
	admin.updateClientTimeout(getTimespan("admin", action, "clientTimeout"));
	admin.updateSessionTimeout(getTimespan("admin", action, "sessionTimeout"));
	admin.updateClientStorage(getString("admin", action, "clientStorage"));
	admin.updateSessionStorage(getString("admin", action, "sessionStorage"));
	admin.updateApplicationTimeout(getTimespan("admin", action, "applicationTimeout"));
	admin.updateSessionType(getString("admin", action, "sessionType"));
	admin.updateLocalMode(getString("admin", action, "localMode"));
	admin.updateCGIReadonly(getBoolObject("admin", action, "cgiReadonly"));
	store();
	adminSync.broadcast(attributes, config);
    }
723248
def submit_form(self, form, submit=None, **kwargs):
        
        # Get HTTP verb
        method = form.method.upper()

        # Send request
        url = self._build_url(form.action) or self.url
        payload = form.serialize(submit=submit)
        serialized = payload.to_requests(method)
        send_args = self._build_send_args(**kwargs)
        send_args.update(serialized)
        response = self.session.request(method, url, **send_args)

        # Update history
        self._update_state(response)