Imprimir

External Libraries

This feature allows to import complete libraries and create files of any extension (.JS, .CSS, .PHP…) that can be used in your projects, making it easier to reuse some of the source code.

This feature is available in the menu Tools > External Libraries, where you can manage the libraries of your project.

To use this functionality, you need to use the macro, sc_url_library() and the sc_include_library() (Only for PHP files)to import the library to the applications.

Creating a new library

To create a library, click on Create a new library. Next, inform the library name and the access level of the library.

Creating an external library - access level and name

  • Public - Available for all the ScriptCase projects.
  • Project - Available only for the project it was created in.

Managing the Libraries

All the public and project libraries are listed here. This page allows you to select the libraries that’ll be part of the project, delete the unnecessary libraries, rename or edit them.

List of libraries

Using a Library

This option defines a library that’ll be used in the current project. The enabled libraries, for this project, can be differentiated by the checkmark next to the name of the library.

Select libraries

Selecting a library to be used in the project, the icon changes color when you click on the button “Save the library to the project” and enabled, you need to click on the button to save the modifications.

Save the use of the libraries

Rename

To rename a library just click on “rename”, and then inform the new name for the library.

To rename a library, you’ll need to change all the includes of the library in the events of the applications.

Renaming a library

Editing a Library

Clicking on “Editing”, you can create or upload files to the libraries. You can create files in a folder, with the goal to organize your files.

On Footer of the page, you can view the options to create or upload the files.

Creating and upload files

New Directory

To create a directory, click on “New Directory” and inform the name of the directory.

Creating a new directory

New File

To create a file, click on “New File” and inform the name and extension (it’s indispensable to inform the file extension).

Creating a new file

Upload Files

This tool, allows to upload files and external libraries and used them in the project.

Clicking on upload, select the desired file.

File Upload Page

Delete

Delete the libraries and all the files contained in them.

Before deleting the library, be certain that it’s not being used, you won’t be able to recover deleted libraries.

Importing libraries into the applications

Like mentioned before, to use the libraries, you need to use the macro sc_url_library() and the sc_include_library() (Only for PHP files).

The macro sc_url_library() returns the path to the file in the library and the sc_include_library() is used to include php files into applications from the external library:

Importing an external library

This example changes the background color of a grid application, se the code in the style.css file

Importing an external library