create database entry
parent
41b229e8b3
commit
d8c4b75376
|
|
@ -313,6 +313,7 @@ public class KalenderRestController {
|
||||||
public List<Preset> savePreset(@RequestBody Preset request)
|
public List<Preset> savePreset(@RequestBody Preset request)
|
||||||
throws ARException, ValidationError, NotFoundError {
|
throws ARException, ValidationError, NotFoundError {
|
||||||
Presets presets = new Presets(javaAPI);
|
Presets presets = new Presets(javaAPI);
|
||||||
|
presets.savePreset(request);
|
||||||
return presets.getAll();
|
return presets.getAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.bmc.arsys.api.ARException;
|
import com.bmc.arsys.api.ARException;
|
||||||
import com.bmc.arsys.api.Entry;
|
import com.bmc.arsys.api.Entry;
|
||||||
|
import com.bmc.arsys.api.Value;
|
||||||
import com.bmc.thirdparty.org.springframework.beans.factory.annotation.Autowired;
|
import com.bmc.thirdparty.org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.nttdata.calender.api.Query;
|
import com.nttdata.calender.api.Query;
|
||||||
import com.nttdata.calender.api.RemedyJavaAPI;
|
import com.nttdata.calender.api.RemedyJavaAPI;
|
||||||
|
|
@ -71,6 +72,20 @@ public class Presets {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Preset> savePreset(Preset request) throws ARException, NotFoundError {
|
||||||
|
api.impersonateUser("ext_GedikSa");
|
||||||
|
var saveQuery = new Query.QueryBuilder(formDefault)
|
||||||
|
.addFieldValue("FilterPresetName", 364000001, new Value(request.getName()))
|
||||||
|
.addFieldValue("FilterPresetDefinition", 364000002, new Value(request.getDefinition()))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
System.out.println("API USER: " + api.getUser());
|
||||||
|
|
||||||
|
api.createEntry(saveQuery);
|
||||||
|
allPresets();
|
||||||
|
return this.presets;
|
||||||
|
}
|
||||||
|
|
||||||
public void allPresets() throws ARException, NotFoundError {
|
public void allPresets() throws ARException, NotFoundError {
|
||||||
var entries = api.queryFieldsById("\'2\'==\"" + api.getUser() + "\"", query.getFieldIds(), formName, null, 0,
|
var entries = api.queryFieldsById("\'2\'==\"" + api.getUser() + "\"", query.getFieldIds(), formName, null, 0,
|
||||||
0);
|
0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue