Start page / Advanced topics / Remote access

Remote access

FirstSpirit enables access from one project to other projects (so-called “remote projects”), which are located on the same FirstSpirit server. In this way, for example, objects (e.g. media), which is managed in a central project can be used by different projects (also called “target projects”). The objects are merely referenced in the target projects, but physically remain in the remote project.

Three different types of remote access are possible in FirstSpirit:

Remote Media

A corresponding licence must be available for use of the Remote Media function. To this end, the license.REMOTEPROJECT parameter of the licence (e.g. can be seen in FirstSpirit ServerMonitoring, menu item: “FirstSpirit – Configuration – Licence”) must be set to value 1.

For further information on configuration, see documentation for FirstSpirit CorporateMedia and Configuration (→Documentation for Administrators).

Access to remote projects

The input components and link configurations listed below can be used to access media and other objects from remote projects.

Parameters and tags which are relevant for the input components can be looked up in the Forms chapter of the respective input component. In general, the following tags and parameters are involved:

  • REMOTE with
    - name
    - autoReleaseAfterUpload
    - uploadFolder
  • CATEGORY with
    - name
  • FOLDER with
    - name
    - store
  • upload (in combination with REMOTE and/or CATEGORY)

Access via

Significance

CMS_INPUT_LINK

Input component for creating and editing links. Link templates are required for this input component.

FS_REFERENCE

Input component, via which any reference can be selected. In addition, FS_REFERENCE can be used to upload media into remote projects.

CMS_INPUT_DOM

Input component for entering text which allows also formattings and linking. Link templates are required for this input component.

CMS_INPUT_DOMTABLE

Input component for entering text in table form which allows also formattings and linking. Link templates are required for this input component.

FS_CATALOG
(type link, <TEMPLATES type="link"/>)

Input component for creating link lists. Link templates are required for this input component.

CMS_INPUT_IMAGEMAP

Input component, via which pictures from remote projects can be selected and referenced and given reference-sensitive areas. Link templates are required for this input component.

  

The order of the definitions of the remote projects within the input components affects the selection dialog in SiteArchitect:
* remote projects defined via REMOTE tag are displayed in the order of the form definition.
* remote projects defined via CATEGORY tag are displayed in alphabetical order.

Examples of remote links:

If selections from the remote project via link templates is to be enabled FS_REFERENCE with specification of the desired remote project using the tags PROJECTS / REMOTE is required.

According to the individual project requirements you can restrict the access to stores and / or project:

The following configuration enables the selection of page references from the Site Store and media from the Media Store of the (local) target project and of the remote project:

<FS_REFERENCE name="lt_reference" useLanguages="no">
<FILTER>
<ALLOW type="pageref"/>
<ALLOW type="media"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="Link target (remote project)"/>
<LANGINFO lang="DE" label="Verweisziel"/>
</LANGINFOS>
<PROJECTS>
<LOCAL name=".">
<SOURCES>
<FOLDER name="root" store="sitestore"/>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</LOCAL>
<REMOTE name="remote">
<SOURCES>
<FOLDER name="root" store="sitestore"/>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</REMOTE>
</PROJECTS>
</FS_REFERENCE>

The following configuration enables the selection of page reference from the Site Store and of media from the Media Store of the remote project only:

<FS_REFERENCE name="lt_reference" useLanguages="no">
<FILTER>
<ALLOW type="pageref"/>
<ALLOW type="media"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="Link target (remote project)"/>
<LANGINFO lang="DE" label="Verweisziel (Remote-Projekt)"/>
</LANGINFOS>
<PROJECTS>
<REMOTE name="remote">
<SOURCES>
<FOLDER name="root" store="sitestore"/>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</REMOTE>
</PROJECTS>
</FS_REFERENCE>

The following configuration enables the selection of images from the Media Store of the remote project:

<FS_REFERENCE name="lt_image_remote" useLanguages="no">
<FILTER>
<HIDE type="file"/>
<ALLOW type="picture"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="Select an image (remote project)"/>
<LANGINFO lang="DE" label="Bildauswahl (Remote-Projekt)"/>
</LANGINFOS>
<PROJECTS>
<REMOTE name="remote">
<SOURCES>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</REMOTE>
</PROJECTS>
</FS_REFERENCE>

The following configuration enables the selection of images from the Media Store of the remote project and of the target project:

