Exporting Components to Another App/Workspace

Posted: September 28, 2012 in Oracle APEX
Tags: ,

Oracle APEX, being much smarter than you (and me, and the rest of the software development community), won’t allow you to do something crazy like exporting components, i.e. one or more pages, from one workspace, let’s call it DEVELOPMENT, to another called, for instance, TEST.

Additionally, it protects you from yourself by not allowing you to move components from one application to another within the same workspace. That has “helped” me on several occasions.

For those who insist on doing things the hard way, these fantastic features can be overridden as follows:

    1. Do a component export of one or more pages from your working application
    2. Open the saved file in a text editor, locate the area near the top where it says:

“prompt APPLICATION XXX……"

  1. Change the existing value to match exactly the value of your destination application.
  2. Scroll down to "prompt Set Application ID..."
  3. Change the XXX in:wwv_flow.g_flow_id := nvl(wwv_flow_application_install.get_application_id,XXX);

    to the APP ID of your destination APP ID

  4. Locate the following section:

    begin
    --Assumes you are running the script
    --connected to SQL*Plus as the Oracle user
    --APEX_040000 or as the owner
    --(parsing schema) of the application.
    wwv_flow_api.set_security_group_id(p_security_group_id => 
    nvl(wwv_flow_application_install.get_workspace_id,5560122870882470));
  5. end;Change the workspace ID to the correct value for your target workspace. You can find this value by exporting a file from the target workspace, and copying the Workspace ID from that file into the file you will import. If you are exporting to another project in the same workspace, this step should not be necessary.
  6. Save the file and attempt to import it into your destination application.
  7. Once it imports successfully, open each imported page and reset the template type for all of your display items, e.g. regions and buttons, etc.
  8. For example, if you were using Report Region before, the same region in the new page will be reset to No Template. Other things in the page may have a gibberish value like 84849948884994949. This is a sign that you need to re-select the correct value.
  9. You need to reset all of these settings for each page that you import; it’s kind of a trial and error thing. I recommend doing one page at a time until you have restored the appearance.
Comments