Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi...

64
Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013

Transcript of Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi...

Page 1: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Professioneel Software Ontwikkelen met Oracle Application Express

Rob van Wijk

APEX World, Figi Zeist, 9 april 2013

Page 2: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Rob van Wijk sinds 1972

Oracle sinds 1995

Ciber sinds 2003

Oracle ACE sinds 2008

Oracle University SQL Masterclass sinds 2011

Blog: rwijk.blogspot.com

Twitter: @rwijk

Eigen APEX-applicatie: www.robstourpoules.nl

Wie ben ik

Page 3: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

pro·fes·si·o·neel(bijvoeglijk naamwoord, bijwoord)

3. (als) van een vakman: een professionele aanpak

Source: http://dictionary.reference.com/browse/professional?s=t

Page 4: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Do you use source control?

Can you make a build in one step?

Do you make daily builds?

Do you have a bug database?

Do you fix bugs before writing new code?

Do you have an up-to-date schedule?

Do you have a spec?

Do programmers have quiet working conditions?

Do you use the best tools money can buy?

Do you have testers?

Do new candidates write code during their interview?

Do you do hallway usability testing?

The Joel Test

Source: http://www.joelonsoftware.com/articles/fog0000000043.html

Page 5: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Do you use source control?

Can you make a build in one step?

Do you make daily builds?

Do you have a bug database?

Do you fix bugs before writing new code?

Do you have an up-to-date schedule?

Do you have a spec?

Do programmers have quiet working conditions?

Do you use the best tools money can buy?

Do you have testers?

Do new candidates write code during their interview?

Do you do hallway usability testing?

The Joel Test

Source: http://www.joelonsoftware.com/articles/fog0000000043.html

Page 6: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

1. Versiebeheer2. Autonome ontwikkelomgevingen3. Applicatieopbouw in één stap4. Continu Integreren

Agenda

Page 7: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Development User AcceptanceTest

Page 8: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

1. Versiebeheer

Page 9: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Doelstelling

De historie van alle bestanden nodig voor de opbouw van de gehele applicatie bewaren.

Page 10: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Vergemakkelijkt delen van bestanden met collega’s

Verliezen van code is praktisch onmogelijk

Versiebeheer op componentniveau

Page 11: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.
Page 12: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

svn repository

tekstsvn

chec

kout

svn c

omm

itsv

n u

pdate

Page 13: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Subversion client voor Windows:

Page 14: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Subversion client voor de Mac:Cornerstone

Page 15: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Oracle Application ExpressOracle Application ExpressAPEX_040100-schemaAPEX_040100-schema

DATA-schemaDATA-schemaTabellen, data, indices, sequencesTabellen, data, indices, sequences

UI-schemaUI-schemaAPEX’s parsing schema, bevat views en packages met aanroepen naar API-laagAPEX’s parsing schema, bevat views en packages met aanroepen naar API-laag

API-schemaAPI-schemaDatabase packages met applicatielogicaDatabase packages met applicatielogica

views die uit detabellen selecteren

select, insert, update & delete

API-aanroepen

Page 16: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Kleinst mogelijke verzameling van systeemprivileges

Geen CREATE SESSION privilege

Wachtwoord gegenereerd met dbms_random.string(‘a’,30)

UI, API & DATA schema

Page 17: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.
Page 18: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

APEXExport

APEXExportSplitter

Page 19: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.
Page 20: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> select * from meta.mta_applicaties 2 /CODE NAAM APEX_APPLICATIE_ID---------- ------------------------------------------------- ------------------CV Ciber CV's 1SCA Standen Collectie Applicatie 22 rijen geselecteerd.

Page 21: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> desc meta.mta_admin...PROCEDURE TOEVOEGEN_APPLICATIE Argument Name Type In/Out Default? ----------------------------- ----------------------- ------ -------- P_CODE VARCHAR2(10) IN P_NAAM VARCHAR2(50) IN P_APEX_APPLICATIE_ID NUMBER(5) IN

...FUNCTION APEX_APPLICATIE_ID RETURNS NUMBER Argument Name Type

In/Out Default? ------------------------------ ----------------------- ------ -------- P_APE_CODE VARCHAR2(10) IN...PROCEDURE VERWIJDEREN_APPLICATIE Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- P_CODE VARCHAR2(10) IN...

Page 22: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

De uitdaging met APEX enbestandsgebaseerd versiebeheer:

Page 23: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

De inhoud van jouw APEX-werkfolder

De inhoud van jouw APEX-applicatie

Page 24: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

exporteer de wijzigingen in de APEX-repositoryuit je eigen werkruimte naar jouw werkfolder

svn updateimporteer de inhoud van jouw werkfolder

naar de APEX-repository in jouw werkruimte

Page 25: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

rm -rf $HOME/ciber/apexsofa/$1/apexcd $HOME/ciber/apexsofa/$1java oracle.apex.APEXExport\ -db ourserver:1521:APEXSOFAO\ -user apex_040100\ -password secret\ -applicationid $2\ -skipExportDatejava oracle.apex.APEXExportSplitter f$2.sqlmv f$2 apexcd apexsed s_@application_@$1/apex/application_\ <install.sql\ >../non-apex/install/install_apex_components.sqlsvn status | grep ^\? | awk '{print $2}' | xargs svn addsvn status | grep ^\! | awk '{print $2}' | xargs svn delete --forcesvn updatecd ... non-apex/install/reinstall_apex

zz

zz

Page 26: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

MacBookPro:application robvanwijk$ svn update Conflict discovered in 'pages/page_00004.sql'.

Select: (p) postpone, (df) diff-full, (e) edit,

(mc) mine-conflict, (tc) theirs-conflict,

(s) show all options: p

C pages/page_00004.sql

Updated to revision 96.

Summary of conflicts:

Text conflicts: 1

MacBookPro:application robvanwijk$ ls page_00004.sql*

page_00004.sql page_00004.sql.mine

page_00004.sql.r95 page_00004.sql.r96

Merge conflict

Page 27: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

wwv_flow_api.create_page_button(

p_id => 9921078634714986 + wwv_flow_api.g_id_offset,

p_flow_id => wwv_flow.g_flow_id,

p_flow_step_id => 4,

p_button_sequence=> 10,

p_button_plug_id => 9918676911714819+wwv_flow_api.g_id_offset,

p_button_name => 'CREATE',

p_button_action => 'REDIRECT_PAGE',

p_button_image => 'template:'||to_char(11795888447107612+wwv_flow_api.g_id_offset),

p_button_is_hot=>'N',

<<<<<<< .mine

p_button_image_alt=> 'Maak aan',

=======

p_button_image_alt=> 'Aanmaken',

>>>>>>> .r96

p_button_position=> 'REGION_TEMPLATE_CREATE',

p_button_alignment=> 'RIGHT',

p_button_redirect_url=> 'f?p=&APP_ID.:5:&SESSION.::&DEBUG.:5',

p_required_patch => null + wwv_flow_api.g_id_offset);

