MySource Matrix Developer

Main Content

Creating The Asset Files

Introduction

In this guide we will create a new asset which extends "User" asset. The "Better User" asset will have more attributes like address, phone, state.

Terminal commands for file creation

To create a simple asset, in this case a "Better User" asset, we will need to create few directories and files. From your Matrix root execute the commands presented below

Create a package directory under package/cms. (Squiz Developers: If you do not have these directories please see the "How to checkout Matrix on Delta" guide.)
mkdir packages/cms/better_user
Change in to the better_user directory.
cd packages/cms/better_user
Create an empty asset.xml file. This file will have info about our new asset. Which package it belongs to, its type, version, name, requirements etc.
touch asset.xml
Create edit_interface_screen_details.xml. This is one of the screen files for Details screen. It defines how the Details screen will look in the backend and limbo (frontend editing). For more details on screens see the "Screens" documentation.
touch edit_interface_screen_details.xml
Create better_user_edit_fns.inc. This file will have php functions that prints and processes some of the attributes.
touch better_user_edit_fns.inc
Create better_user.inc, the main asset file where frontend printing and processing is handled.
touch better_user.inc
Create better_user_management.inc, this file will have information about the attributes to be stored in the asset.
touch better_user_management.inc
Create "locale" directory and "locale/en" directories.
mkdir locale
mkdir locale/en
Create lang_screen_details.xml in locale/en/ directory. This file will have display name and notes for attributes.
touch locale/en/lang_screen_details.xml
Your Better User directory structure should now look like this
Better User
|_ asset.xml
|_ edit_interface_screen_details.xml
|_ better_user.inc
|_ better_user_edit_fns.inc
|_ better_user_management.inc
|_ locale
  |_ en
    |_ lang_screen_details.xml