History of SamplePackage

Comparing versions
Version 22Current version
Sample is a fully functional bitweaver package that demonstrates capabilities and best practices for building your own package that extends the bitweaver and Liberty CMS core. This package makes a great starting place to building your own package. Bear in mind, you are not *required* to follow this coding technique. A bare bones package only needs a directory and a ))bit_setup_inc.php(( file. However, many package developers will want to integrate nicely with other bitweaver packages, and utilize other packages' services like the LibertyPackage CMS core.

Sample is entirely community driven. It is suggested that you begin here as this is a good starting point for anyone wanting to cut their teeth on getting to know the bitweaver architecture.

To Download:


To get this to work on your system:


First, extract and copy the sample folder to your bitweaver root directory.

This package requires you to run the installer because it creates its own database. If you are interesed, there is more information about the installer on the InstallPackage page.

Go to Administration -> Kernel -> Packages

Across the top, you should see an "Install Packages" tab. Click that. At the bottom of the list there is a link to the installer - Not the "Activate bitweaver Packages" button! Look where it says "To install more packages, please run the installer to choose your desired packages". Click the word "installer".

Now you are at the Package Installation page. You should see the "sample" package all checked off and ready to go. Click on the "Install Packages" link at the bottom. The table "bit_sample" will now be created in your database. When that is complete, click "continue with install", and BitWeaver will check for conflicts with other existing packages. If there are no conflicts, click on "Continue Install Process", and you will be at the "Installation is complete" page.

Click "Enter your bitweaver site" at the bottom, and the new Sample application should be active in the menu system. WaHoo!

For an exploration of these files, and how they work - visit the SamplePackageDissection page.

Use the Sample package as a place to start your own package


Here are some simple instructions you can use to quickly convert the sample package into a package you can use as a starting point for your own custom package. They are only for unix users.

A bash script based on these instructions to make packages is available in the sample package (included in the above download locations: sample/mkpackage.sh)

  1. Get a copy of the sample code and place it in your bitweaver root directory alongside all other package directories.

You can then either do the following:

  1. Rename the sample to a package for your choice, in our example "music" and change into your new directory:
mv sample music; cd music

  1. Case sensitive Search and Replace all occureneces of 'sample' with your package name:
find . -name "*" -exec perl -i -wpe "s/sample/music/g" {} \; ; find . -name "*" -exec perl -i -wpe "s/SAMPLE/MUSIC/g" {} \; ; find . -name "*" -exec perl -i -wpe "s/Sample/Music/g" {} \;
  1. Rename all the files containing 'sample' with your package name:
find . -name "*sample*" -exec rename sample music {} \; ; find . -name "*Sample*" -exec rename Sample Music {} \;

Or else you can:
  1. Run the mkpackage.sh script within the sample directory from your bitweaver root directory:
sample/mkpackage.sh music
which will do all of the above for you.

Finally you need to:
  1. Run the package installer to install your new package and you are up and running!
 
Sample is a fully functional bitweaver package that demonstrates capabilities and best practices for building your own package that extends the bitweaver and Liberty CMS core. This package makes a great starting place to building your own package. Bear in mind, you are not *required* to follow this coding technique. A bare bones package only needs a directory and a bit_setup_inc.php file. However, many package developers will want to integrate nicely with other bitweaver packages, and utilize other packages' services like the LibertyPackage CMS core.

Sample is entirely community driven. It is suggested that you begin here as this is a good starting point for anyone wanting to cut their teeth on getting to know the bitweaver architecture.

To Download:


To get this to work on your system:


First, extract and copy the sample folder to your bitweaver root directory.

This package requires you to run the installer because it creates its own database. If you are interesed, there is more information about the installer on the InstallPackage page.

Go to Administration -> Kernel -> Packages

Across the top, you should see an "Install Packages" tab. Click that. At the bottom of the list there is a link to the installer - Not the "Activate bitweaver Packages" button! Look where it says "To install more packages, please run the installer to choose your desired packages". Click the word "installer".

Now you are at the Package Installation page. You should see the "sample" package all checked off and ready to go. Click on the "Install Packages" link at the bottom. The table "samples" will now be created in your database. When that is complete, click "continue with install", and BitWeaver will check for conflicts with other existing packages. If there are no conflicts, click on "Continue Install Process", and you will be at the "Installation is complete" page.

Click "Enter your bitweaver site" at the bottom, and the new Sample application should be active in the menu system. WaHoo!

For an exploration of these files, and how they work - visit the SamplePackageDissection page.

Use the Sample package as a place to start your own package

Here are some simple instructions you can use to quickly convert the sample package into a package you can use as a starting point for your own custom package. They are only for unix users.
A bash script based on these instructions to make packages is available in the sample package (included in the above download locations: sample/mkpackage.sh)

  1. Get a copy of the sample code and place it in your bitweaver root directory alongside all other package directories.

You can then either do the following:

  1. Rename the sample to a package for your choice, in our example "music" and change into your new directory:
    
    <?php
    mv sample music
    cd music
    ?>
  2. Case sensitive Search and Replace all occureneces of 'sample' with your package name:
    
    <?php
    find 
    . -name "*" -exec perl --wpe "s/sample/music/g" {} \;
    find . -name "*" -exec perl --wpe "s/SAMPLE/MUSIC/g" {} \;
    find . -name "*" -exec perl --wpe "s/Sample/Music/g" {} \;
    ?>
  3. Rename all the files containing 'sample' with your package name (not Ubuntu):
    
    <?php
    find 
    . -name "*sample*" -exec rename sample music {} \;
    find . -name "*Sample*" -exec rename Sample Music {} \;
    ?>
  4. Rename all the files containing 'sample' with your package name (on Ubuntu):
    
    <?php
    find 
    . -name "*sample*" -exec rename s/sample/music/ {} \;
    find . -name "*Sample*" -exec rename s/Sample/Music/ {} \;
    ?>

Or else you can:

  1. Run the mkpackage.sh script within the sample directory from your bitweaver root directory:
    
    <?php
    ./sample/mkpackage.sh music
    ?>
    which will do all of the above for you. If using Ubuntu, you must first edit it to use the s/old/new/ syntax shown above.

Finally no matter which route you took you need to:

  1. Run the package installer to install your new package and you are up and running!
Page History
Date/CommentUserIPVersion
30 Mar 2009 (00:13 UTC)
Derek Simkowiak71.231.59.10529
Current • Source
Derek Simkowiak71.231.59.10528
View • Compare • Difference • Source
Daniel Sutcliffe71.161.102.627
View • Compare • Difference • Source
xing62.47.229.16426
View • Compare • Difference • Source
xing62.47.248.23125
View • Compare • Difference • Source
xing62.47.248.23124
View • Compare • Difference • Source
WaterDragon85.144.104.24723
View • Compare • Difference • Source
WaterDragon85.144.104.24722
View • Compare • Difference • Source
xing194.152.164.4521
View • Compare • Difference • Source
xing194.152.164.4520
View • Compare • Difference • Source
xing194.152.164.4519
View • Compare • Difference • Source
Hash9138.251.235.8618
View • Compare • Difference • Source
Hash9138.251.235.8617
View • Compare • Difference • Source
Hash9138.251.235.8616
View • Compare • Difference • Source
Hash9138.251.235.8614
View • Compare • Difference • Source
Hash9138.251.235.8613
View • Compare • Difference • Source
spiderr66.93.240.20411
View • Compare • Difference • Source
mjc64.26.155.629
View • Compare • Difference • Source
Sean Lee71.241.129.1748
View • Compare • Difference • Source
Chaim Krause69.23.127.717
View • Compare • Difference • Source
spiderr66.93.240.2045
View • Compare • Difference • Source
Kevin Olbrich152.16.227.1624
View • Compare • Difference • Source
cesout66.15.175.2503
View • Compare • Difference • Source
spiderr66.93.240.2042
View • Compare • Difference • Source