Is there a way to change Application Availability by code on Oracle APEX 4.2.6 - oracle

I need to change an Application Avaiability by code in Oracle Apex 4.2.
I APEX 5 there is a apex_util.set_application_status method. Is there anything similar on Apex 4?
Thanks!

I've been using this undocumented, unsupported API call for years with no problems so far:
wwv_flow_api.set_flow_status
(p_flow_id => 100
,p_flow_status => 'UNAVAILABLE_URL'
,p_flow_status_message => 'http://www.example.com/system_unavailable.html'
);
To make it available again:
wwv_flow_api.set_flow_status
(p_flow_id => 100
,p_flow_status => 'AVAILABLE'
);
To make the developer toolbar available:
wwv_flow_api.set_flow_status
(p_flow_id => 100
,p_flow_status => 'AVAILABLE_W_EDIT_LINK'
);
https://jeffkemponoracle.com/2015/07/deploying-apex-showing-an-under-maintenance-web-page/

Related

Where is Oracle APEX source code framework located

Recently i start learning Oracle APEX and i have a question (i'm familiar with plsql):
Where is the source code for APEX located, in which schema ?
EG: For this piece of code where can i find APEX_COLLECTION.COLLECTION_EXISTS souce code :
IF :P9_HOW_MANY is NOT NULL and :P9_HOW_MANY > 0 then
IF NOT APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'CHILDREN') THEN
APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
p_collection_name => 'CHILDREN');
END IF;
APEX_COLLECTION.ADD_MEMBERS(
p_collection_name => 'CHILDREN',
p_c001 => apex_application.g_f01,
p_c002 => apex_application.g_f03,
p_c003 => apex_application.g_f04,
p_c004 => apex_application.g_f02
);
End IF;
Thank you.
I think i found the answer, i will leave this here in case it helps anyone:
APEX_COLLECTION
APEX_ITEM
ETC..
all are public synonyms located in SYS schema and the source code is in APEX_190200 schema on the WWV_FLOW_COLLECTION package.

How to register binary XML schema (using Oracle12c)?

I have a problem with registering BINARY XML schema using Oracle 12c version.
If I'm correct BINARY scheme registration option is available since Oracle 11g version? But using 12c it shows me an error that BINARY option is still not declared.
BEGIN
DBMS_XMLSCHEMA.REGISTERSCHEMA
(
SCHEMAURL => 'http://localhost:8080/public/leagues.xsd',
SCHEMADOC => bfilename('XMLDIR', 'LEAGUES.xsd'),
GENTYPES => FALSE,
OPTIONS => REGISTER_BINARYXML
);
END;
/
As a result of this, I receive an error :
PLS-00201: identifier 'REGISTER_BINARYXML' must be declared
Because that option (register_binaryxml) should be invoked through dbms_xmlschema package as dbms_xmlschema.register_binaryxml.
That is, replace options => register_binaryxml with options => dbms_xmlschema.register_binaryxml

Laravel localization file format error: array() versus [] format

I am struggling a bit with localization in Laravel 5.3 (with php 7). The default localizaiton file format in Laravel 5.3 is using brackets, as in this example:
return [
'footer.contact.email' => 'Email:',
]
That's what I have been using in my app and it's working fine. But now I am trying to work with some packages to help with translations, for example:
https://github.com/potsky/laravel-localization-helpers
https://github.com/barryvdh/laravel-translation-manager
But both of those generate localization files in the "old" laravel 4.x array format. For example
return array(
'footer' => array(
'contact' => array(
'email' => 'Email:',
),
),
);
As I understand it I should have no issue with this localization file format in my laravel 5.3 app, however it's always throwing an exception:
[2016-12-02 13:26:01] local.ERROR: ErrorException: htmlspecialchars() expects parameter 1 to be string, array given in C:\100_source_code\consulting_platform_laravel\maingig\vendor\laravel\framework\src\Illuminate\Support\helpers.php:519
Stack trace:
#0 C:\100_source_code\consulting_platform_laravel\maingig\vendor\sentry\sentry\lib\Raven\Breadcrumbs\ErrorHandler.php(36): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'htmlspecialchar...', 'C:\\100_source_c...', 519, Array)
I really cant understand why this format is not working with my app. I bet it is something trivial that I am missing, but any help would be very welcome!
Thanks,
Christian
After a few extra hours of stepping through the code I found the source of the problem.
For example, I got these in my original lang file:
'footer.subscribe' => 'SUBSCRIBE TO OUR NEWSLETTER',
'footer.subscribe.intro' => 'Be the first to know about our latest news...',
'footer.subscribe.privacy' => 'Privacy Policy',
'footer.subscribe.tos' => 'Terms of Service',
'footer.subscribe.tac' => 'Terms and Conditions',
As I tried to use both of the packages mentioned in my original question they produced the following output:
'footer' =>
array (
'subscribe' =>
array (
'intro' => 'TODO: intro',
'privacy' => 'TODO: privacy',
'tos' => 'TODO: tos',
'tac' => 'TODO: tac',
),
),
As you can see the generated file dropped the value for the text footer.subscribe and only kept the child element, intro, privacy, tos and tas in this case. Therefore a request for trans('footer.subscribe') returns an array and not the text.
Now that I know this I will change the format of my original translation file!
c.

