Oracle APEX ORDS Limitation on URL template? - oracle-apex

Is there a limitation on the Oracle APEX ords template?
Currently mapping a GET Request to
Works : URI Template: /history/{PLATAFORM}/{CONTEXT}/{APPLICAT}/
Works : URI Template: /history/{PLATAFORM}/{CONTEXT}/{APPLICAT}/test/
405 Method Not Allowed: URI Template: /history/{PLATAFORM}/{CONTEXT}/{APPLICAT}/{test}/
Can't find documentation about this scenario, wonder if it's Oracle APEX limitation/Bug? Or Maybe some configuration somewhere?
Any help would be appreciated,
Regards.

No limitations other than please switch to using : syntax over {}. We changed that a while back.
-- Generated by Oracle SQL Developer REST Data Services 18.1.0.051.1417
-- Exported REST Definitions from ORDS Schema Version 17.4.0.18.13.50
-- Schema: KLRICE Date: Tue Apr 03 15:03:00 EDT 2018
--
BEGIN
ORDS.ENABLE_SCHEMA(
p_enabled => TRUE,
p_schema => 'KLRICE',
p_url_mapping_type => 'BASE_PATH',
p_url_mapping_pattern => 'klrice',
p_auto_rest_auth => FALSE);
ORDS.DEFINE_MODULE(
p_module_name => '/history/',
p_base_path => '/history/',
p_items_per_page => 25,
p_status => 'PUBLISHED',
p_comments => NULL);
ORDS.DEFINE_TEMPLATE(
p_module_name => '/history/',
p_pattern => ':PLATFORM/:CONTEXT/:APPLICAT/test',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => '/history/',
p_pattern => ':PLATFORM/:CONTEXT/:APPLICAT/test',
p_method => 'GET',
p_source_type => 'json/collection',
p_items_per_page => 25,
p_mimes_allowed => '',
p_comments => NULL,
p_source =>
'select :PLATFORM,:CONTEXT,:APPLICAT from dual'
);
COMMIT;
END;

Related

Oracle Rest Data service - customise response status code

By default all successfull request on ORDS respond with status code 200 Ok. it is well.
But on occassion I need respond with on customizable error code, ie. 201 , 202 etc.
Are there any mode to respond a customizable error code on ORDS on PUT request?
regards
Pedro
Yes, absolutely.
Simply add a parameter called X-ORDS-STATUS-CODE, and assign it to a :bind, that you have as an OUT RESPONSE HEADER, of type INTEGER.
Then in your POST or PUT handler code, assign the status code you want.
:status := 201;
So...
Here's the full module export -
-- Generated by Oracle SQL Developer REST Data Services 20.2.0.147.0319
-- Exported REST Definitions from ORDS Schema Version 20.2.0.r1611903
-- Schema: HR Date: Mon Jun 22 16:41:15 EDT 2020
--
BEGIN
ORDS.DEFINE_MODULE(
p_module_name => 'status',
p_base_path => '/status/',
p_items_per_page => 25,
p_status => 'PUBLISHED',
p_comments => NULL);
ORDS.DEFINE_TEMPLATE(
p_module_name => 'status',
p_pattern => '201',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => NULL,
p_comments => NULL);
ORDS.DEFINE_HANDLER(
p_module_name => 'status',
p_pattern => '201',
p_method => 'POST',
p_source_type => 'plsql/block',
p_items_per_page => 0,
p_mimes_allowed => '',
p_comments => NULL,
p_source =>
'declare
new_record integer;
begin
insert into demo201 (column2) values (:words) returning column1 into new_record;
commit;
:status := 201;
end;'
);
ORDS.DEFINE_PARAMETER(
p_module_name => 'status',
p_pattern => '201',
p_method => 'POST',
p_name => 'X-ORDS-STATUS-CODE',
p_bind_variable_name => 'status',
p_source_type => 'HEADER',
p_param_type => 'INT',
p_access_method => 'OUT',
p_comments => NULL);
COMMIT;
END;
Here's a somewhat better example where I've caught my exception and set the HTTP Response Status code to '400'

Conversion from realurl to routeEnhancers in TYPO3 9... Adapt LookUpTables with additional ValueMaps or how to define the "zero-value-segment"?

