This chapter provides use cases for the Custom Access Settings API and describes how to retrieve the list of custom access settings types and retrieve the list of default custom access settings of a particular type in the Oracle Enterprise Repository.
This chapter includes the following sections:
The Custom Access Settings subsystem is used to provide a web services-based mechanism to retrieve Oracle Enterprise Repository Custom Access Settings (CAS). Example 19-1 describes a sample Custom Access Settings code.
Example 19-1 Example of Custom Access Settings Code
Working code for Custom Access Settings Open API methods.
package com.flashline.sample.customaccesssettingsapi; import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; import javax.xml.rpc.ServiceException; import com.flashline.registry.openapi.base.OpenAPIException; import com.flashline.registry.openapi.entity.AuthToken; import com.flashline.registry.openapi.service.v300.FlashlineRegistry; import com.flashline.registry.openapi.service.v300.FlashlineRegistryServiceLocator; public class CustomAccesssettings { public static void main(String pArgs[]) throws java.rmi.RemoteException, OpenAPIException { try { /////////////////////////////////////////////////////////// // Connect to Oracle Enterprise Repository /////////////////////////////////////////////////////////// URL lURL = null; lURL = new URL(pArgs[0]); FlashlineRegistry repository = new FlashlineRegistryServiceLocator() .getFlashlineRegistry(lURL); // ////////////////////////////// // Authenticate with OER // ////////////////////////////// AuthToken authToken = repository.authTokenCreate( pArgs[1],pArgs[2]); // //////////////////////////////////////////////////////////// // Retrieve a List of Custom Access Setting Types // //////////////////////////////////////////////////////////// String[] lRoleContextTypes = null; lRoleContextTypes = repository .customAccessSettingTypesGet(authToken); // //////////////////////////////////////////////////////////// // Get Custom Access Setting Names // //////////////////////////////////////////////////////////// String[] lCustomAccessSettingNames = null; lCustomAccessSettingNames = repository .customAccessSettingNamesGet(authToken, "asset"); // //////////////////////////////////////////////////////////// // Retrieve an array of Custom Access Setting Names of type "asset". // //////////////////////////////////////////////////////////// String[] rCustomAccessSettingNames = null; rCustomAccessSettingNames = repository .customAccessSettingDefaultNamesGet(authToken, "asset"); } catch (OpenAPIException lEx) { System.out.println("ServerCode = " + lEx.getServerErrorCode()); System.out.println("Message = " + lEx.getMessage()); System.out.println("StackTrace:"); lEx.printStackTrace(); } catch (RemoteException lEx) { lEx.printStackTrace(); } catch (ServiceException lEx) { lEx.printStackTrace(); } catch (MalformedURLException lEx) { lEx.printStackTrace(); } } }
This section describes the use cases using the Custom Access Settings API. It includes the following topics:
Section 19.2.1, "Use Case: Retrieve a List of Custom Access Setting Types"
Section 19.2.2, "Use Case: Get Default Custom Access Setting Names"
This method is used to retrieve the list of Custom Access Settings Types as available in Oracle Enterprise Repository.
1. String[] lCustomAccessSettingNames = null; 2. lCustomAccessSettingNames = mFlashlineRegistry.customAccessSettingNamesGet (mAuthToken, "asset");
Line 2 - Retrieve an array of Custom Access Setting Names of type "asset".
This method is used to retrieve the list of Default Custom Access Settings of a particular type. An asset default Custom Access Setting is applied to all new assets, just as a file default Custom Access setting is applied to all new files, and so on.
1. String[] lCustomAccessSettingNames = null; 2. lCustomAccessSettingNames = mFlashlineRegistry.customAccessSettingDefault NamesGet(mAuthToken, "asset");
Line 2 - Retrieve an array of default Custom Access Setting Names of type "asset".