This section is about contribution packaging, versioning and modularity
A contribution must be a folder with the following structure:
ROOT/ META-INF/ sca-contribution.xml sca-contribution.dll sca-contribution.conf bin/ some_dlls.dll any_folder_in_root/
The META-INF directory and all the sca-contribution.* files are required by the runtime. The default directory containing binaries is /bin folder in the contribution root directory. It is searched by default for binaries. To provide an alternative binary directory, developer should import the directory into the contribution using import.cpp tag in sca-contribution.xml. For more details see SCA specification section 7.1 (Executable files)
Note: In the upcomming releases, developer will be able to provide a contribution in ZIP format during installation.
For Trentino the version of a contribution is provided in the version attribute of the contribution. If no version is provided. The default value 0.0.0 is assumed. The version uses OSGI format : major.minor.micro.qualifier , where the qualifier part is optional.
<contribution xmlns:dividerNS="http://divider" version="1.0.0"> ... </contribution>
A contribution can use resources provided by another contributions. A resource is exported by a contribution using export.cpp tag. Then the exported resource is imported in another contribution using the import.cpp tag.
<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:logging="LoggingServiceNamespace" version="1.0.0"> <deployable composite="logging:LoggingServiceComposite"/> <export.cpp name="logging:metadata" path="services" /> <export.cpp name="logging:bin" path="bin" /> </contribution>
<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sample="BasicCalculatorNamespace" version="2.0.0"> <deployable composite="sample:BasicCalculatorComposite"/> <import.cpp name="loggingmetadata" location="logging:metadata" version="1.0.0" /> </contribution>
<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"> <service name="Calculator" > <interface.cpp class="Trentino::Example::BasicCalculator::Calculator" header="services/TrentinoExampleBasicCalculatorCalculator.h"/> </service> <reference name="LoggingService" multiplicity="1..1" autowire="false" target="LoggingServiceImpl/LoggingService"> <interface.cpp class="Trentino::Example::Logging::LoggingService" header="loggingmetadata:TrentinoExampleLoggingLoggingService.h"/> </reference> </componentType>
Since contribution calculator depends on the logging contribution, we needs to find dependencies during the validation process. For that purpose the user should provide the list of external contributions to Trengen.
Trengen -cont BasicCalculator -ec LoggingService
The -ec options of Trengen specifies a comma separated list of paths to the contributions on which BasicCalculator depends
The administrator wants to upgrade a contribution from one version to another. The update command from the console should update a contribution to a new version. The format of the command is a follow: update "path_to_new_version" "contributionname"
If The administrator remove a contribution from which other contributions depends. A warning stating that the contribution is used by other contributions is shown. The list of contributions using exported resources is shown in the output.
Internally, absolute paths to resources from removed contributions still exists and are stored in the contributions that uses the dependencies. Therefore dependent contributions will still continue working normally as far as no resource is deleted from the file system.
In this section, we describe how to specify where the runtime can find all the executables, from which an executable is dependent. Dependencies can be specify globally for all executables, or locally by executable. Local specification of dependencies overwrite global specification
Deployer can specify a folder that contains all the executables, from which an executable is dependent.
<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:ss="MyNamespace"> <deployable composite="ss:MyComposite"/> <import.cpp name="dll-directory" location="../bin" /> </contribution>
The tag import.cpp MUST have the name dll-directory . The required location can be relative to the contribution root folder or absolute. We recommend using a relative value since it is more portable
In extreme case, the dll-directory might be different from device to device. The deployer still have the possibility to set the dll-directory without having to rebuild the contribution. In the META-INF directory, open the file sca-contribution.conf and add the following line at the end of the file:
dir=<absolute/or relative/ path to the/ dll directory >
The runtime will not load your contribution if the given directory does not exists.