How to migrate Ossn v2 components to Ossn v3

Migration of Ossn 2.x components to v3.x
Suppose we wanted to migrate fancybox component,

To migrate the old component you have to do few changes.

  1. Change ossn_com.xml file to v3.0 format.
  2. Change the CSS and JS paths.
  3. Moving few files into plugins/default/ directory.

Change ossn_com.xml file to v3.0 format

Open your ossn_com.xml file and change it to following code:

<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.opensource-socialnetwork.org/v/3.0">
    <name>Fancybox</name>
    <id>fancybox</id>
    <author>Arsalan Shah</author>
    <description>Open images of newsfeed in fancybox.</description>
    <license>GNU General Public License, version 2</license>
    <author_url>http://www.informatikon.com/</author_url>
    <license_url>http://www.opensource-socialnetwork.org/licence/</license_url>
    <version>1.4</version>
    <requires>
        <type>ossn_version</type>
        <version>3.0</version>
    </requires>
</component>

Here the id is the exact path where Fancybox components files resides, 'fancybox' is the correct path:

components/fancybox/ossn_com.xml or components/[ID]/ossn_com.xml

Change the CSS and JS paths

Open a ossn_com.php file and find similar code:

ossnextendview('css/ossn.default', 'components/fancybox/css/fancybox.init');

Change it to :

ossnextendview('css/ossn.default', 'css/fancybox.init');

Do similar thing with JS find:

 ossn_extend_view('js/opensource.socialnetwork', 'components/fancybox/js/fancybox.init');

To:

 ossn_extend_view('js/opensource.socialnetwork', 'js/fancybox.init');

Now, Create :

1.) New directory called plugins in components/fancybox/, so it appears as /components/fancybox/plugins/
2.) New directory called default in component/fancybox/plugins/, so it appears as /components/fancybox/plugins/default/
3.) New directory called css in /components/fancybox/plugins/default/, so it appears as /components/fancybox/plugins/default/css/
3.) New directory called js in /components/fancybox/plugins/default/, so it appears as /components/fancybox/plugins/default/js/

Move files form /components/fancybox/css/ to /components/fancybox/plugins/default/css/ and /components/fancybox/js/ to /components/fancybox/plugins/default/js/

Thats all , make a zip of component and install it using installer and then enable it.

If you have a directory called componentName/forms/ then move files form it into componentName/plugins/default/forms/componentName/

See updated component here: https://www.opensource-socialnetwork.org/component/view/369/fancybox

Thanks
Arsalan Shah