Quantcast
Channel: ODTUG Aggregator
Viewing all 2258 articles
Browse latest View live

Stop typing and generate you substitution code

$
0
0
Some years ago I attended a presentation of John Scott in which he demonstrated the use of substitution for producing a string from a number of variables.

Up to that moment I used concatenation for generating strings from variables:

l_html &nbsp;:= '<input id="'||l_id||'" onclick="test('''||l_value||''')" type="text" />';  

Even a relative simple expression like this is hard to read. Moreover it is not easy to see whether the quotes are placed at the right position and quantity.

So John’s solution to this is to start with a string with delimited placeholders and replacing the placeholders with their value one by one. So the code gets:

l_html := q'!<input id="#ID#" onclick="test('#VALUE#')" type="text" />!';  
l_html := replace(l_html,'#ID#',l_id);  
l_html := replace(l_html,'#VALUE#',l_value);  

This code is much more readable and the html can be checked easily.
I have been using this design pattern a lot since then.

But the typing annoys me. Typically something to automate! So this morning, when I was getting ready to type a list of replace statements for the 1001st time I decided to create a small tool to generate these lines.

Paste the string with placeholders into the form and change the other parameters to your preferences. Press generate and you can copy the resulting code into your PL/SQL.
The generation presumes that the names of the variables containing the values to be replaced are equal to the placeholder names. Doing this also improves the readability of the code.

The utility can be used online at http://www.speech2form.com/ords/f?p=141:600

Happy apexing!

Source Article from http://dickdral.blogspot.com/2016/11/stop-typing-and-generate-you.html


Happy Birthday, Translate APEX!

$
0
0

Exactly one year ago, on 30.11.2015, we launched Translate APEX Project– the website containing collection of free translations for Oracle Application Express.

Oracle APEX as a global tool:

  • is available with Oracle DB all over the world,
  • is used by developers and companies on every continent,
  • has very dynamic and powerful community,
  • and technically supports all languages in the world,

so at Pretius, we assumed that it will be good idea to translate its internal messages to as many languages as possible, so that developers don’t need to translate almost 500 messages if they want to create an application in their or their client’s language.
Even if APEX contains 10 default languages, it doesn’t cover many big markets (like Russia, Indonesia, Turkey, Iran or Arabic world), well developed economies (like the Netherlands, Belgium, Denmark, Sweden, Finland or Norway) and international organizations that needs applications in tens of languages (like EU with 24 official languages).

translate_apex-orginal_map

Before Translate APEX

So we created a vision of place that can solve this problem:

  • a vision of place where translations for many languages are available for free,
  • a vision of repository where anyone can browse, download and share translations,
  • a vision of website that helps APEX to reach big markets and strong economies.

A vision of place that we simply called translate-apex.com and thanks to many people from many different countries this place has been running for a year.

But it was absolutely not an easy task to do! We needed to get all those translations, control its quality, provide easy installation process and find people who want to provide their translation or make them for free. But the “teamwork made the dream work” and we met many friends that helped in this project with their translations, scripts, ideas and advice – they have shown great will to help, cooperate and the real power of APEX Community.

So the project has been running for over 12 months. Thanks to contribution of over 40 people from over 25 countries we have provided 42 translations so far:

  • we covered blank spaces in APEX translation world (just look at the map);
  • we have fulfilled list of 10 most popular languages in the world by adding Bengali, Russian, Arabic and Hindi;
  • we have provided translations for 12 European Union languages, so there is only 5 left;

When you sum up all those numbers with other languages like Turkish, Farsi or Indonesian, we can announce that translate-apex.com has delivered translations for over 1.4 billion people!

After Translate APEX

 


Every day about 30 users download translations from translate-apex.com. The most popular languages are Russian, Dutch, Hindi and Arabic.

What’s more we also saved your time. Assuming that each translation was prepared and tested in about a week – we saved about 1000 hours of APEX Developers work.

Of course it’s not the end. We have new ideas, new translations to publish and people who like Aljaž Mali and Bas de Klerk develop software that extends features of this project. What’s more in several weeks we will provide new section devoted to localization and globalization with solutions and plugins that will help in this process in Oracle Application Express.

The numbers might look impressive, but I will write it again, the real basis of this project are the people – developers, translators, testers and users who share their comments. You can find full list of them on the website in “About us” section. To all of you and in particular to those who provided translations – I would like to say “Thank you!”. Translate APEX is your project and it was an honor to create it with you.

It has been a great year! I hope that our cooperation will continue and result in creation of new amazing APEX projects in the future!

#letsWreckThisTogether!

pstaniszewskiPrzemysław Staniszewski
Originator and PM of translate-apex.com
Oracle APEX Team Leader at Pretius
Twitter: @pstaniszewski

Artykuł Happy Birthday, Translate APEX! pochodzi z serwisu PRETIUS.

Relacja ze szkolenia APEX 5.0.4

$
0
0

Do końca tygodnia prowadzimy szkolenie wyjazdowe z APEX 5.0.4. Tym razem jest to Rzeszów. Jest to pierwsze szkolenie z wersji 5+ . Przy nowych wersjach zawsze jest "dreszczyk", że może coś się nie udać że nasz podręcznik nie został dokładnie zaktualizowany itp. Ja już jestem po swojej części i mogę potwierdzić jest OK : ).... teraz Piotrek zaczyna.





Przypominam też iż w styczniu przeprowadzimy jeszcze jeden cykl szkolenia z APEX 5.X... może to już będzie nawet 5.1.

Termin szkolenia 11-13/01/2017 (kup w 2016 weź udział w 2017 : )
Miejsce szkolenia - Wrocław
Koszt szkolenia to 2600 PLN netto.


Szczegóły i formularz zgłoszeniowy dostępne są TUTAJ.


How'd You Do That

$
0
0
  A while back my employer (www.insum.ca) had an internal competition (a hackathon) and I gathered a two others to a team where we called ourselves The Good (Monty), The Bad (Me), and The Ugly (Adrian).  I personally though I was more appropriate to the final credit due to Adrian's unusually youthful appearance, but he won the gun fight for the role and we'll speak no more of my humiliation.

  During the event I proposed that we attempt to integrate a javascript library into APEX. It's been done before but this one was special.  Draw2D (www.draw2d.org) is a canvas-based library that brings a lot to the table including the visualization of process data into a visio-like charts that can be stored in, and retrieved from, the oracle database.

  Since that day we have shown it off to a few groups and now I am releasing this into the wilds of apex.oracle.com for those that have asked me when they could play with it a bit more than just looking.

  MapIt can be found here https://goo.gl/v0wTq4 and anyone can play with it.  Though, I will need to clean out the tables on occasion.

   This is not merely and end result but a precursor to a personal project of mine to bring a more useful workflow engine to the Application Express community.  We'll have more on that project in the future.

Til then, Enjoy!

Andy Colvin: Putting 12.2 to the Test

$
0
0
The new Oracle Database 12c Release 2 (12.2) recently became available in the Oracle Cloud, but one ODTUG member had a chance to get a behind-the-scenes look at it months ago during extensive testing. Andy Colvin, an Infrastructure Principal Director with Accenture Enkitec Group, was one of about...

SQL Developer: Quick Outline with SQL statements

$
0
0
Most of you probably know the "Quick Outline" function you have inside the SQL Developer.
It helps you to easily jump between different functions/procedures inside a package.


My colleague Holger told me about a bug in SQL Developer 3.x where you could use the "Outline" view with normal SQL files, too. Unfortunately in version 4 it didn't work anymore. So he stayed with version 3 for a long while. Otherwise he would had to scroll again instead of a short jump towards a specific SQL select.


A few days ago he asked me again if I knew a way how to easily jump between SQL statements inside a SQL file.
So I thought I talk to a SQL developer specialist "Sabine Heimsath". She knows all about those little tricks I have no clue about. But Sabine didn't know how to do it either.

My last chance was to ask on Twitter about a proper solution.

Even on Twitter nobody answered me. I guess they just started to implement such a feature. :)

Anyway yesterday Holger told me that he found a way to get it to run on SQL Developer 4.1.
Reason enough for me to share the awesome idea.

create or replace package body "My SQL statements" as

/* ************************************************************************************************************************************************ */
function "SQL example 1";
/
-- SQL Statement

/* ************************************************************************************************************************************************ */
function "SQL example 2 - no character capping";
/
-- SQL Statement

/* ************************************************************************************************************************************************ */
function SQL_example_3_without_double_quote;
/
-- SQL Statement

end;


Finally a little GIF movie showing you the usage in action:

SQLcl custom Input prompt and validations

$
0
0
Another quick twitter inspired blog post inspired by the SQLcl account itself. Asked and answered: Do you support the ACCEPT command? YES. pic.twitter.com/NchmQ6Eegs — SQLcl (@oraclesqlcl) November 29, 2016 ACCEPT is a great way to get input but validation has to happen elsewhere as there's no hooks to do something like validate a number in a range without running a sql or plsql that does

Oracle Workspace Manager und Application Express

$
0
0

Application Express und Oracle Workspace ManagerNicht selten besteht in einer Geschäftsanwendung der Bedarf, mit Daten zu "spielen", Änderungen zu simulieren und verschiedene Versionen eines Datenbestandes zu verwalten. Solche Simulationen sind quasi eine "langlaufende Transaktion" - Änderungen (eine Simulation) werden zu einem späteren Zeitpunkt komplett angewendet oder zurückgerollt. Für kurze Transaktionszeiträume ist dieses Problem seit langem gelöst - die Oracle Datenbank beherrscht Transaktionen, die nötige Isolation, sowie COMMIT und ROLLBACK seit den frühen Anfängen. 

Langlaufende Transaktionenen haben jedoch einen anderen Charakter: Sie erstrecken sich über viele Datenbanksitzungen, gegebenenfalls mehrere Anwendungen und auch viele Nutzer. Nur wenigen ist die Tatsache bekannt, dass die Oracle-Datenbank eine Komponente enthält, mit der sich solche Anforderungen umsetzen lassen: Oracle Workspace Manager. Wie Sie diesen in Application Express-Anwendungen einsetzen können, zeigt unser aktueller Tipp.


Oracle Workspace Manager and Application Express

$
0
0

Oracle Workspace Manager and Application ExpressIn business applications, there is often the requirement to "play" with data, to simulate business scenarios or to maintain multiple versions of data. Such scenarios require "long running transactions"; changes are being made to tables from within multiple database sessions, over a longer period of time even from different users. At the end, all changes of that transactions are being applied or rejected as a whole. 

We have transactions in the Oracle database since its early days, but these are restricted to the very database session and therefore also to one user. But there is also database functionality for long running transacions: Oracle Workspace Manager. Our latest Application Express Tip shows what this is and how to use it within an application.

An Oracle APEX Methodology for Success

$
0
0

An Oracle APEX Methodology for Success

When I first started as a computer programmer in 1986 (yikes!), I was introduced to a system development methodology. At that time, I was working for CGI and they introduced the company-wide CGI development methodology. It was a set of deliverables and documents that were linked to each phase of a standard waterfall project development.

A development methodology? For what? Why?

It made sense to follow standards and processes since most large projects involved many people working toward a same goal. Without this methodology, it would have been  difficult to ensure quality and deliver projects on time and on budget.

But what is methodology exactly? It’s a set of defined procedures, standards, norms, processes, and documents to organize and facilitate software development.

At Insum, when we started to work on bigger Oracle APEX projects requiring different types of resources like project managers, analysts, QA specialists, tech leads, and of course developers, it became more obvious that we had to develop our own APEX-specialized methodology.

One might think that since APEX is a development framework, there is no need for  methodology. After all, it is a Rapid Application Development (RAD) tool. We want to develop faster while saving time and money. Surely having to follow procedures and spending time on quality will slow delivery down, right? Wrong!

The reality is there is a need for structure and methods aiming to facilitate and speed up the development cycle. Quality at every level is very important mostly because we build applications for clients who will inherit the maintenance after delivery.

oracle apex dev ops

One of the goals of our development methodology is to catch most issues early on. We quickly learned that it is very costly to catch all the small issues in test, and even more costly in production. The cost of deployment in test, testing, opening issues, tracking them, and going back to dev is very high. For example, having good development standards and a technical lead that checks daily that methodology is being followed is one of the processes that helps achieving quality. As you can see, methodology is also about properly defining roles in a project team.

What does the methodology contain?

insum development methodology

Our methodology is composed of different elements related to all aspects of an APEX development project.

In order to facilitate maintenance of our methodology, it is divided into several sections. This also allows us to customize every project and to pick and choose the appropriate approach and documents. Each project is unique and may need all or parts of the methodology depending on its size, the level of tests required, and whether it is Agile or Waterfall.

Here are the different sections:

0000 – General

In this section, we keep information related to the methodology specifically for the project. It contains document templates, a description of the methodology, some tips and tricks, and a list of the different tools that will be used.

0100 – Opportunity / Feasibility Study

For most projects, we start with an opportunity study. The main goal of this phase is to better understand the customer request at a high level. We have developed a project checklist so that we can ask specific questions to the client before starting the project. There might be some elements, like security or performance, that will have a major impact on project planning.

Over the years, we also developed a method to evaluate projects. This section contains an evaluation guide based on metrics for APEX software development.

0200 – Architecture

This section is about everything related to the different environments and technical architecture design. Among other things, it contains installation guides specific to the versions used on the project, security designs, and database standards.

0300 – Analysis

One of the major phases in a project is of course analysis. Here we define the approach and have template documents to create specifications for developers. It is also where we explain how to use our custom Agile development processes or our custom Waterfall processes. Analysts can use the guidelines in that section to follow predefined standards, and avoid having to do research or redefine proven methods. This is definitely helping with gaining productivity in our projects. Keep in mind that those processes are aligned with the rest of the team.

0400 – Development

For development, methodology is of course mainly related to norms and standards for every technology used i.e. Javascript, APEX and PL/SQL. We also have different checklists that developers can use as reminders, as well as custom advisors that automatically perform checks in the APEX metadata. There are also guidelines on code review.

0500 – Testing

Of course, testing is all about documents on test cases, test reports, and tests plans.

0600 – Implementation / Delivery

Once development is finished, we have to deliver the programs to the client. This section covers everything related to project delivery. From installation scripts to final acceptance documents and checklists.

0700 – Maintenance

Once a project is delivered, it goes into maintenance mode. This section is used to facilitate transfer to the maintenance group. It contains specific information for the maintenance group, as well as the delegation process to the maintenance group.

0800 – Project Management

Project management is related to every phase of any software development projects. This is where we document the project management approach. It contains dashboards that are communicated to clients and end-users, document templates, project schedules, project charts, meeting minutes, and many more documents to help managing projects.

0900 – Quality Assurance & Control

As with project management, Quality Assurance & Control is involved with every phase of a project. This is where we document our approach for tests, quality controls, and test automations. For every project, this is also where we define the metrics and the different testing tools that will be used.

1000 – Change Management & Training

This final section contains training curriculum, schedules, and material. It also documents the change management approach used to facilitate the end-user adoption of the delivered software.

apex-methology-adoption

Methodology Adoption

As you can see, all participants on a project have to follow our methodology. We also encourage all our employees to provide feedback and suggestions. It is an ongoing effort from the whole project teams. This helps ensure that our methodology is adopted by everyone and is up to date with the latest trends.

One of our approaches to get our developers engaged with our methodology is that we answer feedback and keep everyone involved. To do so, some of our methodology documents are “living documents”. Google Docs allows developers to quickly suggest and improve the different defined norms and standards  and everyone has visibility into their suggestions. We make sure that every new employee receives training on our methodology during their on-boarding process.

Moreover, we have created a committee that meets on a regular basis to discuss, improve, and assign different resources to maintain or create the documents.

Insum at your service

Implementing a methodology in a company is no easy task. It takes time, “buy-in” from both employees and management, and a tenacious team to help push them. The final result is certainly worth it and will improve your projects.

Based on our experience, we offer coaching for implementing your APEX methodology. We can integrate, adjust and share what took us many years to build. Not only this will allow you to learn best practices. It will also allow you to avoid making the same mistakes we did to get here and unveil the full potential of APEX. At Insum, we have a great team of very talented people and they are ready to help. Just let us know.

See Our Services

The post An Oracle APEX Methodology for Success appeared first on Insum.

Oracle APEX as a Cloud ERP PaaS Solution

$
0
0

Introduction

In my previous post, I opined that APEX was coming of age in the Cloud Era. Actually, I could go further than that and say APEX was born for the Cloud. APEX has been a Cloud based PaaS service before PaaS was a thing (think apex.oracle.com). It has a natural container in the Oracle Database and the development environment is purely web based. Essentially, all you need is a URL and you can get started. That's about as cloudy as you can get (yes I believe cloudy is now a thing).

Also consider how the APEX product has evolved to add a fantastic UI to it's existing data processing pedigree. There is no more powerful a data processing engine than the Oracle database. Couple that with a now aesthetically pleasing and functional UI and you have the complete web development package. Add to that, sophisticated web service hosting and consumption capabilities and the possibilities are seemingly endless.

​All of this makes APEX is a natural choice for extending Oracle's Cloud ERP. A topic which I will expand on in this post. I will discuss four use cases where APEX and Cloud ERP could meet and dive into a use case for each.

Cloud ERP/APEX UI Mashup

This use case was the focus of my previous post Oracle Cloud ERP and APEX PaaS Mashup. In this use case, we are focused on supplementing ERP Cloud functionality with APEX UI components embedded within the Cloud ERP UI. This approach means the user never leaves the comfort of the Cloud ERP UI.
Picture
Convert a Salesforce Prospect to a Cloud ERP Customer
​The example use case involves an APEX page being embedded in a tab within Cloud ERP. The embedded page allows a Cloud ERP user to search prospects (in real-time) from Salesforce, identify a specific prospect and click a button to convert the prospect to a Cloud ERP customer.

Behind the Scenes
When the user opens the APEX page in ERP Cloud, a Java Web Token (JWT) is generated by Cloud ERP and passed to APEX. APEX verifies the JWT, authenticates the user and returns a search page to be rendered in the Cloud ERP window. Once the user enters their search criteria, APEX calls a Salesforce REST service to fetch prospect data and displays it in a table on the embedded APEX page. When the users identifies a prospect and clicks convert, APEX calls a web service in Cloud ERP to create the customer and tag it with the ID of the Salesforce prospect. APEX will then call a REST service in Salesforce to mark the prospect as converted and update field with Cloud ERP Customer number.

Standalone Cloud ERP Connected Apps

The second use case involves incorporating live and cached Cloud ERP data in a  standalone APEX Application.
Picture
Consolidated Management Dashboard
​In the use case example, an APEX dashboard is built which pulls financial summaries from Cloud ERP via calls to the BI Publisher web service. This data is incorporated (in real time) with data from an on premise treasury system and financial data from a subsidiary which is running SAP. APEX provides sophisticated charting capabilities to provide visualizations for the data to facilitate decision making.

Behind the Scenes
Users would authenticate into the APEX application using their Cloud ERP credentials. The challenge here is that there is currently no user authentication service available in Cloud ERP. You can work around this by making a call to any web service using the users Cloud ERP credentials. The response will determine if the username and password are correct and allow them into your APEX application. Once in the application, you would utilize the users credentials (for the duration of the session only) to call SOAP and REST based services in Cloud ERP to fetch data.

You can build custom BI Publisher (or OTBI) reports to provide pre-summarized data in XML format and call these reports using the BI Publisher web service to pull the data into APEX. That way, Cloud ERP does a lot of the heavy lifting and you are not pulling thousands of records across the network. You will want to consider caching certain data in the local (local to APEX anyway) database. This will significantly reduce latency in making multiple calls to the Cloud ERP web services. Lookups, currency conversions and additional data manipulation can be all performed in the APEX database.

Standalone Mobile APEX Apps

APEX utilizes a responsive theme which works great to automatically adjust the UI as you move from desktop to laptop to tablet. APEX also has excellent mobile capabilities when you need the simplicity of a purely mobile UI. This aligned with APEX's rapid application development capabilities allow you to build opportunistic mobile apps to empower your workforce.

An example use case could be to provide project managers a mobile UI using APEX that allows them to capture images of the worksite and upload them as attachments to a project in Cloud ERP.

​I won't go into behind the scenes detail here, as aside from utilizing a mobile UI, the rest of the approach is the same as my previous example.

Integration Platform

The final use case I want to cover is utilizing APEX (and ORDS) as a light weight integration platform. When used in conjunction with APEX and ORDS, the Oracle database has pretty much everything you need to integrate your cloud SaaS solutions. The database provides a scheduler for scheduled events, there are AQ tables for queue based integration patterns, PL/SQL for orchestration, mapping and transformation logic, local tables for data storage, APEX APIs for consuming REST and SOAP services and finally ORDS to host REST endpoints.

At this point, I can almost hear the sharp intakes of breath from the SOA purists. I would say, however, if you are advising your small to mid-size Cloud customer, can you honestly justify thousands of dollars a month for the all in solution when you could be spending as little as $175/month for Exadata Express? I am not advocating GE do it this way but it is fit for purpose for many customers.

Use Case: Employee Synchronization
An example use case is a customer who needs to sync employees between Workday and Cloud ERP. A scheduled database job in your APEX database runs and pulls employees added/changed in the past 5 minutes in WorkDay. I then performs transformations on the data and calls a REST service in ERP Cloud to propagate the change there.

​Guess what, because we have APEX in our database, we can build automated email alerts when something goes wrong. We can also build a monitoring UI to keep track of what's going on.

Random though on Cloud ERP REST Services

While not directly related to this blog, I do want to mention that at the time of writing this post, Oracle seem to be in the process of moving their Cloud ERP SOAP web services to REST. Currently, the Human Resources and Projects modules have good REST coverage. I am fervently hoping that Cloud ERP's trend toward REST continues as it will open the door for a lot of innovation (and greater adoption) of these valuable integration points.

A Note about Security

I would be remiss if I did not mention that you need to be extra careful with security. In all of these use cases, we have web applications exposed to the internet. APEX has excellent security capabilities and is actively monitored and patched by Oracle to keep up with today's security demands. You do, however, need to make sure you follow best practices when developing your APEX applications.

Licensing Considerations

Please do talk to your Oracle Salesrep regarding an potential licensing implications regarding the above. 

​Conclusion

To be honest, we are barely scratching the surface in terms of possibilities. I do hope you can see some of the potential for utilizing APEX as a PaaS platform for Cloud ERP.

Map Maker

$
0
0
I need the Map Maker plugin to add the map to my webpage in oracle apex

AnyChart for Oracle APEX

$
0
0
I want to add the plug-in Any Chart for Oracle APEX to improve my Oracle Apex performance.

Overlay Side Navigation Menu

$
0
0
In the last couple of weeks, I've been playing with the side navigation menu. By default, the side navigation menu "pushes" the page content back and forth as it expands and collapses.
Which looks just like this:


By overridding the Universal Theme's CSS related to the side navigation menu, I was able to make the menu display as an overlay.

I've also tested the solution on the Apex 5.1 EA2 and noticed that the html markup of the menu changed quite a bit in order to handle RTL applications.

You can retrieve both CSS here:
https://gist.github.com/maxime-tremblay/7d95614652cee6b2e215aebd602e6df0

Then you can include the coresponding CSS file either in the theme roller's custom CSS attribute or as an external file in your application's CSS files.

You will get something that looks like this:


If you would like to have the menu be fullscreen you can simply uncomment the fullscreen part at the end of the CSS file.

You can have a look at my Demo Application

Modal Lov in Tabular

$
0
0



Last year I have created a Modal Lov and also this used in tabular ,for that return items from dialog page to parent page I used apex.server.process for saving items in Lov page.
Thanks to the awesome blog postfrom Dan McGhan when I have looked that blog I decided to change the method which I had used.


Demo application: Modal Lov Tabular


Now, I would like to show you how to create a Modal Lov in Tabular.

Create a Tabular page and setting rendering tab

1. Create a tabular form through wizard, e.g. : page 7 that name is EMP_TABULAR

2. Add a link column to query e.g. : null as "MODAL_LINK"

3. Set a static ID tabularempregion

4. Add a hidden item P7_DIALOG_URL

5. Create a process Prepare Modal Url in Before Header point

6. Set PL/SQL Code for Prepare Modal Url process. This code makes a Dialog URL for navigate to modal lov therefore assign to P7_DIALOG_URL item.


DECLARE
v_url VARCHAR2 (1000);
BEGIN
v_url := apex_util.prepare_url(p_url => 'f?p='||:app_id||':8:'||:app_session||'::NO::', p_checksum_type => 'SESSION', p_triggering_element => 'apex.jQuery(''#tabularempregion'')');
:P7_DIALOG_URL := v_url;
APEX_UTIL.SET_SESSION_STATE('P7_DIALOG_URL',v_url);
END;









7.Set CSS Classes => tabularlov for ENAME column in EMP_TABULAR region. You should set this class for each column that want to be readonly.

8.Set several properties for MODAL_LINK column

a. Type => LINK

b. Target =>  Type = URL , URL = #. I ‘ll set it only for enable  Link Text property
c. Link Text =>





d. Link Attributes => class="linklov"










8. Set Function and Global Variable Declaration on EMP_TABULAR page. it has four parts, first set a variable that I ‘ll use later in Dynamic Action for getting current row number, second remove (a tag) because I don’t need it, third set readonly attribute for each item that is necessary, forth disable input text selection when we have readonly item so it’s optional.

//rownumber clicked
var tabularRecid = 0;
//remove a tag
$( ".linklov" ).remove();
//readonly input lov
$(".tabularlov" ).prop( 'readOnly', 'readonly');
//disable input text selection
$(".tabularlov").attr('unselectable', 'on');
$(".tabularlov").css('user-select', 'none');
$(".tabularlov").css('-moz-user-select', 'none');
$(".tabularlov").css('-khtml-user-select', 'none');
$(".tabularlov").css('-webkit-user-select', 'none');
$(".tabularlov").on('selectstart', false);


9. Set CSS Inline on EMP_TABULAR page


.btn-dialog-lov {
color: #fff;
background-color: #e0e0e0;
}
.icon-dialog-lov {
vertical-align: top;
width: 16px;
height: 16px;
font-size: 1.7rem;
}
//remove space between button and item
td[headers="MODAL_LINK"], th#MODAL_LINK {
border-left: 0px;
padding-left: 0px;
padding-right: 2px;
}
td[headers="ENAME"]{
padding: 2px 2px;
}









Create a Modal Dialog Page

It’s better to look more information on blog post from Dan McGhan. So I’ll explain quickly

1. Create an Interactive Report on emp table and set page mode to Modal Dialog 

2. Set CSS Inline

3. Create three hidden items 
P8_RETURN_ENAME, P8_RETURN_JOB, P8_RETURN_MGR

4. Set HTML Expression and Static ID for ENAME column

5. Create a Dynamic Action Row Clicked with two true actions and setting like this images















Back to Tabular page  and setting Dynamic Action

1.Create a Dynamic Action getRecID in order to set current row number clicked on tabular region

a. Name => getRecID

b. Event => Click

c. Selection Type => jQuery Selector

d. jQuery Selector => a.tabularDialog

e. Event Scope => Dynamic

f. create a true action Execute JavaScript Code

g. code:

//set rownumber clicked
var itemTd = $(this.triggeringElement).closest('tr').find('td[headers="CHECK$01"]');
tabularRecid = itemTd.find('input[name="f01"]').attr('id').slice(4);

h. Fire On Page Load set NO


2.Create a Dynamic Action Dialog closed

a. Name => Dialog closed

b. Event => Dialog closed

c. Selection Type => Region

d. Region => EMP_TABULAR

e. Event Scope => Dynamic

f. create a true action Execute JavaScript Code

g. code: look at the below images that how to find the columns id


$x_Value('f03_'+ tabularRecid,this.data.P8_RETURN_ENAME);
$x_Value('f04_'+ tabularRecid,this.data.P8_RETURN_JOB);
$x_Value('f05_'+ tabularRecid,this.data.P8_RETURN_MGR);

h. Fire On Page Load set NO










In this way you able to find the columns id






Finish this task and enjoy it.





Navigate to new window from navbar link

$
0
0


When you create a list entry in navigation bar in order to set URL instead of select Page in this Application, by default the target of link is on current page so it's better when the link is out of your application this link navigates to either new window or tab on your browser.

First way is by Dynamic Action

1: Create a GLobal Page e.g. page 0
2: Create a Dynamic Action in Page Load event
   a.Name = > Go to new window in navbar Link
   b.Action => Execute JavaScript Code
c. Code :
$('.t-Button--navBar').attr("target", "_blank");

 



Second way it's a simple trick, only you should add below code in front of your address in URL Target
before change URL Target: http://oracleapex.blogfa.com/

after change URL Target: http://oracleapex.blogfa.com/" target="_blank"




After that I have begun to be curious about what will happen for href in (a tag) so these images were surveyed in (Chrome, Firefox, IE).

Chrome

 Firefox

IE 


Any way it works correctly.



Super Shuttle Item

$
0
0


In this post I’ll show you how to create aSuper Shuttle Item.

Here's an Demo application: Super Shuttle Item

Features:

  1. Filter on the Shuttle Item
  2. Show the Count Rows on the Left/Right panel
  3. Separate rows on the right panel by color (Selected rows or saved at the table)
  4. Maximum rows on the right panel for manipulating is (32765) Characters
  5. Insert/Delete approximately 4000 records at the same time


Firstly thanks to blog post from Christopher and awesome blog post from JOHN SNYDERS about APEX AND ASYNCHRONOUS AJAX.


Before Start

1.Create table SHUTTLE_TABLE this table has more than 14k records in order to load in the Shuttle Item
CREATE TABLE  "SHUTTLE_TEST"
( "ID" NUMBER NOT NULL ENABLE,
"NAME" VARCHAR2(500 CHAR),
"COUNTRY" VARCHAR2(100 CHAR),
CONSTRAINT "SHUTTLE_TEST_PK" PRIMARY KEY ("ID")
USING INDEX ENABLE
)
/

2.Create table MYTABLE_TEST this table maintain some records of SHUTTLE_TABLE and maybe it’s detail
CREATE TABLE  "MYTABLE_TEST"
( "ID" NUMBER NOT NULL ENABLE,
"CITY_ID" NUMBER,
"FLAG" CHAR(1 CHAR),
CONSTRAINT "MYTABLE_TEST_PK" PRIMARY KEY ("ID")
USING INDEX ENABLE
)
/

Create a Blank page and setting rendering tab

1. Create a simple form through wizard, e.g. : page 13 that name is SUPER-SHUTTLE
2. Create a region  e.g. : Super Shuttle Item and I'll create three items and a button
  • Static ID => supershuttle-region
3. Create a classic report on  MYTABLE_TEST table
  • Static ID => mycityregion
4. First item in the Super Shuttle Itemregion is P13_COUNTRY. This item 'll use in where clause of Shuttle Item Query
Required
  • Name => P13_COUNTRY
  • Type => Popup LOV
  • List of Value => SQL Query
select DISTINCT COUNTRY as d,
COUNTRY as r
from SHUTTLE_TEST
order by 1

  • Display Null Value => YES
  • Post Text =>



5. Next item is P13_FILTERWith this item can be filter rows in Shuttle Item
  • Name => P13_COUNTRY
  • Type => Popup LOV
  • Value Placeholder => Filter text: City or ID
  • Post Text =>





6. Last item is P13_CITIESThis is a Shuttle Item
  • Name => P13_COUNTRY
  • Type => Shuttle
  • Show Control => All
  • List of Value => SQL Query
select s1.NAME||'('||ID||')' as CITY , s1.ID
from SHUTTLE_TEST s1
where COUNTRY = COALESCE(:P13_COUNTRY,s1.COUNTRY)
and not exists (Select 'x'
From MYTABLE_TEST m1
Where m1.CITY_ID = s1.ID)
order by 1


7. Now create a button INSERT-DELETE for submit so I'll explain about Dynamic Action later.
















8. Set Function and Global Variable Declaration on SUPER-SHUTTLE page. it has four parts, first set a variable that I ‘ll use later in Dynamic Action for controlling on shuttle item, second makes a function setShuttleLabel to show count rows on both panels, third makes a function fillShuttleRight for filling right panel of shuttle itemlast enable Enter Key on Filter input text.

/*--------SHUTTLE CONTROL--------*/
var countsaved = 0;
var left = $x("P13_CITIES_LEFT");
var right = $x("P13_CITIES_RIGHT");

//makes shuttle labels
function setShuttleLabel() {

//remove labels
$( ".shuttleControl-count" ).remove();
$( ".shuttleControl1-count" ).remove();
$( ".shuttleControl2-count" ).remove();

//create labels
$( ".shuttleControl" ).prepend( " " );
$( ".shuttleSort2" ).prepend( " " );
$( ".shuttleSelect1" ).prepend( "Count: " );
$( ".shuttleSelect2" ).prepend( "Saved: " );
$( ".shuttleSelect2" ).prepend( "Selected count: " );

}

//fill right panel of shuttle item
function fillShuttleRight(){
var largevalues = '';
// invoke a PL/SQL process on the server by making an ajax request
var shuttleData = apex.server.process("FILL_SHUTTLE_RIGHT",{} ,
{
loadingIndicator: function( pLoadingIndicator ) {
return pLoadingIndicator.prependTo (
apex.jQuery(
"td.shuttleControl", "#P13_CITIES_CONTAINER" ))
},
loadingIndicatorPosition: "before"
});

shuttleData.done(function(data) {
var i, item;
// data could be anything you like but in this example do what a DA would do
// this handles the page items to return set by the server process
// data result is object with property item which is an array of page item id, value pairs
right.length=0;
if (data && data.item) {
for (i = 0; i < data.item.length-1; i++) {
item = data.item[i];
right.options[i] = new Option(item.value, item.id);
$(right.options[i]).addClass('color-saved');
}

//get lastElement
countsaved = data.item.slice(-1)[0].value;

//makes shuttle labels
setShuttleLabel();
}


});

}

//fire to click on P13_FILTER item
$("#P13_FILTER").keyup(function(event){
if(event.keyCode == 13){
$("#filter-shuttle-button").click();
}
});

9. Set CSS Inline on SUPER-SHUTTLE page
.count-shuttle-label {
color: #ff0000;
}

.color-saved {
color: #4696fc;
}







Set Dynamic Action

I'll create six Events on rendering tab that five events on Click and a event on DoubleClick.




1.Create a Dynamic Action Clear Filter in order to clear text in filter item

a. Name => Clear Filter
b. Event => Click 
c. Selection Type => jQuery Selector 
d. jQuery Selector => .filter-clear
e. create a true action  Set Value 
f. Set Type => 
Static Assignment
g. Value=>  (you should set empty)

h. Fire On Page Load => No

2.Create a Dynamic Action Filter-Reset Shuttle when clicked on the rest/filter button  

a. Name => Filter-Reset Shuttle
b. Event => Click 
c. Selection Type => jQuery Selector 
d. jQuery Selector => #filter-shuttle-button, #reset-shuttle-button
e. Create a true action Execute JavaScript Code  
f. code:

var largevalues = '';

//set shuttle right
for ( var i=0; i < right.length; i++ ){
right.options[i].selected = true;
largevalues = largevalues +','+ right.options[i].value;
}
//remove first character ','
largevalues = largevalues.substr(1);

//You must select items less than 32767 characters
if (largevalues.length > 32767){
alert('Your selection is more than 32767 characters');
return;
}

var shuttleData = apex.server.process("FILL_SHUTTLE_LEFT", {
x01: apex.item( "P13_COUNTRY" ).getValue(), x02: apex.item( "P13_FILTER" ).getValue(),
x03: largevalues,
pageItems:["P13_COUNTRY", "P13_CITIES"] // these are the page items to submit
},
{
loadingIndicator: function( pLoadingIndicator ) {
return pLoadingIndicator.prependTo (
apex.jQuery(
"td.shuttleControl", "#P13_CITIES_CONTAINER" ))
},
loadingIndicatorPosition: "before"
});

shuttleData.done(function(data) {
var i, item;
left.length=0;
if (data && data.item) {
for (i = 0; i < data.item.length-1; i++) {
item = data.item[i];
left.options[i] = new Option(item.value, item.id);

}
//get lastElement
countsaved = data.item.slice(-1)[0].value;

//makes shuttle labels
setShuttleLabel();

}

})

h. Fire On Page Load => No

3.Create a Dynamic Action Change Shuttle Labels for setting count rows on shuttle item  

a. Name => Change Shuttle Labels
b. Event => Click 
c. Selection Type => jQuery Selector 
d. jQuery Selector => .a-Button--shuttle
e. Create a true action Execute JavaScript Code  
f. code:

//makes shuttle labels
setShuttleLabel();

h. Fire On Page Load => No

4.Create a Dynamic Action Reset Shuttle when clicked on Rest button after rest shuttle left this event will enable and reset shuttle right. In this event I'll create two true actions.

a. Name => Reset Shuttle
b. Event => Click 
c. Selection Type => jQuery Selector 
d. jQuery Selector => #P13_CITIES_RESET  (find this name is simple "SHUTTL_ITEM_NAME+_RESET")
e. Create a true action Execute PL/SQL Code  
f. code:



:P13_COUNTRY := null;
:P13_CITIES := null;
:P13_FILTER := null;

g. Page Items to Return => P13_COUNTRY,P13_CITIES,P13_FILTER

h. Fire On Page Load => No
i. Wait For Result => Yes (In run-time after click on reset button this warning will be appear in console Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience ) I'll try to find new way to prevent this warning.

j. Create a true action Execute JavaScript Code  
k. code:

//fill the right panel of shuttle item
fillShuttleRight();

l. Fire On Page Load => Yes  (Don't forget set this)


5.Create a Dynamic Action Double Click on Shuttle for setting count rows on shuttle item

a. Name => Double Click on Shuttle
b. Event => Double Click
c. Selection Type => jQuery Selector 
d. jQuery Selector => .shuttle_left, .shuttle_right
e. Create a true action Execute JavaScript Code  
f. code:

//makes shuttle labels
setShuttleLabel();


h. Fire On Page Load => No

6.Create a Dynamic Action Insert-Delete-Shuttle call a Ajax process in order to DML on shuttle item

a. Name => Insert-Delete-Shuttle
b. Event => Click 
c. Selection Type => Button
d. Button => INSERT-DELETE
e. Create a true action Execute JavaScript Code  
f. code:

var largevalues = '';

//set shuttle right
for ( var i=0; i < right.length; i++ ){
largevalues = largevalues +','+ right.options[i].value;
}
//remove first charecter ','
if (largevalues.length > 0)
largevalues = largevalues.substr(1);

//You must select items less than 32767 characters
if (largevalues.length > 32767){
alert('Your selection is more than 32767 chracters');
return;
}

apex.item( "P13_COUNTRY" ).setValue( "" );
apex.item( "P13_FILTER" ).setValue( "" );

// invoke a PL/SQL process on the server by making an ajax request
var shuttleData = apex.server.process("INSERT_DELETE_SHUTTLE",
{x01: largevalues
},
{
loadingIndicator: "#supershuttle-region",
loadingIndicatorPosition: "centered"
});

shuttleData.done(function(data) {
//submit this page and call a process for send "command Successful" message after reload page
apex.submit('Successful');

})

h. Fire On Page Load => No



Set Processing

I'll create two Process on processing tab and three AJAX Callback.




1.Create a Process Command successful after submit this page(From Dynamic Action) and reload so if you want to show success message can be use this simple trick.

a. Name => Command successful
b. Type => PL/SQL Code
c. code => null;

d. Success Message => Command successful!

2.Create a Process Clear Session State It's optional it depends to you.

a. Name => Clear Session State
b. Type => Clear Session State

3.Create first AJAX Callback FILL_SHUTTLE_LEFT I think to be clear is for filling left panel of shuttle item

a. Name => FILL_SHUTTLE_LEFT
b. Type => PL/SQL Code
c. code => 

Declare
l_country long := apex_application.g_x01;
l_filter long := apex_application.g_x02;
l_selected clob ;
l_count number;

Begin

apex_json.open_object;
apex_json.open_array('item');

l_selected := nvl(apex_application.g_x03,-1);

for rec in (
Select ID, NAME||'('||ID||')' as NAME
From SHUTTLE_TEST
Where (regexp_like(NAME, COALESCE(l_filter,NAME), 'i' ) Or
regexp_like(ID, COALESCE(l_filter,To_Char(ID))))
And DBMS_LOB.INSTR(','||l_selected||',',','||ID||',')=0
And COUNTRY = COALESCE(l_country,COUNTRY)
)

loop
apex_json.open_object;
apex_json.write('id', rec.ID);
apex_json.write('value', rec.name);
apex_json.close_object;
end loop;

--records were saved
Select Count(*)
Into l_count
From MYTABLE_TEST;


apex_json.open_object;
apex_json.write('id', 99999999);
apex_json.write('value', l_count);
apex_json.close_object;


apex_json.close_array;
apex_json.close_object;
End;


4.Create second AJAX Callback FILL_SHUTTLE_RIGHT

a. Name => FILL_SHUTTLE_RIGHT
b. Type => PL/SQL Code
c. code => 

Declare
l_count number;
Begin

apex_json.open_object;
apex_json.open_array('item');

for rec in (
Select m.CITY_ID,(Select s.NAME||'('||s.ID||')'||'-'||s.COUNTRY as NAME FROM SHUTTLE_TEST s where s.ID = m.CITY_ID) as NAME
From MYTABLE_TEST m
order by 2
)

loop
apex_json.open_object;
apex_json.write('id', rec.CITY_ID);
apex_json.write('value', rec.name);
apex_json.close_object;
end loop;

--The records were saved
Select Count(*)
Into l_count
From MYTABLE_TEST;


apex_json.open_object;
apex_json.write('id', 99999999);
apex_json.write('value', l_count);
apex_json.close_object;

apex_json.close_array;
apex_json.close_object;

End;

5.Create third AJAX Callback INSERT_DELETE_SHUTTLE

a. Name => INSERT_DELETE_SHUTTLE
b. Type => PL/SQL Code
c. code => 

declare
l_cities apex_application_global.vc_arr2;
l_selected clob;
begin

l_cities := apex_util.string_to_table (apex_application.g_x01,',');
l_selected := apex_application.g_x01;

--Delete all data
if l_cities.count = 0 Then
DELETE MYTABLE_TEST
WHERE FLAG = 'N';

else
--Delete
for rec in (
Select ID
From MYTABLE_TEST
Where DBMS_LOB.INSTR(','||l_selected||',',','||CITY_ID||',')=0
)
loop
DELETE MYTABLE_TEST where ID = rec.ID;
end loop;

end if;

--Insert
for idx in 1..l_cities.count loop
MERGE INTO MYTABLE_TEST m
USING (
SELECT l_cities(idx) as city_id
,'N' as flag
FROM Dual
) s
ON (m.CITY_ID = to_number(s.city_id))
WHEN NOT MATCHED THEN
INSERT (m.CITY_ID, m.FLAG)
VALUES (s.city_id, s.flag);

end loop;


:P13_COUNTRY :='';
:P13_FILTER :='';


apex_json.open_object;
apex_json.close_object;


end;


Tips

1- At least use an item like P13_COUNTRY for setting in Shuttle where clause 
2- Maximum characters that can be to save or filter in default Shuttle Item is (4000) However by this blog you can do that with (32765) Characters.
3- Speed transfer rows between left and right panel depends to count rows in shuttle item
4- If after submit you get this error then you should change the value of java -Xmx1024m -Xms256m. link1, link2


Finish this task and enjoy it.


How to test APEX Restful Services

$
0
0


One of the power tools for testing Restful Services is DHC Rest Client that is Extension of Chrome browser, so it’s simple and easy. By this extension you able to save your project and any time you access to test it.


First of all I’ll add this extension to chrome and run it.


Create a Project e.g. oracle.example.hr after that create a REQUEST. You should add a request for each Template. In this sample I’ve used the sample data (oracle.example.hr) in Oracle APEX. It can be to set to follow this image


Project Name: oracle.example.hr
Request Name: employees
URL: https://apex.oracle.com/pls/xxxx/hr/employees/
Method: GET




First sample is ready to test, second sample will use {ID} and should be to add new REQUEST. After push Send button we can get some information and respond of Restful service such as {Body respond, Elapsed time, Header info and etc.}


Add a new REQUEST



When to push Send button


Now I want to add a new REQUEST with POST method so before I had created a  new Template insemp to sample Restful in oracle APEX.

RESTful Service Module: oracle.example.hr
URI Template: insemp/
Method: POST
Source Type: PL/SQL
Source:
begin
insert into emp(empno,ename) values(:ID,:NAME) returning EMPNO into :EMPNO;
commit;
end;


Parameters:
EMPNO  OUT  Response Body
ID            IN      HTTP Header
NAME    IN      HTTP Header


In DHC to set like this and when to click on Send button you ‘ll see below response.

Project Name: oracle.example.hr
Request Name: employees
URL: https://apex.oracle.com/pls/xxxx/hr/insemp/
Method: POST
HEADERS:
ID
NAME




Oracle APEX_APPLICATION Synonyms

$
0
0

Oracle APEX_APPLICATION Synonyms

Oracle APEX_APPLICATION synonyms are worth exploring. As is often said, APEX is written in APEX. That means means that any APEX developer can undertake using some of the tools that the APEX development teams left for us in this tool kit. Let’s take a look and find a few uses for the Oracle public synonyms that lay at our fingertips.

Public Synonyms

The first step is finding them. With SQL Developer, I use filters on Public Synonyms. In the illustration, I show a filter for NAME LIKE APEX_%

Oracle APEX_APPLICATION Synonyms

Filter Public Synonyms for APEX_%

Best Targets

Many (or most) of these synonyms are views pulling data from multiple tables in the APEX home schema. These are relatively safe to explore because a developer can not update tables through these views.

select * from apex_applications;
select * from apex_application_tables;

What are the best targets? Start with familiar and identifiable data such as all applications, then take a look at the pages for applications.

The APEX Team Development data are available here as well:

  • APEX_TEAM_BUGS
  • APEX_TEAM_FEATURES
  • APEX_TEAM_FEEDBACK
  • APEX_TEAM_FEEDBACK_FOLLOWUP
  • APEX_TEAM_MILESTONES
  • APEX_TEAM_TODOS

How, Why, Where to Use?

There are ample opportunities to take advantage of the data within the tables. You can use query responses within APEX to regulate behavior of an application. Alternatively, you can query the data externally to evaluate the consistency of development work performed. The ambitious amongst us might plot to put together their own “advisor” tool set or capture activity logs as part of a quality assurance process.

Synonyms in an Application

A few examples to kick things off… Let’s envision a region defined on an Oracle APEX Global Page. I want it to display only when the page mode is “Normal”. I don’t want to waste space on dialogue boxes.

With my region, I add a “Rows Returned” condition with the following query:

select page_id
from apex_application_pages
where application_id = :APP_ID
and page_id = :APP_PAGE_ID
and page_mode like 'Normal%'

Ad-Hoc Advisor

If a team wants to explore the consistency of their work, a few queries may help. I have used it to find old button CSS from APEX 4. In the example below, I want to discover how many pages do not have help text:

select 
	page_id,
	page_name,
	page_title
from apex_application_pages 
where application_id = 101 
	and (
	help_text is null or
	help_text like 'No help is available for this page.'
			);

You can do the same for page access protection, pages requiring authentication, or button styles, or page item styles. Pretty much anything within your application, you can see if your approach has been consistent.

Are all of my cancel buttons grey?

Are all of my save buttons hot?

Here is an example for seeing how complete the help text is for items…

 

select
	page_id,
	page_name,
	item_name,
	display_as,
	label,
	item_help_text
from apex_application_Page_items
where application_id = 101
	and display_as <> 'Hidden'
	and display_as <> 'Display Only';

Quality Assurance Tools

The Oracle APEX development team provides us a view called APEX_DEVELOPER_ACTIVITY_LOG. This view provides insights on all development efforts within APEX. I have spent month and months exploring these data with the question: How do I improve the quality management process within APEX. Part of the answer sits here.

If I want to link:

  • Applications
  • to Releases
  • to Bug/Features
  • to coding efforts

Then part of my answer is in this view: APEX_DEVELOPER_ACTIVITY_LOG. (The other part exists as database changes that I can get from database views). Like a plastic shovel on a beach, I can now scoop all of the changes, additions, deletions made by developers into a table. I can link that activity with bugs or release data and the developer responsible. I can go further and use these data to develop a test plan. I pack these granular bits into my bucket and tip out structures that assist a development team. It is not just a change log. It is not just Big Brother watching, or another token in a Blame-Game of who buggered what. It become a means of linking building and supporting an application with the release notes, the change log, the test plan. It is a building block in robust software development.

At Storm Petrel, we’ve started, but that is it.

What Next?

Please ask me what would make these synonyms/views more powerful?

First, to really work with these data we do need a primary key, that unique think that allows use to link local data to these behind-the-scenes data. While some data are inherently unique, some just are not. The APEX_DEVELOPER_ACTIVITY_LOG is one such view. If you copy data from this view to a local table, the process of linking back is cumbersome.

Second, I have an easy time envisioning a packaged application that brings Team Development tools and developer activities together such that the application and its related data are portable. We lost such stuff when we moved from 11g to 12c. Team Development data was lost when we moved from 4.x to 5.x. And we are developers, we “improving” stuff (whether or not it actually improved!). We’re looking at this potential from the edge. APEX is a awesome tool.

 

 

The post Oracle APEX_APPLICATION Synonyms appeared first on Oracle Blog .

APEX plugin files and 404 not found in ORDS

$
0
0

After installing APEX 5.0.4 and ORDS 3.0.8 I had an issue where APEX plugins that have static files bundled with the plugin (files that at runtime get mapped to URLs such as /ords/your_workspace_name/r/your_app_id/files/plugin/123456789/v1/filename) were giving a 404 "not found" error from ORDS. Well, you actually have to open the console in the web browser to see the 404 errors, and then if you try to open the file directly you get a 404 page from ORDS:


I had seen this problem before, and it is typically because you have not run the apex_rest_config.sql script as part of your APEX installation, as explained by Patrick Wolf here and also in the docs.


However, in my case I was fairly certain I had already run the apex_rest_config.sql script. I re-ran it just in case (and restarted Tomcat), but I still got the error.

I then inspected the Tomcat log files (look in /usr/share/tomcat8/latest/logs/catalina.out) and found the following:

SEVERE [ajp-nio-8009-exec-1] . *** The pool named: |apex|pu| is reporting no APEX workspaces are enabled for RESTful Services,
 but the pool named: |apex|al| is reporting 1 workspaces are enabled.
This implies APEX was installed after Oracle REST Data Services. Please run the following command and restart Oracle REST Data Services:
        java -jar ords.war validate --database apex
APEX based RESTful Services, including those used to serve static resources will not function until this has been done.



So I did as instructed and ran this command

java -jar ords.war validate --database apex

and then restarted Tomcat

service tomcat restart

And that resolved this issue.


Viewing all 2258 articles
Browse latest View live