Merge conflict

Page 28: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

whenever sqlerror exit failure

Page 29: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Development database

APEXAPEXWorkspace CiberWorkspace Ciber

CV SCACV SCA

SchemaSchemaSCA_UISCA_UI

SchemaSchemaSCA_APISCA_API

SchemaSchemaSCA_DATASCA_DATA

SchemaSchemaCV_UICV_UI

SchemaSchemaCV_APICV_API

SchemaSchemaCV_DATACV_DATA

SchemaSchemaMETAMETA

User User INSTALLINSTALL

Page 30: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

2. Autonome ontwikkelomgevingen

Page 31: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

“The developer should be free to experiment as much as possible, safe in the knowledge

that the worst that could happen is they destroy only their own environment and not

impact the productivity of others.” - Nick Ashley

Source:

http://dbdeploy.com/documentation/taking-control-of-your-database-development-white-paper/

Page 32: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

iedere ontwikkelaar heeft zijn eigenvier database schema’s:

RWIJKRWIJK_UIRWIJK_API

RWIJK_DATA

Page 33: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

en iedere ontwikkelaar heeft zijneigen APEX-werkruimte

Page 34: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

ontwikkeldatabase

APEXAPEXWorkspace CiberWorkspace Ciber

CV SCACV SCA

SchemaSchemaSCA_UISCA_UI

SchemaSchemaSCA_APISCA_API

SchemaSchemaSCA_DATASCA_DATA

SchemaSchemaCV_UICV_UI

SchemaSchemaCV_APICV_API

SchemaSchemaCV_DATACV_DATA

SchemaSchemaMETAMETA

User User INSTALLINSTALL

Workspace Workspace RWIJKRWIJKSCASCA

SchemaSchemaRWIJK_UIRWIJK_UI

SchemaSchemaRWIJK_APIRWIJK_API

SchemaSchemaRWIJK_DATARWIJK_DATA

Workspace MPLASWorkspace MPLASCV SCACV SCA

SchemaSchemaMPLAS_UIMPLAS_UI

SchemaSchemaMPLAS_APIMPLAS_API

SchemaSchemaMPLAS_DATAMPLAS_DATA

UserUserRWIJKRWIJK

UserUserMPLASMPLAS

Page 35: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> select code 2 , naam 3 , apex_applicatie_id_van 4 , apex_applicatie_id_tm 5 from meta.mta_ontwikkelaars 6 /CODE NAAM APEX_APPLICATIE_ID_VAN APEX_APPLICATIE_ID_TM---------- ------------------- ---------------------- ---------------------RWIJK Rob van Wijk 10000 10999MPLAS Marcel van der Plas 11000 11999MHOEFS Marcel Hoefs 12000 12999EASLAN Erdal Aslan 13000 13999ASUVEREIN Arne Suverein 14000 14999EHAMERS Etienne Hamers 15000 15999LSAVALKA Larysa Savalka 16000 169997 rijen geselecteerd.

Page 36: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> desc meta.mta_admin...PROCEDURE TOEVOEGEN_ONTWIKKELAAR Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- P_CODE VARCHAR2(10) IN P_NAAM VARCHAR2(30) IN P_APEX_APPLICATIE_ID_VAN NUMBER(5) IN P_APEX_APPLICATIE_ID_TM NUMBER(5) IN

...PROCEDURE VERWIJDEREN_ONTWIKKELAAR Argument Name Type In/Out

Default? ------------------------------ ----------------------- ------ -------- P_CODE VARCHAR2(10) IN...

Page 37: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> select owr_code 2 , ape_code 3 , apex_applicatie_id 4 from meta.mta_applicatiekopieen 5 order by apex_applicatie_id 6 /OWR_CODE APE_CODE APEX_APPLICATIE_ID---------- ---------- ------------------RWIJK CV 10000RWIJK SCA 10001MPLAS CV 11000MPLAS SCA 11001MHOEFS SCA 12000MHOEFS CV 12001EASLAN SCA 13000EASLAN CV 13001ASUVEREIN SCA 14000EHAMERS SCA 15000LSAVALKA SCA 16000LSAVALKA CV 1600112 rijen geselecteerd.

Page 38: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> desc meta.mta_admin...PROCEDURE TOEVOEGEN_APPLICATIEKOPIE Argument Name Type

In/Out Default? ----------------------------- ----------------------- ------ -------- P_OWR_CODE VARCHAR2(10) IN P_APE_CODE VARCHAR2(10) IN P_APEX_APPLICATIE_ID NUMBER(5) IN DEFAULT

FUNCTION APEX_APPLICATIE_ID RETURNS NUMBER Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- P_APE_CODE VARCHAR2(10) IN P_SCHEMAPREFIX VARCHAR2 INFUNCTION APEX_WERKRUIMTE_ID RETURNS NUMBER Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- P_SCHEMAPREFIX VARCHAR2 INPROCEDURE VERWIJDEREN_APPLICATIEKOPIE Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- P_OWR_CODE VARCHAR2(10) IN P_APE_CODE VARCHAR2(10) IN

...

Page 39: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

set define offset verify offset feedback offWHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACKbegin wwv_flow.g_import_in_progress := true; end; / --application/set_environmentprompt APPLICATION 10001 - SCA---- Application Export:-- Application: 10001-- Name: SCA-- Exported By: -- Flashback: 0-- Export Type: Application Export-- Version: 4.1.1.00.23-- Instance ID: 63130648066820 -- Import:-- Using application builder-- or-- Using SQL*Plus as the Oracle user APEX_040100 or as the owner (parsing schema) of the application. -- Application Statistics:-- Pages: 2-- Items: 3-- Computations: 0-- Validations: 0-- Processes: 4-- Regions: 2-- Buttons: 0-- Dynamic Actions: 0-- Shared Components-- Breadcrumbs: 1-- Entries 1-- Items: 0-- Computations: 0-- Processes: 0-- Parent Tabs: 0-- Tab Sets: 0-- Tabs: 0-- NavBars: 1-- Lists: 0-- Shortcuts: 0-- Themes: 1-- Templates:-- Page: 17-- List: 17-- Report: 11-- Label: 6-- Region: 34-- Messages: 0-- Build Options: 0 -- AAAA PPPPP EEEEEE XX XX-- AA AA PP PP EE XX XX-- AA AA PP PP EE XX XX-- AAAAAAAAAA PPPPP EEEE XXXX-- AA AA PP EE XX XX-- AA AA PP EE XX XX-- AA AA PP EEEEEE XX XXprompt Set Credentials... begin -- Assumes you are running the script connected to SQL*Plus as the Oracle user APEX_040100 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,1597919183057345)); end;/

