Install the SSP File Management feature
Edit on GitHubThis document describes how to install the Self-Service Portal (SSP) File Management feature.
For the Self-Service Portal to work correctly, you must install all SSP features. Each feature depends on the others for proper functionality.
Features SSP File Management depends on
- Install the SSP Asset Management feature
- Install the SSP Dashboard Management feature
- Install the SSP Inquiry Management feature
- Install the SSP Model Management feature
- Install the SSP Service Management feature
- Install the Asset-Based Catalog feature
Prerequisites
| FEATURE | VERSION | INSTALLATION GUIDE |
|---|---|---|
| Spryker Core | 202512.0 | Install the Spryker Core feature |
| Self-Service Portal | 202512.0 | Install Self-Service Portal |
Install the required modules
composer require spryker-feature/self-service-portal:"^202512.0" --update-with-dependencies
Make sure the following modules have been installed:
| MODULE | EXPECTED DIRECTORY |
|---|---|
| SelfServicePortal | vendor/spryker-feature/self-service-portal |
Set up configuration
| CONFIGURATION | SPECIFICATION | NAMESPACE |
|---|---|---|
| FileSystemConstants::FILESYSTEM_SERVICE | Configures the Flysystem service for managing file uploads, specifying the adapter and storage path for files. | Spryker\Shared\FileSystem |
| SelfServicePortalConstants::STORAGE_NAME | Defines the storage name for SSP files in the Flysystem configuration, linking to the specified file system service. | SprykerFeature\Shared\SelfServicePortal |
| KernelConstants::CORE_NAMESPACES | Defines the core namespaces. | Spryker\Shared\Kerne |
config/Shared/config_default.php
<?php
use Spryker\Shared\FileSystem\FileSystemConstants;
use Spryker\Service\FlysystemAws3v3FileSystem\Plugin\Flysystem\Aws3v3FilesystemBuilderPlugin;
use SprykerFeature\Shared\SelfServicePortal\SelfServicePortalConstants;
$config[FileSystemConstants::FILESYSTEM_SERVICE] = [
'ssp-files' => [
'sprykerAdapterClass' => Aws3v3FilesystemBuilderPlugin::class,
'key' => getenv('SPRYKER_S3_SSP_FILES_KEY') ?: '',
'secret' => getenv('SPRYKER_S3_SSP_FILES_SECRET') ?: '',
'bucket' => getenv('SPRYKER_S3_SSP_FILES_BUCKET') ?: '',
'region' => getenv('AWS_REGION') ?: '',
'version' => 'latest',
'root' => '/files',
'path' => '',
],
];
$config[SelfServicePortalConstants::STORAGE_NAME] = 'ssp-files';
$config[KernelConstants::CORE_NAMESPACES] = [
...
'SprykerFeature',
];
Set up database schema
Apply schema updates:
console propel:install
Make sure the following tables have been created in the database:
spy_company_user_filespy_company_business_unit_file
Make sure the following columns have been added to the spy_file table:
file_referenceuuid
Set up transfer objects
Generate transfer classes:
console transfer:generate
Configure navigation
Add the Files section to navigation.xml:
config/Zed/navigation.xml
<?xml version="1.0"?>
<config>
<ssp>
<label>Customer Portal</label>
<title>Customer Portal</title>
<icon>fa-id-badge</icon>
<pages>
<self-service-portal-company-file>
<label>File Attachments</label>
<title>File Attachments</title>
<bundle>self-service-portal</bundle>
<controller>list-file</controller>
<action>index</action>
</self-service-portal-company-file>
</pages>
</ssp>
</config>
Generate routers and navigation cache:
console router:cache:warm-up:backoffice
console navigation:build-cache
Make sure that, in the Back Office, the Customer portal > File Attachments section is available.
Set up behavior
| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
|---|---|---|---|
| ViewCompanyUserFilesPermissionPlugin | Enables company users to view the files they uploaded. | SprykerFeature\Shared\SelfServicePortal\Plugin\Permission | |
| ViewCompanyBusinessUnitFilesPermissionPlugin | Allows access to files uploaded within a business unit. | SprykerFeature\Shared\SelfServicePortal\Plugin\Permission | |
| ViewCompanyFilesPermissionPlugin | Allows access to all files within a company. | SprykerFeature\Shared\SelfServicePortal\Plugin\Permission | |
| DownloadCompanyFilesPermissionPlugin | Enables downloading files. | SprykerFeature\Yves\SelfServicePortal\Plugin\Permission | |
| SelfServicePortalPageRouteProviderPlugin | Provides Yves routes for the SSP file management feature. | SprykerFeature\Yves\SelfServicePortal\Plugin\Router | |
| FileSizeFormatterTwigPlugin | Adds a Twig filter to format file sizes in a human-readable format. | SprykerFeature\Yves\SelfServicePortal\Plugin\Twig | |
| SelfServicePortalTwigPlugin | Provides Twig functionality for Self-Service Portal features. | SprykerFeature\Zed\SelfServicePortal\Communication\Twig |
src/Pyz/Zed/Permission/PermissionDependencyProvider.php
<?php
namespace Pyz\Zed\Permission;
use Spryker\Zed\Permission\PermissionDependencyProvider as SprykerPermissionDependencyProvider;
use SprykerFeature\Shared\SelfServicePortal\Plugin\Permission\ViewCompanyBusinessUnitFilesPermissionPlugin;
use SprykerFeature\Shared\SelfServicePortal\Plugin\Permission\ViewCompanyFilesPermissionPlugin;
use SprykerFeature\Shared\SelfServicePortal\Plugin\Permission\ViewCompanyUserFilesPermissionPlugin;
class PermissionDependencyProvider extends SprykerPermissionDependencyProvider
{
/**
* @return array<\Spryker\Shared\PermissionExtension\Dependency\Plugin\PermissionPluginInterface>
*/
protected function getPermissionPlugins(): array
{
return [
new ViewCompanyUserFilesPermissionPlugin(),
new ViewCompanyBusinessUnitFilesPermissionPlugin(),
new ViewCompanyFilesPermissionPlugin(),
];
}
}
src/Pyz/Client/Permission/PermissionDependencyProvider.php
<?php
namespace Pyz\Client\Permission;
use Spryker\Client\Permission\PermissionDependencyProvider as SprykerPermissionDependencyProvider;
use SprykerFeature\Yves\SelfServicePortal\Plugin\Permission\DownloadCompanyFilesPermissionPlugin;
use SprykerFeature\Shared\SelfServicePortal\Plugin\Permission\ViewCompanyBusinessUnitFilesPermissionPlugin;
use SprykerFeature\Shared\SelfServicePortal\Plugin\Permission\ViewCompanyFilesPermissionPlugin;
use SprykerFeature\Shared\SelfServicePortal\Plugin\Permission\ViewCompanyUserFilesPermissionPlugin;
class PermissionDependencyProvider extends SprykerPermissionDependencyProvider
{
/**
* @return array<\Spryker\Shared\PermissionExtension\Dependency\Plugin\PermissionPluginInterface>
*/
protected function getPermissionPlugins(): array
{
return [
new DownloadCompanyFilesPermissionPlugin(),
new ViewCompanyUserFilesPermissionPlugin(),
new ViewCompanyBusinessUnitFilesPermissionPlugin(),
new ViewCompanyFilesPermissionPlugin(),
];
}
}
src/Pyz/Yves/Router/RouterDependencyProvider.php
<?php
namespace Pyz\Yves\Router;
use Spryker\Yves\Router\RouterDependencyProvider as SprykerRouterDependencyProvider;
use SprykerFeature\Yves\SelfServicePortal\Plugin\Router\SelfServicePortalPageRouteProviderPlugin;
class RouterDependencyProvider extends SprykerRouterDependencyProvider
{
/**
* @return array<\Spryker\Yves\RouterExtension\Dependency\Plugin\RouteProviderPluginInterface>
*/
protected function getRouteProvider(): array
{
return [
new SelfServicePortalPageRouteProviderPlugin(),
];
}
}
src/Pyz/Yves/Twig/TwigDependencyProvider.php
<?php
namespace Pyz\Yves\Twig;
use Spryker\Zed\Twig\TwigDependencyProvider as SprykerTwigDependencyProvider;
use SprykerFeature\Yves\SelfServicePortal\Plugin\Twig\FileSizeFormatterTwigPlugin;
class TwigDependencyProvider extends SprykerTwigDependencyProvider
{
/**
* @return array<\Spryker\Shared\TwigExtension\Dependency\Plugin\TwigPluginInterface>
*/
protected function getTwigPlugins(): array
{
return [
new FileSizeFormatterTwigPlugin(),
];
}
}
src/Pyz/Zed/SelfServicePortal/SelfServicePortalDependencyProvider.php
<?php
namespace Pyz\Zed\SelfServicePortal;
use SprykerFeature\Zed\SelfServicePortal\SelfServicePortalDependencyProvider as SprykerSelfServicePortalDependencyProvider;
use SprykerFeature\Zed\SelfServicePortal\Communication\Plugin\SspAssetManagement\SspFileSspAssetManagementExpanderPlugin;
class SelfServicePortalDependencyProvider extends SprykerSelfServicePortalDependencyProvider
{
/**
* @return array<\SprykerFeature\Zed\SspAssetManagement\Dependency\Plugin\SspAssetManagementExpanderPluginInterface>
*/
protected function getSspAssetManagementExpanderPlugins(): array
{
return [
new SspFileSspAssetManagementExpanderPlugin(),
];
}
}
src/Pyz/Zed/Twig/TwigDependencyProvider.php
<?php
namespace Pyz\Zed\Twig;
use Spryker\Zed\Twig\TwigDependencyProvider as SprykerTwigDependencyProvider;
use SprykerFeature\Zed\SelfServicePortal\Communication\Twig\SelfServicePortalTwigPlugin;
class TwigDependencyProvider extends SprykerTwigDependencyProvider
{
/**
* @return array<\Spryker\Shared\TwigExtension\Dependency\Plugin\TwigPluginInterface>
*/
protected function getTwigPlugins(): array
{
return [
new SelfServicePortalTwigPlugin(),
];
}
}
Set up widgets
| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
|---|---|---|---|
| SspCompanyFilesMenuItemWidget | Provides a menu item widget for the customer account side menu. | SprykerFeature\Yves\SelfServicePortal\Widget | |
| SspFileListWidget | Displays a file attachment available to a company user on the dashboard page in the customer account. | SprykerFeature\Yves\SelfServicePortal\Widget |
src/Pyz/Yves/ShopApplication/ShopApplicationDependencyProvider.php
<?php
namespace Pyz\Yves\ShopApplication;
use SprykerFeature\Yves\SelfServicePortal\Widget\SspCompanyFilesMenuItemWidget;
use SprykerFeature\Yves\SelfServicePortal\Widget\SspFileListWidget;
use SprykerShop\Yves\ShopApplication\ShopApplicationDependencyProvider as SprykerShopApplicationDependencyProvider;
class ShopApplicationDependencyProvider extends SprykerShopApplicationDependencyProvider
{
/**
* @return array<string>
*/
protected function getGlobalWidgets(): array
{
return [
SspCompanyFilesMenuItemWidget::class,
SspFileListWidget::class,
];
}
}
Add translations
Here you can find how to import translations for Self-Service Portal feature
Import translations:
console data:import glossary
Verify file upload and attachment:
- In the Back Office, go to Customer portal > File Attachments.
- Click Upload file.
- Drag and drop three files into the upload area.
- Click Upload. Make sure the File Attachments list page shows the files you’ve uploaded.
- Next to a file attachment with reference
FILE-1, click Attach. - Go to the Company user tab.
- Select a company user.
- Click Save.
Make sure you are redirected to the view file attachments page for
FILE-1. - In the Linked entities section, make sure the previously selected company user is displayed.
- Go to Customer portal > File Attachments.
- Next to a file attachment with reference
FILE-2, click Attach. - Go to the Business unit tab.
- Select a business unit.
- Click Save.
Make sure you are redirected to the view file attachments page for
FILE-2. - In the Linked entities section, make sure the previously selected business unit is displayed.
- Go to Customer portal > File Attachments.
- Next to a file attachment with reference
FILE-3, click Attach. - Go to the Company tab.
- Select a company.
- Click Save.
Make sure you are redirected to the view file attachments page for
FILE-3. - In the Linked entities section, make sure that business units from the previously selected company are displayed.
Verify permission management:
- In the Back Office, go to Customers > Company Roles.
- Click Add Company User Role.
- Select a company.
- Enter a name for the role.
- In Unassigned Permissions, enable the following permissions:
- Open My Files page
- Download file
- View My Files
- View Business unit files
- View Company Files
- Click Submit.
- Go to Customers > Company Users.
- Click Edit next to a user.
- Assign the role you’ve just created to the user.
- Go to Customer portal > File Attachments.
- Next to a file attachment with reference
FILE-1, click Attach. - Go to the Company user tab.
- Select the company user you’ve assigned the role to.
- Click Save.
Make sure you are redirected to the view file attachments page for
FILE-1. - In the Linked entities section, make sure the previously selected company user is displayed.
Verify permissions on Storefront:
- On the Storefront, log in with the company user you’ve assigned the role to. Make sure the Files menu item is displayed.
- Go to Customer Account > Files page. Make sure the file with reference FILE-1 is displayed.
- Click Download next to a file. Make sure a file is downloaded.
- Log out and log in with another company user that doesn’t have the role. Make sure the Files menu item is not displayed and you can’t access the Files page.
Set up frontend templates
For information about setting up frontend templates, see Set up SSP frontend templates.
Thank you!
For submitting the form