[Owncloud] Need feedback for apptemplate_advanced and app tutorial

Bernhard Posselt nukeawhale at gmail.com
Thu Dec 6 02:30:07 UTC 2012


Wow great :)

BTW im in progress of making security checks easier by using
annotations. Basically you can add doc comments to disable checks like

    /**
     * @CSRFExcemption
     * @IsAdminExcemption
     *
     * @brief renders the index page
     * @param array $urlParams: an array with the values, which were
matched in
     *                          the routes file
     * @return an instance of a Response implementation
     */
    public function index($urlParams=array()){

Since PHP is crap I've added a library that handles the annotation
parsing (http://code.google.com/p/addendum).

I hope everyone is fine with that.

On 12/06/2012 03:25 AM, Nathan Anderson wrote:
> This tutorial was made a just the right time for me.  I'm basically brand new to ownCloud and I need to make an app or two for my work.  Thanks!
>
> I did notice an issue with the tutorial.  The 'apptemplate_advanced/appinfo/app.php' file in the tutorial does not match the latest file in git (line missing: \OCP\App::registerAdmin...).  Also, I saw the request in the tutorial for some "sed" commands and made a quick and dirty shell script.  This suits my needs, but there are plenty opportunities for improvement:
>  * create namespace name based on app name
>  * automatically escape characters that will cause problems with the regex
>  * check for appropriate permissions
>  * prevent display of expected error messages
>
> I'm not sure if the mail list allows attachments so my 'apptemplate_advanced/create_app.sh' file is inline below.
>
> Thanks again and I hope this file helps...
> Nathan
>
> -------------------------------------
>
> #!/bin/bash
> APP_NAME='your_app_name'
> APP_FULLNAME='Your App Name'
> APP_NAMESPACE='YourAppName'
> DEVELOPER_NAME='Your Full Name'
> DEVELOPER_EMAIL='your at email\.address'
>
> OLD_APP_NAME='apptemplate_advanced'
> OLD_APP_FULLNAME='App Template plugin'
> OLD_APP_FULLNAME2='Advanced App Template'
> OLD_APP_NAMESPACE='AppTemplateAdvanced'
> OLD_DEVELOPER_NAME='Bernhard Posselt'
> OLD_DEVELOPER_EMAIL='nukeawhale at gmail\.com'
>
> if [ -d "$APP_NAME"]; then
>     echo "Directory $APP_NAME already exists. Please update script "
>     echo "configuration to use a unique APP_NAME."
> else
>     cd ..
>     mkdir $APP_NAME
>     cp -R $OLD_APP_NAME/* $APP_NAME
>     cd $APP_NAME
>
>     grep -lr -e "$OLD_APP_NAME" * | xargs sed -i "s/$OLD_APP_NAME/$APP_NAME/g"
>     grep -lr -e "$OLD_APP_FULLNAME" * | xargs sed -i "s/$OLD_APP_FULLNAME/$APP_FULLNAME/g"
>     grep -lr -e "$OLD_APP_FULLNAME2" * | xargs sed -i "s/$OLD_APP_FULLNAME2/$APP_FULLNAME/g"
>     grep -lr -e "$OLD_APP_NAMESPACE" * | xargs sed -i "s/$OLD_APP_NAMESAPCE/$APP_NAMESPACE/g"
>     grep -lr -e "$OLD_DEVELOPER_NAME" * | xargs sed -i "s/$OLD_DEVELOPER_NAME/$DEVELOPER_NAME/g"
>     grep -lr -e "$OLD_DEVELOPER_EMAIL" * | xargs sed -i "s/$OLD_DEVELOPER_EMAIL/$DEVELOPER_EMAIL/g"
> fi
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud




More information about the Owncloud mailing list