begin wwv_flow.g_import_in_progress := true; end;/begin

select value into wwv_flow_api.g_nls_numeric_chars from nls_session_parameters where parameter='NLS_NUMERIC_CHARACTERS';

end;

/begin execute immediate 'alter session set nls_numeric_characters=''.,''';

end;

/begin wwv_flow.g_browser_language := 'en'; end;/prompt Check Compatibility... begin -- This date identifies the minimum version required to import this file.wwv_flow_api.set_version(p_version_yyyy_mm_dd=>'2011.02.12'); end;/

prompt Set Application ID... begin -- SET APPLICATION ID wwv_flow.g_flow_id := nvl(wwv_flow_application_install.get_application_id,10001); wwv_flow_api.g_id_offset := nvl(wwv_flow_application_install.get_offset,0);null; end;/

--application/delete_application begin -- Remove Applicationwwv_flow_api.remove_flow(nvl(wwv_flow_application_install.get_application_id,10001)); end;/

begin wwv_flow_audit.remove_audit_trail(nvl(wwv_flow_application_install.get_application_id,10001));null; end;/

--application/create_application begin wwv_flow_api.create_flow( p_id => nvl(wwv_flow_application_install.get_application_id,10001), p_display_id=> nvl(wwv_flow_application_install.get_application_id,10001), p_owner => nvl(wwv_flow_application_install.get_schema,'RWIJK_UI'), p_name => nvl(wwv_flow_application_install.get_application_name,'SCA'), p_alias => nvl(wwv_flow_application_install.get_application_alias,'F10001'), p_page_view_logging => 'YES', p_default_page_template=> 1912001052247903 + wwv_flow_api.g_id_offset, p_printer_friendly_template=> 1912806466247909 + wwv_flow_api.g_id_offset, p_default_region_template=> 1916306363247913 + wwv_flow_api.g_id_offset, p_error_template=> 1911932173247903 + wwv_flow_api.g_id_offset, p_page_protection_enabled_y_n=> 'Y', p_checksum_salt_last_reset => '20120606162931', p_max_session_length_sec=> null, p_compatibility_mode=> '4.1', p_home_link=> 'f?p=&APP_ID.:1:&SESSION.', p_flow_language=> 'nl', p_flow_language_derived_from=> 'FLOW_PRIMARY_LANGUAGE', p_allow_feedback_yn=> 'N', p_date_format=> 'dd-mm-yyyy', p_date_time_format=> 'dd-mm-yyyy hh24:mi:ss', p_timestamp_format=> 'dd-mm-yyyy hh24:mi:ssxff', p_timestamp_tz_format=> 'dd-mm-yyyy hh24:mi:ssxff tzr', p_flow_image_prefix => nvl(wwv_flow_application_install.get_image_prefix,'/i/'), p_publish_yn=> 'N', p_documentation_banner=> '', p_authentication=> 'PLUGIN', p_authentication_id=> 1921907684247927 + wwv_flow_api.g_id_offset, p_login_url=> '', p_logout_url=> '', p_application_tab_set=> 0, p_public_url_prefix => '', p_public_user=> '', p_dbauth_url_prefix => '', p_proxy_server=> nvl(wwv_flow_application_install.get_proxy,''), p_cust_authentication_process=> '', p_cust_authentication_page=> '', p_custom_auth_login_url=> '', p_flow_version=> 'release 1.0', p_flow_status=> 'AVAILABLE_W_EDIT_LINK', p_flow_unavailable_text=> '', p_build_status=> 'RUN_AND_BUILD', p_exact_substitutions_only=> 'Y', p_browser_cache=>'N', p_browser_frame=>'D', p_vpd=> '', p_vpd_teardown_code=> '', p_csv_encoding=> 'Y', p_default_error_display_loc=> 'INLINE_WITH_FIELD_AND_NOTIFICATION', p_theme_id => 24, p_default_label_template => 1920401041247919 + wwv_flow_api.g_id_offset, p_default_report_template => 1919720720247918 + wwv_flow_api.g_id_offset, p_default_list_template => 1918827351247916 + wwv_flow_api.g_id_offset, p_default_menu_template => 1920822858247920 + wwv_flow_api.g_id_offset, p_default_button_template => 1913323201247909 + wwv_flow_api.g_id_offset, p_default_chart_template => 1914710909247912 + wwv_flow_api.g_id_offset, p_default_form_template => 1915032456247912 + wwv_flow_api.g_id_offset, p_default_wizard_template => 1917131204247913 + wwv_flow_api.g_id_offset, p_default_tabform_template => 1916306363247913 + wwv_flow_api.g_id_offset, p_default_reportr_template =>1916306363247913 + wwv_flow_api.g_id_offset, p_default_menur_template => 1914316460247912 + wwv_flow_api.g_id_offset, p_default_listr_template => 1914621431247912 + wwv_flow_api.g_id_offset, p_default_irr_template => 1915417634247912 + wwv_flow_api.g_id_offset, p_last_updated_by => 'RWIJK', p_last_upd_yyyymmddhh24miss=> '20120606162931', p_required_roles=> wwv_flow_utilities.string_to_table2('')); end;/

prompt ...authorization schemes-- begin null; end;/

--application/shared_components/navigation/navigation_barprompt ...navigation bar entries-- begin wwv_flow_api.create_icon_bar_item( p_id => 1921827834247925 + wwv_flow_api.g_id_offset, p_flow_id => wwv_flow.g_flow_id, p_icon_sequence=> 200, p_icon_image => '', p_icon_subtext=> 'Logout', p_icon_target=> '&LOGOUT_URL.', p_icon_image_alt=> 'Logout', p_icon_height=> 32, p_icon_width=> 32, p_icon_height2=> 24, p_icon_width2=> 24, p_nav_entry_is_feedback_yn => 'N', p_icon_bar_disp_cond=> '', p_icon_bar_disp_cond_type=> '', p_begins_on_new_line=> '', p_cell_colspan => 1, p_onclick=> '', p_icon_bar_comment=> ''); end;/

prompt ...application processes--prompt ...application items--prompt ...application level computations-- begin null; end;/

prompt ...Application Tabs-- begin null; end;/

prompt ...Application Parent Tabs-- begin null; end;/

prompt ...Shared Lists of values--prompt ...Application Trees----application/pages/page_groupsprompt ...page groups-- begin null; end;/

--application/pages/page_00001prompt ...PAGE 1: Page 1-- begin wwv_flow_api.create_page ( p_flow_id => wwv_flow.g_flow_id ,p_id => 1 ,p_name => 'Page 1' ,p_step_title => 'Page 1' ,p_step_sub_title => 'Page 1' ,p_step_sub_title_type => 'TEXT_WITH_SUBSTITUTIONS' ,p_include_apex_css_js_yn => 'Y' ,p_cache_page_yn => 'N' ,p_help_text => 'No help is available for this page.' ,p_last_upd_yyyymmddhh24miss => '20120606162931' );null; end;/

