Showing posts with label Export. Show all posts
Showing posts with label Export. Show all posts

Thursday, 7 December 2017

Exporting an APEX page plus Shared Components

Imagine, if you will, a really large application. Perhaps it's a reporting application, and you've just created a new page (report) and an associated breadcrumb. 

Now for migration. You have a choice between exporting the entire application, or you could just export the page. But what about the associated breadcrumb? What about the LOV?

This is where the Component Export can help.

You'll find it in the Tasks menu when you start to export your application.

Tip: Keep an eye out for these Task menus, they can 'hide' interesting features
From there you can find, then check the most recently modified components to your application, then press "Add to Export" to add them to what I would imagine would be an apex_collection.

Creating this type of page would be a good learning exercise

The final confirmation, with the additional option to export as of x minutes ago.



Upon export you'll receive a file that looks just like a normal export, just with your selected components.
f102_components.sql

There are advantages to exporting only selected components. For instance, during a full application install, existing users will remove existing user sessions for the application unless you use apex_application_install.set_keep_sessions on the command line.

Though are a few reasons to take care.

For example, when I exported/imported the List for my left sidebar menu, the menu disappeared from my runtime view.
I had to re-assign the list as the navigation menu.
Shared Components - User Interface - Nagivation Menu - Navigation Menu List.

Exporting without the list was ok, so for all good for data driven (dynamic) menus. In that case the page should only appear in the menu when the relevant security tables say so.

And the export may not be as granular as you need. Or perhaps you'll forget components. Or perhaps your changes overlap with others.

Component export is fit for some purposes, and has been around forever. Give it a go.

And wouldn't you know, turns out it was a year ago today that I also felt compelled to blog about this very topic.



Wednesday, 7 December 2016

APEX Component Export

A common question when it comes to migrating APEX applications is "can I just export a page".

There are more technical posts on the topic of exporting APEX applications than this one out there, eg:
HÃ¥vard Kristiansen
Christoph Ruepprich
Alan Warren
John Scott
I just wanted to clarify the concept, perhaps for those learning the tool.

So the answer? Sure you can, but what about other components related to that page? A breadcrumb; menu list entry; LOV? What about application items? Are you sure you've got everything?

So with this in mind, when you start the process export an APEX application you have a side-option to do a Component Export, which might look like this:


From here we can not just nominate the page, but identify other components to add to the export. The exported SQL is just a subset of the entire application. (I wonder when this will become JSON?)

However, the only time I consider doing this is for a reporting application where I know the only components in a new report is the page itself and a breadcrumb. The menu is dynamic so the existence of the page is enough.

Otherwise, perhaps for an operational style application, I think the risk of missing changes it too high not to do a full export.

Build options can also help you find your bundle, but even then diligence needs to be high.



Wednesday, 7 March 2012

Exporting deleted Apex applications

It's very rare I lose a piece of work, but recently when removing a bunch of miscellaneous applications from my workspace, I inadvertently removed one that I think I should have kept - so I thought I better go restore it.

Update: June 2016: Turns out there's a craftier solution - just create a new blank application with the same app_id, then you can use the declarative offering.

Heading over to the application export, we can in fact export applications as of x many minutes ago. I know a few people who have used this feature to save lost work, but it's dependent on a number of factors - one of which is that your application still needs to be present in the workspace!

So I got my database to turn back time so I could export the application from the database before I nuked it.

Trouble is, in my first effort, I went a little too far.

See, in the midst of battle, I wasn't sure exactly when I removed it, and how far on my little laptop db I could create time paradoxes.

I found the magic number then grabbed a copy of my application - I could have done the same thing via the SQL Developer GUI but I just happened to have this syntax on hand.

And so that's how I saved the day, well, as it turns out I did have a copy after all.

Of course, when I try to double check information about this particular feature, I find people like Tyler wrote about this some time ago. Never hurts to have a reminder :-)

-- to assist with googlers, I thought I better add the code, instead of just the image.
exec dbms_flashback.enable_at_time(systimestamp-0.17);
select wwv_flow_utilities.export_application_to_clob(120) from dual;
select * from apex_applications;

ScottWe.