Basically when you are developing for Social Engine, the best approach you’d take is to try as much as possible not to modify the pre-existing modules. That is because whenever a new SocialEngine update has been released, you’ll find hard time porting your changes to the new update. Not to mention the risk of messing up a pre-existing SE code.
Luckily Social Engine follows a Modular design pattern. That is, according to Wikipedia:
Modular programming is a software design technique that increases the extent to which software is composed of separate, interchangeable components, called modules by breaking down program functions into modules, each of which accomplishes one function and contains everything necessary to accomplish this
Modules in SocialEngine are found in “/application/modules/”. You’ll find a nice bunch of pre-existing modules that constitute SocialEngine functionality.
So how do you create a module? There is a nice process that takes takes care of creating the basic module structure and makes it already part of the application. The process consists of 3 parts:
- Creating the module
- Installing the module
- Building the module
This is not an official guide on how to create a module for SE, these steps I just discovered them while playing around with SE and this is what I actually do to create a module. I hope they become helpful to you :)
Creating the module:
- First off, head to your website, and login with a user who has admin privileges.
- We need the Package Manager, so go to this link after you login: http://<SOCIAL_ENGINE_ADDR>/install/manage, replacing of course <SOCIAL_ENGINE_ADDR> with the correct one. Inside the package manager you’ll find different installed modules, and you can enable/ disable them as you wish.
- Switch to Developer SDK Tab and click on Create a Package
- As you see Social Engine can setup for you any type of package you might need. In our case we’d select package of type Module. Complete the rest of required fields and hit “Create Package” button.
By now you’ll have a compressed archive downloaded. If you look into it you’ll find the basic module file structure has been created for you. So next step is to actually make that module part of Social Engine so that you could start working on it and preview the changes immediately.
Installing the module:
Head again to http://<SOCIAL_ENGINE_ADDR>/install/manage, and click on Install New Packages link. The process of installing a new package consists of several automated steps. You just need to specify the package to install (which is the one downloaded from the previous steps), and the Step called “Enter FTP Info“. If Social Engine is running on your local server (the actual computer that you’re developing on), then you could just choose “None” for the FTP Connection Type, put in the Path to SE (it should be already there though) and mark “Search for SocialEngine Path“. Otherwise you’ll have to fill up the FTP connection fields.
Then keep hitting continue until you’re done. You should get message like this in the end:
So now you’ve got you’re package created, installed and enabled in your SocialEngine application. You’ll find your module has appeared in SE’s modules folder and you can now modify it as you wish. If you’re still getting started with SocialEngine, these guides might be useful as well:
Building the module:
When you have finished developing your module and you’re ready to send it for example to a client, or sell it somewhere, you can have SocialEngine build an installable package for your module.
- “Go to the “Developer SDK Tab” in the Package Manager.
- Click on Build Packages
- Find your module an make a tick in the associated checkbox
- Click on “Build Packages” button.
- You can now click on your package to download it. This page is also accessible from “Manage Package Files” link in Developer SDK Tab under Package Manager