declare s varchar2(32767) := null; l_clob clob; l_length number := 1;begins := null;wwv_flow_api.create_page_plug ( p_id=> 1923429404247939 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_page_id=> 1, p_plug_name=> 'Breadcrumbs', p_region_name=>'', p_escape_on_http_output=>'N', p_plug_template=> 1914316460247912+ wwv_flow_api.g_id_offset, p_plug_display_sequence=> 1, p_plug_display_column=> 1, p_plug_display_point=> 'REGION_POSITION_01', p_plug_source=> s, p_plug_source_type=> 'M'|| to_char(1923025113247937 + wwv_flow_api.g_id_offset), p_menu_template_id=> 1920822858247920+ wwv_flow_api.g_id_offset, p_plug_query_row_template=> 1, p_plug_query_headings_type=> 'COLON_DELMITED_LIST', p_plug_query_row_count_max => 500, p_plug_display_condition_type => '', p_plug_caching=> 'NOT_CACHED', p_plug_comment=> '');end;/ begin null; end;/

begin null; end;/

begin ----------------------------------------- ...updatable report columns for page 1-- begin null;end;null; end;/

--application/pages/page_00101prompt ...PAGE 101: Login-- begin wwv_flow_api.create_page ( p_flow_id => wwv_flow.g_flow_id ,p_id => 101 ,p_name => 'Login' ,p_alias => 'LOGIN' ,p_step_title => 'Login' ,p_step_sub_title_type => 'TEXT_WITH_SUBSTITUTIONS' ,p_first_item => 'AUTO_FIRST_ITEM' ,p_include_apex_css_js_yn => 'Y' ,p_autocomplete_on_off => 'OFF' ,p_step_template => 1911602557247902 + wwv_flow_api.g_id_offset ,p_page_is_public_y_n => 'Y' ,p_cache_page_yn => 'N' ,p_last_upd_yyyymmddhh24miss => '20120606162931' );null; end;/

declare s varchar2(32767) := null; l_clob clob; l_length number := 1;begins := null;wwv_flow_api.create_page_plug ( p_id=> 1922223885247934 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_page_id=> 101, p_plug_name=> 'Login', p_region_name=>'', p_escape_on_http_output=>'N', p_plug_template=> 1915032456247912+ wwv_flow_api.g_id_offset, p_plug_display_sequence=> 10, p_plug_display_column=> 1, p_plug_display_point=> 'AFTER_SHOW_ITEMS', p_plug_source=> s, p_plug_source_type=> 'STATIC_TEXT', p_plug_query_row_template=> 1, p_plug_query_headings_type=> 'COLON_DELMITED_LIST', p_plug_query_row_count_max => 500, p_plug_display_condition_type => '', p_plug_caching=> 'NOT_CACHED', p_plug_comment=> '');end;/ begin null; end;/

begin null; end;/

declare h varchar2(32767) := null;beginwwv_flow_api.create_page_item( p_id=>1922330433247936 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_flow_step_id=> 101, p_name=>'P101_USERNAME', p_data_type=> '', p_is_required=> false, p_accept_processing=> 'REPLACE_EXISTING', p_item_sequence=> 10, p_item_plug_id => 1922223885247934+wwv_flow_api.g_id_offset, p_use_cache_before_default=> '', p_prompt=>'Username', p_display_as=> 'NATIVE_TEXT_FIELD', p_lov_display_null=> 'NO', p_lov_translated=> 'N', p_cSize=> 40, p_cMaxlength=> 100, p_cHeight=> null, p_begin_on_new_line=> 'YES', p_begin_on_new_field=> 'YES', p_colspan=> 2, p_rowspan=> 1, p_label_alignment=> 'RIGHT', p_field_alignment=> 'LEFT', p_field_template=> 1920401041247919+wwv_flow_api.g_id_offset, p_is_persistent=> 'Y', p_attribute_01 => 'N', p_attribute_02 => 'N', p_attribute_03 => 'N', p_item_comment => ''); end;/

declare h varchar2(32767) := null;beginwwv_flow_api.create_page_item( p_id=>1922426816247936 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_flow_step_id=> 101, p_name=>'P101_PASSWORD', p_data_type=> '', p_is_required=> false, p_accept_processing=> 'REPLACE_EXISTING', p_item_sequence=> 20, p_item_plug_id => 1922223885247934+wwv_flow_api.g_id_offset, p_use_cache_before_default=> '', p_prompt=>'Password', p_display_as=> 'NATIVE_PASSWORD', p_lov_display_null=> 'NO', p_lov_translated=> 'N', p_cSize=> 40, p_cMaxlength=> 100, p_cHeight=> null, p_begin_on_new_line=> 'YES', p_begin_on_new_field=> 'YES', p_colspan=> 1, p_rowspan=> 1, p_label_alignment=> 'RIGHT', p_field_alignment=> 'LEFT', p_field_template=> 1920401041247919+wwv_flow_api.g_id_offset, p_is_persistent=> 'Y', p_attribute_01 => 'Y', p_attribute_02 => 'Y', p_item_comment => ''); end;/

declare h varchar2(32767) := null;beginwwv_flow_api.create_page_item( p_id=>1922520298247936 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_flow_step_id=> 101, p_name=>'P101_LOGIN', p_data_type=> '', p_is_required=> false, p_accept_processing=> 'REPLACE_EXISTING', p_item_sequence=> 30, p_item_plug_id => 1922223885247934+wwv_flow_api.g_id_offset, p_use_cache_before_default=> '', p_item_default=> 'Login', p_prompt=>'Login', p_source=>'LOGIN', p_source_type=> 'STATIC', p_display_as=> 'BUTTON', p_lov_display_null=> 'NO', p_lov_translated=> 'N', p_cSize=> null, p_cMaxlength=> null, p_cHeight=> null, p_tag_attributes => 'template:'||to_char(1913323201247909 + wwv_flow_api.g_id_offset), p_begin_on_new_line=> 'NO', p_begin_on_new_field=> 'YES', p_colspan=> 1, p_rowspan=> 1, p_label_alignment=> 'LEFT', p_field_alignment=> 'LEFT', p_is_persistent=> 'Y', p_button_action => 'SUBMIT', p_button_is_hot=>'N', p_item_comment => ''); end;/

begin declare p varchar2(32767) := null; l_clob clob; l_length number := 1;beginp:=p||'apex_authentication.send_login_username_cookie ('||unistr('\000a')||' p_username => lower(:P101_USERNAME) );';

