SaveWebForm

Синтаксис

bool SaveWebForm(WebFormId tWebForm, SaveWebFormArg tArg)

Параметры

tWebForm. Моникёр открытого экземпляра веб-формы.

tArg. Параметры выполнения операции.

Описание

Операция SaveWebForm сохраняет изменения веб-формы.

Комментарии

Для выполнения операции укажите в поле tWebForm моникёр открытого экземпляра веб-формы, а в поле tArg.meta обновлённые метаданные, которые необходимо сохранить. Моникёр можно получить с помощью операции OpenWebForm.

Результатом операции будет логическое значение true, если сохранение изменений веб-формы завершилось успешно.

Пример

Ниже приведён пример сохранения изменений веб-формы. В запросе передаётся моникёр открытого экземпляра веб-формы и обновлённый код формы. В ответе возвращается признак успешного сохранения изменений.

SOAP-запрос:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SaveWebForm xmlns="http://www.fsight.ru/PP.SOM.Som">
<tWebForm xmlns="">
  <id>JAIKPLIJFFCBGOAEFFBKJBHEGIPOBIEENJBIDLIKIPOIMHCL!M!S!WFEGNCAPIJFFCBGOAELIJILLJGDJIDPIMEGLDMIMKMGNIIGMGI</id>
  </tWebForm>
<tArg xmlns="">
<meta>
  <text>{"items":[{"id":"form","type":"form","props":{"text":"Input","name":"OBJ341659WebForm","modal":true,"color":{"a":255,"r":255,"g":255,"b":255},"size":{"width":234,"height":222},"coordinate":{"left":0,"top":0}},"events":{}},{"type":"label","id":"label_kLkZu0pLy__TOeiJvnl5K","props":{"text":"Начальное значение:","name":"Label1","alignment":"left","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":12,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{},"coordinate":{"top":15,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"input","id":"input_jLL25aWLkWL3opLvqNRJQ","props":{"text":"","name":"Input1","placeholder":"Введите значение","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":14,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{"width":200,"height":32},"coordinate":{"top":35,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"label","id":"label_XngwyZ3Xgzod7NqgQXQtd","props":{"text":"Конечное значение:","name":"Label2","alignment":"left","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":12,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{},"coordinate":{"top":75,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"input","id":"input_VGaJ7DAC5T51_ggvP_bul","props":{"text":"","name":"Input2","placeholder":"Введите значение","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":14,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{"width":200,"height":32},"coordinate":{"top":95,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"button","id":"button_INWdSqIoQSDkwA1rq554B","props":{"text":"Сохранить","name":"Button1","color":{"a":255,"r":70,"g":142,"b":240},"font":{"name":"Roboto","color":{"a":255,"r":255,"g":255,"b":255},"size":16,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{"width":110,"height":32},"coordinate":{"top":171,"left":107},"variant":"primary","position":"absolute"},"parent":"form","events":{}}]}/r/n//...//Комментарии к коду формы//...</text>
  </meta>
  </tArg>
  </SaveWebForm>
  </s:Body>
  </s:Envelope>

SOAP-ответ:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SaveWebFormResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</SaveWebFormResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON-запрос:

{
"SaveWebForm" :
{
"tWebForm" :
{
"id" : "JAIKPLIJFFCBGOAEFFBKJBHEGIPOBIEENJBIDLIKIPOIMHCL!M!S!WFEGNCAPIJFFCBGOAELIJILLJGDJIDPIMEGLDMIMKMGNIIGMGI"
},
"tArg" :
{
"meta" :
{
"text" : "{"items":[{"id":"form","type":"form","props":{"text":"Input","name":"OBJ341659WebForm","modal":true,"color":{"a":255,"r":255,"g":255,"b":255},"size":{"width":234,"height":222},"coordinate":{"left":0,"top":0}},"events":{}},{"type":"label","id":"label_kLkZu0pLy__TOeiJvnl5K","props":{"text":"Начальное значение:","name":"Label1","alignment":"left","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":12,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{},"coordinate":{"top":15,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"input","id":"input_jLL25aWLkWL3opLvqNRJQ","props":{"text":"","name":"Input1","placeholder":"Введите значение","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":14,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{"width":200,"height":32},"coordinate":{"top":35,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"label","id":"label_XngwyZ3Xgzod7NqgQXQtd","props":{"text":"Конечное значение:","name":"Label2","alignment":"left","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":12,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{},"coordinate":{"top":75,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"input","id":"input_VGaJ7DAC5T51_ggvP_bul","props":{"text":"","name":"Input2","placeholder":"Введите значение","color":{"a":0,"r":255,"g":255,"b":255},"font":{"name":"Roboto","color":{"a":255,"r":0,"g":0,"b":0},"size":14,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{"width":200,"height":32},"coordinate":{"top":95,"left":17},"position":"absolute"},"parent":"form","events":{}},{"type":"button","id":"button_INWdSqIoQSDkwA1rq554B","props":{"text":"Сохранить","name":"Button1","color":{"a":255,"r":70,"g":142,"b":240},"font":{"name":"Roboto","color":{"a":255,"r":255,"g":255,"b":255},"size":16,"bold":false,"italic":false,"strikeThrough":false,"underline":false},"visible":true,"enabled":true,"hint":"","showHint":true,"size":{"width":110,"height":32},"coordinate":{"top":171,"left":107},"variant":"primary","position":"absolute"},"parent":"form","events":{}}]}\/r\/n\/\/...\/\/Комментарии к коду формы\/\/..."
}
}
}
}

JSON-ответ:

{
"SaveWebFormResult" : "1"
}
public static bool SaveWebForm(string moniker, string newText = "")
{
var somClient = new SomPortTypeClient(); // Прокси-объект для выполнения операций
var tSave = new SaveWebForm()
{
tArg = new SaveWebFormArg()
{
meta = new WebFormMD()
{
text = newText
}
},
tWebForm = new WebFormId() { id = moniker }
};
// Сохранение изменений веб-формы
var result = somClient.SaveWebForm(tSave);
return result;
}

См. также:

Работа со средой разработки