I am upgrading a project about training courses and my URL-segments are like:
/category/course/location.html
Got it running with the following configuration:
routeEnhancers:
PageTypeSuffix:
type: PageType
default: '.html'
map:
'.html': 0
CoursePlugin:
type: Extbase
limitToPages:
- 1
- 15
- 17
- 18
extension: Course
plugin: Catlist
namespace: course_catlist
routes:
- routePath: '/{category_title}/{course_title}/{location_title}'
_controller: 'Category::list'
_arguments: {category_title: 'category', course_title: 'course', location_title: 'location'}
defaultController: 'Category::list'
aspects:
category_title:
type: PersistedAliasMapper
tableName: tx_course_domain_model_category
routeFieldName: 'slug'
course_title:
type: PersistedAliasMapper
tableName: tx_course_domain_model_course
routeFieldName: 'slug'
location_title:
type: StaticValueMapper
map:
alle-standorte: 0
hamburg: 1
berlin: 2
The problem is now: It's only working if there are values for all 3 parameters set! But for example there could be a segment like
/language-courses/all-courses/berlin.html
The course-parameter is empty, so all "language-courses" in "berlin" are shown in a list.
In realurl it is possible to combine a lookUpTable with a valueMap!
array(
'GETvar' => 'tx_course_catlist[course]',
'valueMap' => array(
'all-courses' => "",
),
'lookUpTable' => array(
'table' => 'tx_course_domain_model_course',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND deleted=0 ',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
)
How can I adapt this in TYPO3 9? Any experience or ideas? How can I map an empty-value for a segment of a PersistedAliasMapper?
Found a solution:
Create a record with an uid=0 in the database. Call the path-segment-field for example like "all-courses".
This has an unpleasant side effect that the record appears in the TYPO3 backend and if you want to edit it, you get an error message that the UID must not be 0. So just do it via PHPmyadmin...
And you have to make sure that the value passed to course is not NULL but "0" when building the URL.

Creating Salesorder with Vtiger Webservice missing Tax

I have the Problem when creating an salesorder with Vtiger Webservice,
The sales order is created but somehow the tax is not added.
I thought it has something to do with the parameter : hdnTaxType
Cause even if I add this value 'group' it does not apply the Tax to the Salesorder.
I have to manually add The Taxtype 'group' then the system adds the tax.
thats why i tried to add values like:
'tax1' => '7.00',
and
'group_tax' =>[
'group_tax_percentage1' => '7.0'
],
nothing so far did help...
has anybody an Idea what the problem is?
Thank you
Tobi
$salesOrder =[
'lastname' => $customer['lastname'],
'subject' => 'Order from 01.01.1018',
'sostatus' => '1',
'assigned_user_id' => '',
'bill_street' => 'Rechunngsstrasse 123',
'ship_street' =>'Lieferungsstrasse 123',
'productid' => '14x4325',
'currency_id' => '21x1',
'carrier' => 'DHL',
'txtAdjustment' => '13',
'salescommission' => '12',
'exciseduty' => '15',
'hdnTaxType' => 'group',
'tax1' => '7.00',
'hdnS_H_Amount' => '22.22',
'group_tax' =>[
'group_tax_percentage1' => '7.0'
],
'LineItems' => [
0 => [
"taxid" => "33x1",
'productid'=>'14x6',
'listprice'=>'20.53',
'quantity'=>'3',
'comment' => "Product123"
]
]
Webservices in Vtiger are not complete.
In this case you can register your own webservice that makes your queries, or check the SalesOrder in the after-save event

Filtering is not working for child grid in kendo-ui hierarchical grid with Razor MVC

I am trying to implement filtering on child grid in kendo-ui hierarchical grid in MVC but it's giving error.
HTML Code Sample :
.Columns(col =>
{
col.Bound(o => o.Id).Hidden(true);
col.Bound(o => o.Column1).Width(100).ClientTemplate("\\#= BuildLink(data,'1') \\#");
col.Bound(o => o.Column2).Width(100).ClientTemplate("\\#= BuildLink(data,'2') \\#");
col.Bound(o => o.Column3).Width(100).ClientTemplate("\\#= BuildLink(data,'3') \\#");
col.Bound(o => o.YTDSailedCalls).Width(100).ClientTemplate("\\#= BuildLink(data,'4') \\#");
})
.Sortable().Scrollable().Filterable()
.Pageable(pageable => pageable.Refresh(true)
.PageSizes(new int[5] { 20, 40, 80, 100, 200 })
.ButtonCount(5))
but its giving error in browser console and nothing get displayed.
Please reply as soon as possible if anyone face this issue or have solution for this.
Try like this-
#(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false))).Width(225);
columns.Bound(p => p.ShipName).Width(500).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
columns.Bound(p => p.Freight).Width(255).Filterable(ftb => ftb.Cell(cell => cell.Operator("gte")));
columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}");
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(true)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
For more assistance refer this link-
Kendo Grid filter

runInstances() in AWS SDK PHP 3.0 returns blank after successful launch of an instance

Following this, I used runInstances method like the following to launch and instance:
$new_instance_config = array(
'DryRun' => false,
'ImageId' => AMI_ID,
'MinCount' => 1,
'MaxCount' => 1,
'InstanceType' => 't1.micro',
'Placement' => array(
'AvailabilityZone' => AVAILABILITY_ZONE,
),
'Monitoring' => array(
'Enabled' => false,
),
'NetworkInterfaces' => array(
array(
'SubnetId' => SUBNET_ID,
'DeviceIndex' => 0,
'AssociatePublicIpAddress' => true,
'DeleteOnTermination' => true,
'Groups' => unserialize(SECURITY_GROUP_IDS)
)
)
);
$res = $this->ec2Client->runInstances($new_instance_config);
echo json_encode($res);
However this only prints blank object {} even though if I login to the AWS console, I can see the instance launched.
I need to access some information like the AMI ID of the launched instance. Am I missing something?
See Modeled Responses
Try:
$res['Instances']
or
$res->get('Instances')