wwv_flow_api.create_page_process( p_id => 1922706324247937 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_flow_step_id => 101, p_process_sequence=> 10, p_process_point=> 'AFTER_SUBMIT', p_process_type=> 'PLSQL', p_process_name=> 'Set Username Cookie', p_process_sql_clob => p, p_process_error_message=> '', p_error_display_location=> 'INLINE_IN_NOTIFICATION', p_process_success_message=> '', p_process_is_stateful_y_n=>'N', p_process_comment=>'');end;null; end;/

begin declare p varchar2(32767) := null; l_clob clob; l_length number := 1;beginp:=p||'apex_authentication.login('||unistr('\000a')||' p_username => :P101_USERNAME,'||unistr('\000a')||' p_password => :P101_PASSWORD );';

wwv_flow_api.create_page_process( p_id => 1922623600247937 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_flow_step_id => 101, p_process_sequence=> 20, p_process_point=> 'AFTER_SUBMIT', p_process_type=> 'PLSQL', p_process_name=> 'Login', p_process_sql_clob => p, p_process_error_message=> '', p_error_display_location=> 'INLINE_IN_NOTIFICATION', p_process_success_message=> '', p_process_is_stateful_y_n=>'N', p_process_comment=>'');end;null; end;/

begin declare p varchar2(32767) := null; l_clob clob; l_length number := 1;beginp:=p||'101';

wwv_flow_api.create_page_process( p_id => 1922913619247937 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_flow_step_id => 101, p_process_sequence=> 30, p_process_point=> 'AFTER_SUBMIT', p_process_type=> 'CLEAR_CACHE_FOR_PAGES', p_process_name=> 'Clear Page(s) Cache', p_process_sql_clob => p, p_process_error_message=> '', p_error_display_location=> 'INLINE_IN_NOTIFICATION', p_process_success_message=> '', p_process_is_stateful_y_n=>'N', p_process_comment=>'');end;null; end;/

begin declare p varchar2(32767) := null; l_clob clob; l_length number := 1;beginp:=p||':P101_USERNAME := apex_authentication.get_login_username_cookie;';

wwv_flow_api.create_page_process( p_id => 1922823450247937 + wwv_flow_api.g_id_offset, p_flow_id=> wwv_flow.g_flow_id, p_flow_step_id => 101, p_process_sequence=> 10, p_process_point=> 'BEFORE_HEADER', p_process_type=> 'PLSQL', p_process_name=> 'Get Username Cookie', p_process_sql_clob => p, p_process_error_message=> '', p_error_display_location=> 'ON_ERROR_PAGE', p_process_success_message=> '', p_process_is_stateful_y_n=>'N', p_process_comment=>'');end;null; end;/

Page 40: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

tel het offset-nummer bij de object ID’s op tijdens import

apex_application_install.generate_offsetapex_application_install.set_offset

Page 41: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

haal het offset-nummer eraf tijdens export

sed -E 's/([0-9]+)([ ]*\+[ ]*wwv_flow_api.g_id_offset)/^\1^\2/'<f$2.sql | awk -F^ '{if(length($3)>0) {print $1 $2-ENVIRON["offset"] $3} else

{print $0}}' >f$2.sql

Page 42: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> select code 2 , naam 3 , apex_applicatie_id_van id_van 4 , apex_applicatie_id_tm id_tm 5 , apex_id_offset 6 from meta.mta_ontwikkelaars 7 /CODE NAAM ID_VAN ID_TM APEX_ID_OFFSET---------- ------------------- ------------ ------------ --------------RWIJK Rob van Wijk 10000 10999 10000000000MPLAS Marcel van der Plas 11000 11999 20000000000MHOEFS Marcel Hoefs 12000 12999 30000000000EASLAN Erdal Aslan 13000 13999 40000000000ASUVEREIN Arne Suverein 14000 14999 50000000000EHAMERS Etienne Hamers 15000 15999 60000000000LSAVALKA Larysa Savalka 16000 16999 700000000007 rijen geselecteerd.

Page 43: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

select to_number

( to_char(wwv_seq.nextval) ||

lpad( substr( abs(wwv_flow_random.rand), 1, 5 ),5, '0' ) ||

ltrim(to_char(mod(abs(hsecs),1000000),'000000'))

)

into g_curr_val

from sys.v_$timer;

Source:: http://joelkallman.blogspot.nl/2010/07/apexapplicationinstall.html

Page 44: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> desc meta.mta_admin...FUNCTION APEX_ID_OFFSET RETURNS NUMBER(20) Argument Name Type

In/Out Default? ------------------------------ ----------------------- ------ -------- P_SCHEMAPREFIX VARCHAR2 IN

...

Page 45: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

3. Applicatieopbouw in één stap

Page 46: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Doelstelling

Vaak en op afroep kunnen installeren met een drastisch verkleinde kans op

installatiefouten

Page 47: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

install.sqluninstall.s

ql

reinstall.sql

install_apex.sql

install_db.sql uninstall_db.sql

uninstall_apex.sql

reinstall_apex.sql

reinstall_db.sql

install_files.sh uninstall_files.sh

reinstall_files.sh

Page 48: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

remarkremark install_db.sqlremarkremark Marcel Hoefs 06 juni 2012remarkcolumn current_schema new_value curschemaselect sys_context('userenv','current_schema') current_schema from dual/define SCHEMAPREFIX='&1'define APPLICATIE='sca'prompt ***************************************************************************prompt Installeer db-gedeelte van &APPLICATIE in schema's &SCHEMAPREFIX._data, &SCHEMAPREFIX._api en &SCHEMAPREFIX._uiprompt ***************************************************************************

define tables_path='&APPLICATIE./non-apex/data/tables/'define sequences_path='&APPLICATIE./non-apex/data/sequences/'define indexes_path='&APPLICATIE./non-apex/data/indexes/'define data_path='&APPLICATIE./non-apex/data/data/'define privs_path='&APPLICATIE./non-apex/data/privileges/'define triggers_path='&APPLICATIE./non-apex/data/triggers/'define packages_path='&APPLICATIE./non-apex/api/packages/'define package_bodies_path='&APPLICATIE./non-apex/api/package_bodies/'define api_synonyms_path='&APPLICATIE./non-apex/api/synonyms/'define view_path='&APPLICATIE./non-apex/ui/views/'define ui_synonyms_path='&APPLICATIE./non-apex/ui/synonyms/'

set verify off

alter session set current_schema = &SCHEMAPREFIX._data/

@@&tables_path.SCA_KLANTEN.sql@@&tables_path.SCA_KLT_PK.sql@@&tables_path.SCA_KLANTEN_CONSTRAINT.sql

@@&tables_path.SCA_MEETINSTALLATIES.sql@@&tables_path.SCA_MIE_PK.sql@@&tables_path.SCA_MEETINSTALLATIES_CONSTRAINT.sql@@&tables_path.SCA_MEETINSTALLATIES_REFCONSTRAINT.sql