<FS_REFERENCE name="lt_image" useLanguages="no">
<FILTER>
<HIDE type="file"/>
<ALLOW type="picture"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="Select an image"/>
<LANGINFO lang="DE" label="Bildauswahl"/>
</LANGINFOS>
<PROJECTS>
<LOCAL name=".">
<SOURCES>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</LOCAL>
<REMOTE name="remote">
<SOURCES>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</REMOTE>
</PROJECTS>
</FS_REFERENCE>

Output of references on remote projects

Media and pages from remote projects are output on the website via $CMS_REF(...)$ or $CMS_VALUE(ref:...)$.

Output of an internal reference to a remote project:

<a href="$CMS_REF(lt_reference)$">$CMS_VALUE(lt_text)$</a>

Picture output of a media reference from a remote project:

<img src='$CMS_REF(lt_image_remote)$ ...>

Resolutions in remote projects

The resolutions in remote and target projects can differ, i.e. they can have different names and / or different widths or heights.

These different resolutions must be taken into account in the template development. For further information, see $CMS_REF(...)$.

Generation of PDF files

Absolute references in the generation directory are used within the templates for the generation of PDF files via FOP: abs:3

As remote media objects are not copied into the generation directory, a path is generated on generation, which refers to the project directory of the remote project (release status).

Access to the remote project via the Access API

Access to the remote project via the Access API takes place via the UserService interface. The UserService interface has been enhanced to include the getRemoteUserService(String symbolicName) method, which returns the UserService of the remote project.

The symbolic name of the remote project configuration is transferred as the transfer parameter.

Extract from the API documentation:

UserService getRemoteUserService (java.lang.String symbolicName)
Gets the remote userservice by connecting to the project defined in the remote project configuration specified by the given symbolic name.

Parameters:
symbolicName - which specifies the remote project configuration

Returns:
the user service to of the remote project

The connections of the remote project are kept in the user's connection and are also closed with the disconnect() of the user connection.

Invoke the RemoteUserService via the Beanshell console in the target project:

bsh %
e.getProject().getUserService().getRemoteUserService("sym-Name")

Support for multi-language media

Media multilingualism is supported. This means that language-dependent remote media can be output in the target project in any of the maintained languages (of the remote project).

When specifying the optional lang or language parameter, the specified (remote) project language is also taken into account for the resolution of a reference. If the parameter is not specified, the reference is initiated with the current language (preview and generation).

A language abbreviation valid for the remote project and enclosed in double quotes is to be specified as the value. Instead of a fixed, defined identifier, the language object (e.g. #global.language) can also be used.

Important Remote and target project languages can be different. These different languages have to be taken into account when developing templates. If the template developer references a remote media file in a language that does not exist in the remote project, this can result in errors when requesting a preview and during generation.

Identical languages in the target project and remote projects: In this case, no errors should occur when requesting a preview or when generating objects.

Different languages in the target project and remote projects: In this case, errors can result if the template developer sets a language that does not exist in the remote project in the template set using the lang or language attribute. If the editor then selects a media file from the remote media store, the language preset by the template developer would not be found in the remote project when generating a preview, for instance. In this case, the media file would be output in the master language (of the remote project).

In contrast, it is possible to specify a remote media file in a language that is available only in the remote project but not in the target project. The language-dependent media file is physically located in the remote project. This allows the remote project's language-dependent media contents to be referenced in the target project using CorporateMedia access.

Applicable in this case: Languages are only used from the project where the media file originated. If an image from a remote media store is selected, only the language-dependent media contents that have been configured for the remote project are taken into account. If, instead, an image from the local media store is selected, the language-dependent media contents from the target project are taken into account.

Important A fixed language setting should be configured in templates only if either the languages in the target project and remote projects are identical or the source media store for the selected media can be known for certain.

Outputting using object language: Instead of specifying a fixed value using the lang/ language parameter, the template developer can also retrieve and pass the language object from the remote project. Using the following instruction, the template developer could output an image from a remote project with all of the languages available in the remote project (example for the FS_REFERENCE input component):

$CMS_IF(!st_remotepic.isEmpty)$
  $CMS_FOR(_lang, st_remotepic.media.project.languages)$
<pre>
$CMS_VALUE(_lang)$=$CMS_REF(st_remotepic, remote: st_remotepic.remoteSymName, lang:_lang)$
</pre>
  $CMS_END_FOR$
$CMS_END_IF$

© 2005 - 2022 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2022.12 | Data privacy