Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Guia para criar aplicações simples em APEX/ Guide to create simple Apex applications (perte I)
Entrar em/ go to:
bd2:priv.di.fct.unl.pt:8090/apex
Depois de entrar verá / after entering you will see:
Depois clicar em “Aplication Builder” e terá / Then click on “Aplication Builder” and you will see
An application is a collection of pages linked together using tabs, buttons, or hypertext links. The pages in an application share a common session state definition and authentication method. Clicar em “Create” / Click on “Create”
Escolha Databse / choose Database
Escolha /choose “From Scratch” e/and “Next”
Next
Clicar Next / click Next
Depois indique o nome da aplicação VideoClube e clique em “Next” / write the application name VideoClube and click “Next”
Em seguida, na seguinte janela / then, in the follwing window:
Vamos criar uma página em “Blank” com nome de “Inicio” em Page name / we create a “Blank” page which name is “Inicio” in Page name.
Depois clicar em “Add Page” / then click “Add page”.
Agora vamos criar uma página apenas para ler as editoras que existem / now we are going to create a
page to list the publishers.
Então, na área “Add Page” especificar o seguinte / then in the area “Add Page” specify the following:
Select Page Type: Report
Subordinate to page: inicio
(isto estabelece a hierarquia entre páginas / this define de hierarchy among the pages)
Page source: Table
Table name: Editora
(escolher a partir da lista disponível do esquema / to choose from the list available from the schema)
Implementation: interactive
Clique / Click “Add page”
Verá então / you will see:
Agora, na area “Create application” clicar em “Next” e escolher “No Tabs” / Now in the area “Create application” click “Next” and choose “No tabs”
Em seguida clique “Next” / then click “Next”
Em “Shared components” escolher “No” e “Next” / In “Shared components” select “No” and “Next”
Em attributes aceitar os valores por defeito e clicar “Next”/ In attributes accept the default values and clique “Next” (isto permite que o Apex trate da autenticação / it enables Apex do deal with the
authentication)
Em User Interface escolher “Theme 2” e clicar “Next” / In User Interface choose “Theme 2” and click
“Next”
Em Confirm, verificar as escolhas feitas e clicar em “Create”.
Teremos / Ver-‐se-‐á:
Agora, para executar a aplicação clique em “Run Aplication” / to run the application click “Run Aplication”
Indique o user Apex e a password / write Apex user and password :
Se clicar no link Editora verá a editoras / click on link Editora to see all of them
Repare que pode clicar em inicio para ir ao menú principal. Pode pesquisar por um dos campos da tabela e pode obter os reultados ordenados.
Notice that you can click on inicio to go to the main menu. You can search through one of the campos in the table and you can get the sorted results.
Criação dum report sobre junção de tabelas / create a report on joins of tables
Clicar“Application nnn” e clicar em “Create Page” / Click “Appicationnnn “ and click “Create page”
Em Page seleciona-‐se “Report” e “Next” / In Page select “Report” and “Next”
Depois seleciona-‐se “Interactive Report” e “Next” / Then select “Interactive Report” and “Next”
Em page attributes seleciona-‐se / In Page attributes select:
Page number: (aceitar o valor /accept the value)
Page Name: Filme
Region template: Reports region
Region name: Filme
Breadcrumb: Breadcrumb (queremos que haja navegação entre páginas/ we want page navigation)
Entry name: Filme (será o nome do link na página de início para esta página report / it will be this page report-‐link in the inicio page)
Page entry: (selecionat “inicio” a partir da lista/select “Inicio” from the list)
Clicar / Click “Next”
Em Tabs escolher “No tabs” e “Next” / in Tabs select “No tabs” and “Next”
Em Sql query escrever / In Sql query write:
select nome_filme as nome,ano_filme as ano,preco_dia_filme as "preco dia",
dias_sem_multa_filme as "dias sem multa", multa_dia_filme as "multa dia",nome_genero as genero,
nome_editora as editora from filme natural inner join editora natural inner join genero
Em Link to single row view: No / In Link to single row view: No
Em report columns escrever “derived from query columns” / In report columns: “derived from query
columns”
“Next”
Em Report attributes selecionar /In Report attributes select:
Region template: Report Region
Report template: Template: 18, Standard
Region name: filme
Region column: 1
Maximum rows per page: 5
Next
Em confim/ in Confirm: Finish
Run page
Repare que os códigos da editora e do genero foram “substituídos” por designações identificáveis
/notice that the codes of editora and genero were “substituted” by theri respective names so it can be understood.
Adicionar link para filme, na página inicial / Add a link to filme in inicio page
Clicar no botão “Aplicationmnn” / Click on “Applicationnnn”
Clicar na página “Inicio” / click on page “Inicio”
Aparece a “Page definition” da página 1 / it appears “Page definition “ of page 1
Mudar para / Change to: “Component view”
Na area “Page rendering” e sub-‐área Regions clicar em List / In the area “Page rendering” sub-‐area Regions click on “List”
E aparecerá / and it will appear
Na página “List entries” clicar em “Create List Entry” / in “list entries” click in “Create List Entry”
Na página Create / Edit List Entry” editar / In the page Create / Edit List Entry” edit:
Sequence: 30 (para ficar abaixo do link editor / to be above the editora link)
List Entry Label: Filme
Page in this aplication
Target page: filme (quando se clicar no link, aparecerá a página filme)
Cricar em “Create” e correr (Run) a página / Click on “Create” and Run the page.
Criar uma página Form para inserir e modificar dados / Create a Form page to insert and modify data
Clicar em “Applicationnnn” da aplicação / Clicar em “Applicationn”
Clicar “Create Page” / click on “Create Page”
E selecione / and select:
“Form”
“Next”
“Form on a Table with Report” (esta opção cria duas páginas: uma report e outra Form baseados numa tabela ou view / this option create two pages: a Report and a Form based on a table or
view )
“Next”
Veremos então / then we will see:
Em Identify Table or view, aceite a “Table / view owner” que é indicado / In Identify table or view, accept the table/view owner : IBDnnnnn
“Next”
Table/view name: socio
Em “define Report page” editar / in “define Report Page” edit:
Implementation: interactive
Page name: Relatório de Socios
Region Title: Socio
Breadcrumbs: Breadcrumb
Parent key: Inicio (a selecionar / to be selected)
Next
Em tabs / in Tabs: “Do not use tabs”
“Next”
Em define report page, aceitar todas as colunas (selecioná-‐las) / In define report page, accept all
columns (they must be selected)
“Next”
Em “define form page”: In “define form page”:
Page name: criar /editar socio
Region Title: criar /editar socio
Entry name: criar /editar socio
Primary key: num_socio
Em define source for primary key column escolher “existing sequence”/ in define source for primary
key column, chose “existing sequence”
Em sequence: seq_socio (a selecionar) / In sequence: seq_socio (a selecionar)
“Next”
Seleccionar todas as colunas / elect all the columns
“Next”
Escolher “yes” para Insert, update e delete / select “Yes” for insert update and delete (isto é
necessário para se poder alterar os dados com inserção, alteraçºao e remoção de tuplos / this is necessary to insert, update and delete tuples)
“Next”
“Finish”
Agora corra a página (Run) / now Run the page
Veja o resultado do report e, para inserir um novo tuplo click em “create” / See the results from the report and click “Create” to create a new socio