<%-- Setup whatever storage is required by the user. Date: Aug 5, 2010 Time: 10:09:53 AM --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page import="org.cilogon.config.models.*" %> <%@ page import="org.cilogon.portal.config.PortalVocabulary" %> <%@ page import="org.cilogon.portal.config.models.PortalTransactionTableModel" %> <%@ page import="org.cilogon.portal.servlets.ConfigConstants" %> <%@ page import="org.cilogon.storage.impl.postgres.PostgresAdminConnectionParameters" %> <%@ page import="static org.cilogon.config.CLITools.prompt" %> <%@ page import="org.cilogon.storage.impl.postgres.PostgresConnectionParameters" %> <%@ page import="org.cilogon.util.AbstractIdentifierFactory" %> <%@ page import="java.util.Iterator" %> <% boolean createPGStore = true; StoreModel sm = root.getStore(); if (sm != null) { if (!sm.isA(POSTGRES_STORE_TYPE)) { root.removeStore(sm); createPGStore = true; } else { postgresStoreModel = (PostgresStoreModel) portalConfiguration.getMyThingSession().fetchThing(root.getStore().getSubject(), PostgresStoreModel.class); createPGStore = false; } } if (createPGStore) { postgresStoreModel = portalConfiguration.createPostgresStore(); root.setStore(postgresStoreModel); } Iterator it = postgresStoreModel.getDatabases().iterator(); if (it.hasNext()) { currentDatabase = it.next(); tt = (PortalTransactionTableModel) currentDatabase.fetchThingByPredicate(currentDatabase.getTransactionTable().getSubject(), PortalTransactionTableModel.class); } else { currentDatabase = portalConfiguration.createDatabase(); postgresStoreModel.addDatabase(currentDatabase); tt = (PortalTransactionTableModel) portalConfiguration.getMyThingSession().fetchThing(AbstractIdentifierFactory.uriRef(), PortalTransactionTableModel.class); tt.setPrefix("portal"); tt.setName("transactions"); currentDatabase.setTransactionTable(tt); } String dbName = currentDatabase.getName(); String dbSchema = currentDatabase.getSchema(); String ttName = tt.getName(); String ttPrefix = tt.getPrefix(); %> Setup

CILogon Delegation Store Configuration

Specify the name, schema and table name.

Before creating the table, you must have created the database and users. The portal configuration allows for a separate administrator for the database who is different from the regular user. You may set these equal if your system is configured differently.

The table prefix is optional and will be used if specified. E.g. if it is 'x' and the table name is 'transactions' then the system will create and use the table named 'x_transactions'. This is very useful in cases where multiple portals live on the same system.

Database name: />
Database schema: />
Table name: />
Table prefix (opt.): />
<% PostgresConnectionParameters pcp = new PostgresConnectionParameters(); if (postgresStoreModel.hasA(HAS_CONNECTION)) { postgresStoreModel.getConnectionParametersModel().toConnectionParameters(pcp); } else { ConnectionParametersModel cpm = portalConfiguration.createConnectionParameters(); postgresStoreModel.setConnectionParameters(cpm); cpm.toConnectionParameters(pcp); } %>

Connection setup

This will set up access for the user who will run the application.

Username: />
Password: />
Hostname />
Port: />
JDBC driver: />
<% PostgresAdminConnectionParameters pacp = new PostgresAdminConnectionParameters(); if (postgresStoreModel.hasA(HAS_ADMIN_CONNECTION)) { postgresStoreModel.getAdminConnectionParametersModel().toAdminConnectionParameters(pacp); } else { AdminConnectionParametersModel acpm = portalConfiguration.createAdminConnectionParameters(); postgresStoreModel.setAdminConnectionParameters(acpm); acpm.toAdminConnectionParameters(pacp); } saveConfig(application, portalConfiguration); %>

Database user setup

This will set up access for the database administrator.

Admin username: />
Admin password: />
Admin hostname: />
Admin port: />
Admin JDBC driver: />
value="<%= ConfigConstants.POSTGRES_STORE_SETUP %>" />