[Owncloud] Need feedback for apptemplate_advanced and app tutorial

Bernhard Posselt nukeawhale at gmail.com
Thu Dec 6 04:28:39 UTC 2012


I've updated the documentation and the apptemplate. There are more hints
on how to create Controllers and when you should create them, PHPUnit
mockobjects are now used for the unittest example and security
excemptions can now be defined with annotations (wrote a very simple
parser for that :) )

I'll will include the shellscript tomorrow, thanks for the help.



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