@@&tables_path.SCA_OPNAMES.sql@@&tables_path.SCA_ONE_PK.sql@@&tables_path.SCA_OPNAMES_CONSTRAINT.sql@@&tables_path.SCA_OPNAMES_REFCONSTRAINT.sql

@@&tables_path.SCA_METERSTANDEN.sql@@&tables_path.SCA_MSD_PK.sql@@&tables_path.SCA_METERSTANDEN_CONSTRAINT.sql@@&tables_path.SCA_METERSTANDEN_REFCONSTRAINT.sql

@@&sequences_path.SCA_KLT_SEQ1.sql@@&sequences_path.SCA_MIE_SEQ1.sql@@&sequences_path.SCA_MSD_SEQ1.sql@@&sequences_path.SCA_ONE_SEQ1.sql

@@&indexes_path.MIE_KLT_FK1_I.sql@@&indexes_path.MSD_MIE_FK_I.sql@@&indexes_path.MSD_ONE_FK1_I.sql@@&indexes_path.ONE_KLT_FK1_I.sql

@@&privs_path.privileges.sql &SCHEMAPREFIX

alter session set current_schema = &SCHEMAPREFIX._api/

remark Deze applicatie heeft geen API-laag.

alter session set current_schema = &SCHEMAPREFIX._ui/

@@&ui_synonyms_path.sca_klanten.syn &SCHEMAPREFIX@@&ui_synonyms_path.sca_meetinstallaties.syn &SCHEMAPREFIX@@&ui_synonyms_path.sca_meterstanden.syn &SCHEMAPREFIX@@&ui_synonyms_path.sca_opnames.syn &SCHEMAPREFIX@@&ui_synonyms_path.sca_klt_seq1.syn &SCHEMAPREFIX@@&ui_synonyms_path.sca_mie_seq1.syn &SCHEMAPREFIX@@&ui_synonyms_path.sca_msd_seq1.syn &SCHEMAPREFIX@@&ui_synonyms_path.sca_one_seq1.syn &SCHEMAPREFIX

alter session set current_schema = &CURSCHEMA/

set verify onundefine SCHEMAPREFIXundefine APPLICATIEundefine CURSCHEMA

Page 49: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

remarkremark uninstall_db.sqlremarkremark Marcel Hoefs 6 juni 2012remark

column current_schema new_value CURSCHEMAselect sys_context('userenv','current_schema') current_schema from dual/

set verify off

define SCHEMAPREFIX='&1'

prompt *************************************************************************************prompt De-installeer db-gedeelte van SCA uit schema's &SCHEMAPREFIX._data, &SCHEMAPREFIX._api en &SCHEMAPREFIX._uiprompt *************************************************************************************

alter session set current_schema = &SCHEMAPREFIX._data/

remarkremark Verwijder hier alle objecten uit de DATA-laagremarkdrop table sca_klanten cascade constraints purge/drop table sca_meetinstallaties cascade constraints purge/drop table sca_meterstanden cascade constraints purge/drop table sca_opnames cascade constraints purge/drop sequence sca_klt_seq1/drop sequence sca_mie_seq1/drop sequence sca_msd_seq1/drop sequence sca_one_seq1/

alter session set current_schema = &SCHEMAPREFIX._api/

remarkremark Verwijder hier alle objecten uit de API-laagremark

alter session set current_schema = &SCHEMAPREFIX._ui/

remarkremark Verwijder hier alle objecten uit de UI-laagremarkdrop synonym sca_klanten/drop synonym sca_meetinstallaties/drop synonym sca_meterstanden/drop synonym sca_opnames/drop synonym sca_klt_seq1/drop synonym sca_mie_seq1/drop synonym sca_msd_seq1/drop synonym sca_one_seq1/alter session set current_schema = &CURSCHEMA/

set verify onundefine SCHEMAPREFIXundefine CURSCHEMA

Page 50: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

remarkremark install_apex.sqlremarkremark Rob van Wijk, 6 juni 2012remark

define SCHEMAPREFIX='&1'define APPLICATIE='sca'

prompt ***************************************************************************prompt Installeer APEX-gedeelte van &APPLICATIE in de werkruimte horend bij schemaprefix &SCHEMAPREFIX.prompt ***************************************************************************

set verify off

column current_schema new_value curschemaselect sys_context('userenv','current_schema') current_schema from dual/

alter session set current_schema = &SCHEMAPREFIX._ui/

declare cn_schemaprefix constant varchar2(25) := '&SCHEMAPREFIX'; cn_applicatie constant varchar2(30) := '&APPLICATIE';begin apex_application_install.set_workspace_id(meta.mta_admin.apex_werkruimte_id(cn_schemaprefix)); apex_application_install.set_application_id(meta.mta_admin.apex_applicatie_id(cn_applicatie,cn_schemaprefix)); apex_application_install.set_offset(meta.mta_admin.apex_offset_id(cn_schemaprefix)); apex_application_install.set_schema(upper(cn_schemaprefix) || '_UI'); apex_application_install.set_application_alias ( case lower(cn_schemaprefix) when lower(cn_applicatie) then cn_applicatie else cn_applicatie || '_' || cn_schemaprefix end );end;/

@@install_apex_components

whenever sqlerror continue

alter session set current_schema = &CURSCHEMA/

undefine APPLICATIEundefine SCHEMAPREFIX

Page 51: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

remarkremark uninstall_apex.sqlremarkremark Rob van Wijk, 6 juni 2012remark

define SCHEMAPREFIX='&1'define APPLICATIE='sca'

prompt ***************************************************************************prompt De-installeer APEX-gedeelte van &APPLICATIE uit werkruimte horend bij schemaprefix &SCHEMAPREFIX.prompt ***************************************************************************

set verify off

column current_schema new_value curschemaselect sys_context('userenv','current_schema') current_schema from dual/

alter session set current_schema = &SCHEMAPREFIX._UI/

remarkremark Dit script wordt gebruikt om zowel het applicatieschema als een gebruikersschema te verwijderen.remark Gebruik package APEX_APPLICATION_INSTALL om precies aan te geven welke applicatie we gaan verwijderen.remark

declare cn_schemaprefix constant varchar2(25) := '&SCHEMAPREFIX'; cn_applicatie constant varchar2(10) := '&APPLICATIE';begin apex_application_install.set_workspace_id(meta.mta_admin.apex_werkruimte_id(cn_schemaprefix)); apex_application_install.set_application_id(meta.mta_admin.apex_applicatie_id(cn_applicatie,cn_schemaprefix));end;/

remarkremark Gebruik de bestaande scripts uit de APEX Export Splitter om de applicatie uit APEX te verwijderenremark

