public PermissionAPI perAPI = APILocator.getPermissionAPI();
public void createBaseWidgetFields(Structure structure) throws DotDataException,DotStateException {
if(!InodeUtils.isSet(structure.getInode())){
throw new DotStateException("Cannot create base widget feilds on a structure that doesn't exist");
}
Field preExecute = new Field(WIDGET_PRE_EXECUTE_FIELD_NAME,Field.FieldType.HIDDEN,Field.DataType.TEXT,structure,false,false,false,4,"", "", "", true, true, true);
preExecute.setFieldContentlet(FieldAPI.ELEMENT_CONSTANT);
Field codeField = new Field(WIDGET_CODE_FIELD_NAME,Field.FieldType.HIDDEN,Field.DataType.TEXT,structure,false,false,false,3,"", "", "", true, true, true);
codeField.setFieldContentlet(FieldAPI.ELEMENT_CONSTANT);