Unable to programmatically create tags in GitHub - ISO8601 timestamp is invalid

In my lumen app I'm trying to programmatically create tags a GitHub repo. My setup is working great except something is up with the tagger.date that I can't figure out. The API is telling me that the timestamp is not valid:
[Github\Exception\RuntimeException]
Invalid request.
2016-07-10T13:32:07+0000 is not a valid date-time.
However the timestamp included in the error message appears to be correctly formatted based on the documentation.
$github->git()->tags()->create(
$githubConfig['namespace'],
$githubConfig['repository'],
[
'tag' => $this->version->patchTag(),
'tagger' => [
'name' => config('github.tagger.name'),
'email' => config('github.tagger.email'),
'date' => Carbon::now()->toIso8601String()
],
'message' => 'This release was automatically published by [Game-Watcher](https://github.com/bkuhl/game-watcher).',
'object' => $masterBranch['commit']['sha'],
'type' => 'commit'
]
);
This fiddle indicates the time format is valid.
Try using Carbon::now()->toAtomString() instead.
Carbon's common formatting methods are "wrappers for the common formats provided in the DateTime class".
The documentation for DateTime::ISO8601 carries this warning:
Note: This format is not compatible with ISO-8601, but is left this way for backward compatibility reasons. Use DateTime::ATOM or DATE_ATOM for compatibility with ISO-8601 instead.
The relevant difference appears to be with the timezone offset. DateTime::ISO8601 uses +0000 for UTC, while DateTime::ATOM uses +00:00.

InstantCommons not working in MediaWiki 1.19 and SELinux

I am setting my own MediaWiki website locally, and am not able to get the InstantCommons feature to work (used to directly embed files from commons.wikimedia.org).
I get no error message, the files I try to load from Commons using the following syntax:
[[File:Cervus elaphus Luc Viatour 1.jpg|Cervus elaphus Luc Viatour 1]]
are just not loaded, and I end up with a red link on my page, referring to a non-existing file. It has been 2 days now that I am looking for a solution, but so far without any success.
I am running:
MediaWiki v.1.19.1
Fedora 16 (with SElinux)
PHP 5.3.15
MySQL Ver 14.14 Distrib 5.5.25a, for Linux (x86_64)
I have tried the following two configurations in my LocalSettings.php, without success:
$wgUseInstantCommons = true;
AND
$wgForeignFileRepos[] = array(
'class' => 'ForeignAPIRepo',
'name' => 'shared',
'apibase' => 'http://commons.wikimedia.org/w/api.php',
'fetchDescription' => true, // Optional
'descriptionCacheExpiry' => 43200, // 12 hours, optional (values are seconds)
'apiThumbCacheExpiry' => 43200, // 12 hours, optional, but required for local thumb caching
);
Any suggestion is most welcome.
OK, this is not (yet) an answer, but a debugging suggestion. It looks to me like the HTTP request from your server to Commons is failing for some reason, but unfortunately ForeignAPIRepo doesn't indicate the cause of the error in any way.
This is really a bug in MediaWiki, and should be fixed, but in the mean time, could you please try applying the following diff (or just manually adding the line marked with the + sign) to your includes/filerepo/ForeignAPIRepo.php file:
Index: includes/filerepo/ForeignAPIRepo.php
===================================================================
--- includes/filerepo/ForeignAPIRepo.php (revision 97048)
+++ includes/filerepo/ForeignAPIRepo.php (working copy)
## -385,6 +385,7 ##
if ( $status->isOK() ) {
return $req->getContent();
} else {
+ wfDebug( "ForeignAPIRepo: HTTP GET failed: " . $status->getXML() );
return false;
}
}
After applying it, try loading the file description page for a Commons image and look at the MediaWiki debug log. There should now be a line starting with ForeignAPIRepo: HTTP GET failed: followed by a few lines of XML error dump. That error data should hopefully indicate what's going wrong; please copy and paste it here.
Mine is not a definitive answer either. Referring to Ilmari Karonen's post, I was unable to find or get the getXML() method to execute for my version of Mediawiki v1.23.0. I was looking at the reference documentation found here to try and find any other method calls on the Status class that would give me good troubleshooting info. I ended up finding the following and editing the same file as mentioned in Ilmari Karonen's post includes/filerepo/ForeignAPIRepo.php beginning at line #521:
if ( $status->isOK() ) {
return $req->getContent();
} else {
$error = $status->getErrorsArray();
$dump = print_r($error, true);
wfDebug("ForeignAPIRepo: HTTP GET failed: $dump\n");
return false;
}
The default InstantCommons configuration of older MediaWikis is a bit silly. Due to T114098 I recommend one of the following, which will hopefully fix your problems:
upgrade to MediaWiki 1.27 (when it's released), or
set your LocalSettings.php to hotlink images to save on server-side requests and processing.
$wgUseInstantCommons = false;
$wgForeignFileRepos[] = array(
'class' => 'ForeignAPIRepo',
'name' => 'commonshotlink',
'apibase' => 'https://commons.wikimedia.org/w/api.php',
'hashLevels' => 2,
'url' => 'https://upload.wikimedia.org/wikipedia/commons',
'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/commons/thumb',
'transformVia404' => true,
'fetchDescription' => true,
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 24 * 3600,
);

Resources