@sca/apex/application/init.sql@sca/apex/application/set_environment.sql@sca/apex/application/delete_application.sql@sca/apex/application/end_environment.sql

whenever sqlerror continue

remarkremark Zet het huidige schema terug naar de oorspronkelijke waarderemark

alter session set current_schema = &CURSCHEMA/

set verify onundefine schemaprefixundefine applicatie

Page 52: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

install_files.sh

met ssh folders in de docroot van applicatieserver

met scp de bestanden kopieren/i/ blijft intact

folders per ontwikkelaar/applicatiekopie met daarin css, afbeeldingen en javascript libraries

less-bestanden hoeven niet te worden overgezet

Page 53: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

4. Continu integreren

Page 54: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Doelstelling

verzekeren dat een fout in de applicatie(opbouw) zo snel mogelijk

opgemerkt wordt

Page 55: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

“Extensible continuous integration server”

Page 56: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

svn repository

svn update rein

stall.s

ql

Applicatieschema’sApplicatieschema’s

RWIJK RWIJK ontwikkelschema’sontwikkelschema’s

MPLAS MPLAS ontwikkelschema’sontwikkelschema’s

LSAVALKA LSAVALKA ontwikkelschema’sontwikkelschema’s

. .

.

reinstall_a

pex.s

ql

reinstall_db.sql

reinstall_apex.sql

reinstall_db.s

ql

reinstall_d

b.s

ql

reinstall_apex.s

ql

Page 57: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.
Page 58: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.
Page 59: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Started by timerUpdating http://cbrlaot001.gen.cms.local/svn/repos/trunk/sca revision: Nov 25, 2012 2:01:15 AM depth:infinity ignoreExternals: falseAt revision 95no change for http://cbrlaot001.gen.cms.local/svn/repos/trunk/sca since the previous build[workspace] $ /bin/sh -xe /tmp/hudson5181239197586695389.sh+ ORAENV_ASK=NO+ ORACLE_SID=APEXSOFAO+ . oraenv++ SILENT=++ case ${ORACLE_TRACE:-""} in++ N=++ C=++ echo '\c'++ grep c++ N=-n++ '[' 0 = 0 ']'++ OLDHOME=/usr/kerberos/bin:/opt/sw/java/jdk1.6.0_30/bin:/usr/local/bin:/bin:/usr/bin:/opt/sw/firefox:/home/gladmin/bin++ case ${ORAENV_ASK:-""} in++ NEWSID=APEXSOFAO++ export ORACLE_SID+++ dbhome APEXSOFAO++ ORAHOME=/opt/sw/oradmin/product/11.2.0.3/dbhome_1++ case $? in++ ORACLE_HOME=/opt/sw/oradmin/product/11.2.0.3/dbhome_1++ export ORACLE_HOME++ case ${LD_LIBRARY_PATH:-""} in++ LD_LIBRARY_PATH=/opt/sw/oradmin/product/11.2.0.3/dbhome_1/lib:/opt/sw/java/jdk1.6.0_30/jre/lib/amd64/server:/opt/sw/java/jdk1.6.0_30/jre/lib/amd64:/opt/sw/java/jdk1.6.0_30/jre/../lib/amd64++ export LD_LIBRARY_PATH++ case "$OLDHOME" in++ case "$PATH" in++ PATH=/usr/kerberos/bin:/opt/sw/java/jdk1.6.0_30/bin:/usr/local/bin:/bin:/usr/bin:/opt/sw/firefox:/home/gladmin/bin:/opt/sw/oradmin/product/11.2.0.3/dbhome_1/bin++ export PATH+++ LANG=C+++ ulimit++ ULIMIT=unlimited++ '[' 0 = 0 -a unlimited '!=' unlimited ']'++ ORABASE_EXEC=/opt/sw/oradmin/product/11.2.0.3/dbhome_1/bin/orabase++ '[' x '!=' x ']'++ OLD_ORACLE_BASE=++ '[' -w /opt/sw/oradmin/product/11.2.0.3/dbhome_1/inventory/ContentsXML/oraclehomeproperties.xml ']'++ '[' '' '!=' true ']'++ echo 'ORACLE_BASE environment variable is not being set since this'ORACLE_BASE environment variable is not being set since this++ echo 'information is not available for the current user ID gladmin.'information is not available for the current user ID gladmin.++ echo 'You can set ORACLE_BASE manually if it is required.'You can set ORACLE_BASE manually if it is required.+ unset ORAENV_ASK+ cd /opt/sw/hudson/jobs/hudson_sca/workspace+ pwd/opt/sw/hudson/jobs/hudson_sca/workspace+ sqlplus install/install @sca/non-apex/install/build sca

SQL*Plus: Release 11.2.0.3.0 Production on Sun Nov 25 02:01:20 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

BESTANDSNAAM----------------------------build_sca_20121125020120.sql

@sca/non-apex/install/reinstall sca@sca/non-apex/install/reinstall_db RWIJK@sca/non-apex/install/reinstall_apex RWIJK@sca/non-apex/install/reinstall_db MHOEFS@sca/non-apex/install/reinstall_apex MHOEFS@sca/non-apex/install/reinstall_db EASLAN@sca/non-apex/install/reinstall_apex EASLAN@sca/non-apex/install/reinstall_db ASUVEREIN@sca/non-apex/install/reinstall_apex ASUVEREIN@sca/non-apex/install/reinstall_db EHAMERS@sca/non-apex/install/reinstall_db LSAVALKA@sca/non-apex/install/reinstall_apex LSAVALKA***************************************************************************De-installeer APEX-gedeelte van sca uit werkruimte horend bij schemaprefix sca***************************************************************************

CURRENT_SCHEMA--------------------------------------------------------------------------------INSTALLAPPLICATION 12000 - SCASet Credentials...Check Compatibility...API Last Extended:20110212Your Current Version:20110212This import is compatible with version: 20110212COMPATIBLE (You should be able to run this import without issues.)Set Application ID......doneold 1: alter session set current_schema = &CURSCHEMAnew 1: alter session set current_schema = INSTALL

Session altered.

CURRENT_SCHEMA--------------------------------------------------------------------------------INSTALL

1 row selected.

*************************************************************************************De-installeer db-gedeelte van SCA uit schema's sca_data, sca_api en sca_ui*************************************************************************************

Session altered.

Table dropped.

Table dropped.

Table dropped.

Table dropped.

Sequence dropped.

Sequence dropped.

Sequence dropped.

Sequence dropped.

Session altered.

Session altered.

Synonym dropped.

Synonym dropped.

Synonym dropped.

Synonym dropped.

Synonym dropped.

Synonym dropped.

Synonym dropped.

Synonym dropped.

Session altered.

CURRENT_SCHEMA--------------------------------------------------------------------------------INSTALL

1 row selected.

