Skip navigation links

Package com.orchestranetworks.addon.igov.services

Provides APIs to execute the {addon.label} services.

See: Description

Package com.orchestranetworks.addon.igov.services Description

Provides APIs to execute the {addon.label} services.

Initializes the ServiceSpec to create a service spec.

        ServiceSpec serviceSpec = new ServiceSpec(
                IGovConstants.IGOV_HOMEKEY,
                PrimaryKey.parseString("1"),
                session);

Uses IGovServiceFactory to get the service and calls the execute method.

To run the Create Administered Items service:

        AdministeredItemResult result = (AdministeredItemResult) IGovServiceFactory.getService(ServiceType.CREATE_ADMINISTERED_ITEMS).execute(serviceSpec);

To run the Refresh Administered Items service:

        AdministeredItemResult result = (AdministeredItemResult) IGovServiceFactory.getService(ServiceType.REFRESH_ADMINISTERED_ITEM).execute(serviceSpec);

To run the Validate Administered Items service:

        AdministeredItemResult result = (AdministeredItemResult) IGovServiceFactory.getService(ServiceType.VALIDATE_ADMINISTERED_ITEM).execute(serviceSpec);

To run the Delete Administered Items service:

        AdministeredItemResult result = (AdministeredItemResult) IGovServiceFactory.getService(ServiceType.DELETE_ADMINISTERED_ITEM).execute(serviceSpec);

The execution result can be retrieved in AdministeredItemResult.


To run the Export Excel service:

Either calls the ExcelExportSpecFactory.getFullSpec method to create a spec to export the Administered Items in the Full mode.

        List<Locale> languages = new ArrayList<Locale>();
        languages.add(Locale.US);
        
        List<PrimaryKey> contexts = new ArrayList<PrimaryKey>();
        contexts.add(IGovConstants.DEFAULT_CONTEXT);
        
        ExcelExportSpec exportSpec = ExcelExportSpecFactory.getFullSpec(
                IGovConstants.IGOV_HOMEKEY,
                PrimaryKey.parseString("1"),
                languages,
                contexts,
                Locale.US,
                IGovConstants.DEFAULT_CONTEXT,
                ExportOutput.EXCEL_2007,
                session);

Or calls the ExcelExportSpecFactory.getLightSpec to export in the Light mode.

        ExcelExportSpec exportSpec = ExcelExportSpecFactory.getLightSpec(
                IGovConstants.IGOV_HOMEKEY,
                PrimaryKey.parseString("1"),
                Locale.US,
                IGovConstants.DEFAULT_CONTEXT,
                true,
                ExportOutput.EXCEL_2007,
                session);

Uses IGovServiceFactory to get the service and calls the execute method.

        ExportResult result = (ExportResult) IGovServiceFactory.getService(ServiceType.EXPORT_EXCEL).execute(exportSpec);

The execution result can be retrieved in ExportResult.


To run the Export PDF service:

Initializes the PDFExportSpec to create a spec to export the Administered Items to PDF.

        PDFExportSpec exportSpec = new PDFExportSpec(
                IGovConstants.IGOV_HOMEKEY,
                PrimaryKey.parseString("1"),
                Locale.US,
                PrimaryKey.parseString("MyContext"), //The default context cannot be chosen here.
                true,
                session);

Uses IGovServiceFactory to get the service and calls the execute method.

        ExportResult result = (ExportResult) IGovServiceFactory.getService(ServiceType.EXPORT_PDF).execute(exportSpec);

The execution result can be retrieved in ExportResult.


To run the Import Excel service:

Initializes the ExcelImportSpec to create an import spec.

        ExcelImportSpec importSpec = new ExcelImportSpec(
                IGovConstants.IGOV_HOMEKEY,
                PrimaryKey.parseString("1"),
                new File("c:\import_data.xls"),
                false,
                session);

Uses IGovServiceFactory to get the service and calls the execute method.

        ExcelImportResult result = (ExcelImportResult) IGovServiceFactory.getService(ServiceType.IMPORT_EXCEL).execute(importSpec);

The execution result can be retrieved in ExcelImportResult.

To get the list of rows that were not imported:

        List<ExcelImportDataError> errors = result.getErrors();
        for(ExcelImportDataError error : errors)
        {
                //This row is an Item (In the Item sheet)
                if (error.getErrorType().isItem())
                {
                        
                }
                
                //This row is a Rule (In the Rule sheet)
                if (error.getErrorType().isRule())
                {
                        
                }
                                        
                //The row number in the Excel file
                error.getRowNumber();
        }

To manually create an Administered Item:

Initializes the MetadataCreationSpec to create a creation spec. Several parameters are needed to create different metadata types.

        MetadataCreationSpec creationSpec = new MetadataCreationSpec(
                IGovConstants.IGOV_HOMEKEY,
                PrimaryKey.parseString("1"),
                session,
                ISOType.PROPERTY,
                EBXType.FIELD,
                "Available",
                new ArrayList<ContextDefinitionBean>(),
                false);

Uses IGovServiceFactory to get metadata creation service and calls the execute method.

        MetadataCreationResult result = (MetadataCreationResult) IGovServiceFactory.getService(ServiceType.METADATA_CREATION)
                .execute(creationSpec);

The execution result can be retrieved in MetadataCreationResult. If the execution is successful, the created PrimaryKey will be returned.

Skip navigation links

Add-ons Version 4.5.22.

Copyright 2001-2025. Cloud Software Group, Inc. All rights reserved.
All third party product and company names and third party marks mentioned in this document are the property of their respective owners and are mentioned for identification.