Home / eZ / HowTo / Save typing by sharing classes.

Save typing by sharing classes.

When you realize how easily new classes are created and shared, you start to realize some of the true power of the system.

No duplication, don't repeat yourself, DRY, the eZ developers are fanatics about this concept. When you have custom "stuff" you have created for one system or one server, no need to type, or cut, paste, debug into a new server. Use the eZ Publish package system. In this case had created a class from text, matrix, and text block data types, and fifty plus of the matrix types is a lot of typing. The class is used for a Kindergarten classroom grading system and named k_grading_system. After prototype on intranet, need to move to internet.

To Export

Admin->Setup->Packages->Create new package->Content class export->Create package
Choose the k_grading_system class for export. Click next, next, continue, filling simple info into simple forms one line at a time until finally reach the "Export to file" button. Give the file a storage location and the k_grading_system-1.0-1.ezpkg is created and ready for use on other eZ Publish systems.

To Import

Importing and using the class is even simpler. Admin->Setup->Packages->Import new package.. browse to and select the package file and eZ handles the rest.

Troubleshooting tip -- if the file name enters into the edit box, and clicking the import button silently clears that file name from the edit box while nothing happens, check the value of post_max_size in php.ini. Likely the max value is smaller than the file size of the ezpkg.

That's it

A fantastic time and typing saver. The main purpose of the extra pages in the export system is to encourage detailed authoring/versioning of packages. This is a great idea from the standpoint of long term usability of the class. You someday will need to know who is original author, who has made changes, what the changes were, when they were made. All the important information that is too easily left out if not enforced by a systematic approach.
Then you can store the package online using the insert/edit object button in the eZ online editing system so you or anyone may access it as desired. Link below.

k_grading_system-1.0-1 - You do not have permission to view this object.

Animated GIF eZ Logo

No need to dream up layouts and page views, just insert your "stuff".

Roll Your Own Social Network

News networks, and personal sized social networking sites are simple with eZ.