***************************************************************************Installeer db-gedeelte van sca in schema's sca_data, sca_api en sca_ui***************************************************************************

Session altered.

Table created.

Index created.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table created.

Index created.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table created.

Index created.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table created.

Index created.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Table altered.

Sequence created.

Sequence created.

Sequence created.

Sequence created.

Index created.

Index created.

Index created.

Index created.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Session altered.

Session altered.

Synonym created.

Synonym created.

Synonym created.

Synonym created.

Synonym created.

Synonym created.

Synonym created.

Synonym created.

Session altered.

***************************************************************************Installeer APEX-gedeelte van sca in de werkruimte horend bij schemaprefix sca***************************************************************************

CURRENT_SCHEMA--------------------------------------------------------------------------------INSTALL

1 row selected.

Session altered.

PL/SQL procedure successfully completed.

APPLICATION 12000 - SCASet Credentials...Check Compatibility...API Last Extended:20110212Your Current Version:20110212This import is compatible with version: 20110212COMPATIBLE (You should be able to run this import without issues.)Set Application ID......authorization schemes...navigation bar entries...application processes...application items...application level computations...Application Tabs...Application Parent Tabs...Shared Lists of values...Application Trees...page groups...PAGE 1: Page 1...PAGE 4: Klanten beheer...PAGE 5: Meetinstallaties...PAGE 8: meetinstallaties bewerken...PAGE 12: klantlogin...PAGE 13: Registratienummers...PAGE 14: meterstanden...PAGE 15: Meterstanden registreren...PAGE 101: Login...lists...breadcrumbs...page templates for application: 12000......Page template 11794167803107605......Page template 11794290137107606......Page template 11794377555107606......Page template 11794497419107606......Page template 11794566298107606......Page template 11794675957107606......Page template 11794776904107607......Page template 11794894636107609......Page template 11794975350107610......Page template 11795077383107610......Page template 11795173951107611......Page template 11795283289107612......Page template 11795371712107612......Page template 11795490978107612......Page template 11795585730107612......Page template 11795696957107612......Page template 11795770245107612...button templates......Button Template 11795888447107612......Button Template 11795992602107613......Button Template 11796085633107613......Button Template 11796191818107613......Button Template 11796286854107613......Button Template 11796367372107613......Button Template 11796468287107614...region templates......region template 11796583399107614......region template 11796677084107615......region template 11796793305107615......region template 11796881706107615......region template 11796984225107615......region template 11797083949107615......region template 11797186677107615......region template 11797276155107615......region template 11797396363107615......region template 11797490683107615......region template 11797597702107615......region template 11797688606107615......region template 11797784607107615......region template 11797868456107615......region template 11797982880107615......region template 11798090397107615......region template 11798188312107615......region template 11798273024107616......region template 11798389824107616......region template 11798469454107616......region template 11798583698107616......region template 11798692106107616......region template 11798775302107616......region template 11798871609107616......region template 11798970725107616......region template 11799097104107616......region template 11799168183107616......region template 11799273036107616......region template 11799388606107616......region template 11799481068107616......region template 11799594611107616......region template 11799696450107616......region template 11799777023107616......region template 11799877782107616...List Templates......list template 11799985587107616......list template 11800082640107617......list template 11800173530107617......list template 11800274923107617......list template 11800369030107618......list template 11800493842107618......list template 11800574377107618......list template 11800678336107618......list template 11800780044107618......list template 11800865590107619......list template 11800982032107619......list template 11801076519107619......list template 11801191475107619......list template 11801276776107619......list template 11801392597107619......list template 11801496832107619......list template 11801586609107619...report templates......report template 11801692413107619......report template 11801787647107620......report template 11801869764107620......report template 11801984578107620......report template 11802083299107620......report template 11802178606107621......report template 11802285966107621......report template 11802376484107621......report template 11802466888107621......report template 11802571578107621......report template 11802674282107621...label templates......label template 11802776016107621......label template 11802888841107622......label template 11802966287107622......label template 11803075299107622......label template 11803178746107623......label template 11803282782107623...breadcrumb templates......template 11803388104107623......template 11803473095107623...popup list of values templates......template 11804188325107625...calendar templates......template 11803568331107623......template 11803771915107624......template 11803993181107624...application themes......theme 11804275466107625...build options used by application 12000...Language Maps for Application 12000...messages used by application: 12000...dynamic translations used by application: 12000...Shortcuts...web services (9iR2 or better)...shared queries...report layouts...authentication schemes......authentication 11804472930107630...plugins...load tables...doneold 1: alter session set current_schema = &CURSCHEMAnew 1: alter session set current_schema = INSTALL

Session altered.

CURRENT_SCHEMA--------------------------------------------------------------------------------INSTALL

1 row selected.

Page 60: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Ontwikkelaars hebben optie om een verse ontwikkelomgeving te krijgen vanuit Hudson

iedere ochtend

Page 61: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META-schema

SQL> select owr_code 2 , ape_code 3 , apex_applicatie_id 4 , ind_db_dagelijks_verversen 5 , ind_apex_dagelijks_verversen 6 from meta.mta_applicatiekopieen 7 /OWR_CODE APE_CODE APEX_APPLICATIE_ID I I---------- ---------- ------------------ - -RWIJK CV 10000 J NRWIJK SCA 10001 J JMPLAS CV 11000 J NMPLAS SCA 11001 N NMHOEFS CV 12001 J JMHOEFS SCA 12000 J JEASLAN SCA 13000 J JEASLAN CV 13001 J JASUVEREIN SCA 14000 J JEHAMERS SCA 15000 J NLSAVALKA SCA 16000 J J

LSAVALKA CV 16001 J J

Page 62: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

META schema

SQL> desc meta.mta_admin...PROCEDURE ZET_IND_DAGELIJKS_APEX_VERVERS Argument Name Type

In/Out Default? ------------------------------ ----------------------- ------ -------- P_OWR_CODE VARCHAR2(10) IN P_APE_CODE VARCHAR2(10) IN P_IND_DAGELIJKS_APEX_VERVERSEN VARCHAR2(1) INPROCEDURE ZET_IND_DAGELIJKS_DB_VERVERSEN Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- P_OWR_CODE VARCHAR2(10) IN P_APE_CODE VARCHAR2(10) IN P_IND_DAGELIJKS_DB_VERVERSEN VARCHAR2(1) IN

...

Page 63: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Automatisch componenttesten

zowel in database (UtUtil) als in browser (Selenium)

Opleveren van delta’s / patches

Sjabloonapplicatie

Wat gaan we nog meer doen?

Page 64: Professioneel Software Ontwikkelen met Oracle Application Express Rob van Wijk APEX World, Figi Zeist, 9 april 2013.

Bedankt voor jullie aandacht!

@rwijk [email protected]

@rwijk