symfony2admingenerator / AdmingeneratorGeneratorBundle

(old-legacy) Admingenerator for Symfony2, parse generator.yml files to build classes

Home Page:http://symfony2admingenerator.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AngularJs

ndoulgeridis opened this issue · comments

Hello,

Would it be possible to integrate AngularJs into this bundle?

Thanks a lot?

Hi @Crash21

Something you can do and share with the community (but can't be integrated, for now, into this bundle) is to create a specific template bundle playing with AngularJS.

All templates could be easily changed and overided by another bundle (I've done that with the AdminLTE template for example). You will so be able to change everything on AngularJS.
That would be a very interesting thing to do. But we already started something on this way (have a look at RestGenerator) which is agnostic on any client technology.
That said, as you've probably seen, we don't have as much time as we would like to work on these projects. Unfortunately, we cannot be fully dedicated to that project.

Do not hesitate to try to start something with AngularJS (actually we imagined something creating the Angular (or ember) models based on generators and so on... time is missing).

How you mean "creating Angular models based on generators) Can you give some more details on that? Also where is RestGenerator?

@Crash21 It's a project we started that can be found here

it's not yet complete, and it's development has paused.. due to.. as @sescandell wrote.. no time :)

it's basic idea is the same as Admingenerator -> use simple configuration files to generate RestFull backend... which could be used to power Angular/Ember/any other applications

Is there a documentation or something very basic how GeneratorBundle works (I mean even uncommitted because nothing found committed)?
Also can you guide me whats the next things need to be done there?

@Crash21 If you're talking about RestApi / GeneratorBundle, we have a trello board we used to discuss the features and issues. I can send you an invite if you tell me your email address

Since RestApi is insipred by AdmingeneratorGeneratorBundle, the "base structure" is the same. Here is a very simplified workflow for Admingenerator:

  • the Resources/confing/****-generator.yml files contain configuration for admin panels
  • the RoutingLoader loads routes for all generators
  • when an Admingenerator route is requested, the CacheWarmer checks if the cache is up to date, and generates new cache, if necessary
  • new cache is generated by Generator class (each ORM has a diffrent generator class)
  • the generator uses Builders for diffrent functionalities, we have 5 major builders: List & Filters, Show, New & Edit, Excel, Actions. Filters builder has a seperate class, but it generates a "filter form" to be used on the "List" pane. New and Edit builders have seperate classes, but their functionality is very similar.
  • the builders prepare variables to be used in templates
  • the generator renders the templates for each builder, and saves the rendered output in cache/Admingenerated/...

There is another generator, used when you run admin:generate-admin or admin:generate-bundle. Based on your input, it creates files in your src/XxVendor/YyBundle directory.

The basic diffrence is that BundleGenerator is run only once, and the other Generators are run every time the cache is invalidated.

The Controller and Form classes in your src/XxVendor/YyBundle extend the ones in cache/Admingenerated/XxVendor/YyBundle. So you're getting some functionality "out of the box", but you can overwrite any method, simply by editing the child classes in src

The same goes for generated views. The views in src/XxVendor/YyBundle/Resources/views extend the ones in cache/Admingenerated/XxVendor/YyBundle/Resources/views... so again - you can use the "out of the box" experience or customize each part.

As for RestApi/GeneratorBundle - the basic idea (YAML config + RoutingLoader + CacheWarmer + Generators + Builders) is the same.

Except, this bundle aims only to generate RestFul controllers (useing FOSRestBundle) which can return responses in HTML, JSON and XML formats.

The HTML version is only supposed to be basic (very simple) - the goal of this bundle is to create a backend for Angular/Ember apps.

Ofcourse, when it's finished, we can make another bundle with HTML templates for RestApi/Generator. But thats optional. If we have time. Which we probably wont :P

If you're interested in RestApi and would like to contribute, you're very welcome :) As you can see we don't have enough time to do everything as fast as we would like to :)

I would like to contribute in my free time but I am not familiar at all how this is works. It's first time I am planning to contribute in an open source project in GitHub. So how this is works? Is there an issue tracker (as I feel that i would need someone to guide me what to implement next).

@Crash21 The issue tracker is the basic channel of communication. We can comment on issues or code here. If you want to help, you have to:

  1. Click the "Fork" button on top right part of page, to create your personal copy of the repository.
  2. Go to your repository, and copy the git address (under the right menu, "SSH clone address")
  3. On your computer, install git, on Debian linux distributions simply do sudo apt-get install git, on windows you have to install some client like http://git-scm.com/download/win
  4. Clone your private repository to your computer, type in command line git clone (here enter the git repository address) directory_name_to_copy_into, for example, go to /home/myuser/projects and git clone git@github.com:symfony2admingenerator/GeneratorBundle.git s2aGeneratorBundle
  5. In command line, go into your repository, and type git branch feature-something-i-want-to-fix, ofcourse, change the name of the branch... like feature-filters
  6. Switch to your new branch, by doing git checkout feature-filters
  7. Now you can modify the code.
  8. When you're ready, type these command git add . --all (adds all new/removed files to the commit)
  9. git commit -m "Here describe your changes" (creates a new "commit")
  10. git push origin feature-filters --force -> this sends your "feature-filters" branch to your github private repository
  11. Go to your github repository page, and click on the green button (on the left top part of page) to "create a pull request" from "YourRepository/feature-filters" branch to "symfony2admingenerator GeneratorBundle / develop" branch.

Hey thanks for this info. What about project specific issues. Like what is already implemented and what is needed to be done next. I ask because GeneratorBundle doesn't have a documentation so don't know even how it works.

Please see the new-unstable repository.

As for this repository goes, only bugfixes and minor changes are planned at the moment. All new ideas and major changes are in the new-unstable repository. I encourage you to test the new-unstable repository (i use Doctrine ORM in live projects.. but Doctrine ODM and Propel have not been tested, thats why the repository is called "unstable")

OK thanks a lot i will try test it. I use Propel in my projects but if needed can use Doctrine when I will develop. So the idea is to migrate RestGeneratorBundle inside AdminGeneratorBundle or in a separate bundle like it is already?

Thanks @loostro for this explanation,

@Crash21

So the idea is to migrate RestGeneratorBundle inside AdminGeneratorBundle or in a separate bundle like it is already

There is "no immediate link" between RestGeneratorBundle and AdminGeneratorBundle. As far we imagined it, there will never have any migration from one to another. The main idea behind RestGeneratorBundle is to make a Rest API Generator independent on any rendering logic. Today's applications are more and more "Rest API" oriented. AdmingeneratorGeneratorBundle was not really ready to a simple migration into this "Rest API" logic. So we decided to start a totally new Bundle taking advantages on what we've learned on AdmingeneratorGeneratorBundle (read mistakes to not reproduce). And... that's all... Time passed and we didn't (for now) had enough time to make this project really alive.

In simple words, what we targeted is having the same as the AdmingeneratorGeneratorBundle... better:

  • Be able to describe your API/models/actions through a YAML file (like in the AdminGeneratorBundle)
  • Provide some validations of YAML format thanks to the Symfony Configuration component (I thing we should also be able to use the Processor from this component, because our YAML parser is really complicated in our project and not flexible at all)
  • Generate FOSRest controllers regarding this YAML
  • Provide a Ember (or Angular) generator to exploit this API (as a seperate bundle)

Finally: the result would be the same... but with more decoupled and funny technologies :)