Re: Modularity - Users and UserProfile controllers

Tim Almdal <[email protected]> Sun, 12 May 2013 10:03:22 -0700
Newsgroups gmane.comp.web.gallery.devel
Message-ID <[email protected]>
--===============0546725233240009287==
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I agree that the Identity Provider as implemented is overly complex
    when it comes to switching providers (there is a dangerous place,
    where one is uninstalled and the new one isn't installed) to some
    simplification would be good.&nbsp; If I was to do the identity provider
    over again, I would make it a "stack" so that the default&nbsp; user
    module as provided by gallery is always installed at the bottom, and
    other providers (i.e. ldap) would be stacked above it.&nbsp; Searching
    for a user would parse down the stack looking for the appropriate
    user.&nbsp; This way we wouldn't have the messiness of switching the item
    owners and such<br>
    <br>
    Just my 2cents<br>
    <br>
    Tim<br>
    <div class="moz-cite-prefix">On 5/11/2013 3:20 PM, Bharat Mediratta
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAESa+_nK111a=_KcnRY_wJcJ5ktCsfR+rPvE80rcfMpC-BYD3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org"
      type="cite">
      <div dir="ltr"><br>
        <div style="">Up to my ears today so I can't respond to this in
          depth - but I think we're doing all the user module stuff
          wrong. &nbsp;Our current approach aims to be way too flexible and
          if we reduce scope we can greatly dial it down. &nbsp;Right now we
          have the Identity class that relies on the IdentityProvider
          interface which uses an IdentityProvider driver to do the
          actual work. &nbsp;This allows us to switch identity providers at
          runtime by adding and removing modules. &nbsp;That sounds great,
          but it adds a bunch of complexity that I think few people
          actually use. &nbsp;It also puts us in the awkward situation in a
          few places in the code where we're not even sure if there <i>is</i>&nbsp;an
          identity provider.</div>
        <div style=""><br>
        </div>
        <div style="">This is overly flexible and nobody needs it.</div>
        <div style=""><br>
        </div>
        <div style="">Instead we should just let modules implement the
          Identity API directly. &nbsp;No more IdentityProvider and driver -
          just define an Identity interface and let modules implement
          it. &nbsp;At install time, we'll install the user module by
          default.. but if you click an "advanced" link you can pick
          from some other ones (like Drupal, etc) and we'll install that
          module instead. &nbsp;You can't install identity modules later -
          once you pick one that's the one you get.&nbsp;</div>
        <div style=""><br>
        </div>
        <div style="">I think this will simplify things considerably.
          &nbsp;The user module can provide its own controllers, etc and we
          can move them out of the Gallery module so we don't have this
          abstract concept of what you can and can't do with users.</div>
        <div style=""><br>
        </div>
        <div style="">thoughts?</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Sat, May 11, 2013 at 2:26 PM, Shad
          Laws <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target="_blank">shad-xpYdmXCiSuZWk0Htik3J/[email protected]</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hmm... on second thought, the approach I
              proposed has a problem: it *expects* that Gallery should
              be able to change the email, password, etc., which may not
              always be the case for an identity provider. &nbsp;Using a
              module event is probably a more flexible approach...
              <div class="gmail_extra">
                <br>
              </div>
              <div class="gmail_extra">Take care,</div>
              <div class="gmail_extra">Shad</div>
              <div class="gmail_extra"><br>
                <br>
                <div class="gmail_quote">
                  <div class="im">On 11 May 2013 19:31, Shad Laws <span
                      dir="ltr">&lt;<a moz-do-not-send="true"
                        href="mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target="_blank">shad-xpYdmXCiSuZWk0Htik3J/[email protected]</a>&gt;</span>
                    wrote:<br>
                  </div>
                  <div>
                    <div class="h5">
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div dir="ltr">Hey everyone,
                          <div><br>
                          </div>
                          <div>I just finished converting the
                            user/group-related controllers and forms
                            over to Formo, and found that the view used
                            in Controller_UserProfile::action_show()
                            (gallery module) has URLs to things in
                            Controller_Users (user module)... which
                            seems like a breach of modularity.</div>
                          <div><br>
                          </div>
                          <div>Right now, we have:</div>
                          <div><font face="courier new, monospace">[user
                              module]<br>
                            </font></div>
                          <div><font face="courier new, monospace">class
                              Controller_Users extends
                              User_Controller_Users {}</font></div>
                          <div><font face="courier new, monospace">class
                              User_Controller_Users {<br>
                            </font></div>
                          <div>
                            <div><font face="courier new, monospace">&nbsp;
                                public function action_edit();</font></div>
                            <div><font face="courier new, monospace">&nbsp;
                                public function action_change_email();</font></div>
                            <div><font face="courier new, monospace">&nbsp;
                                public function
                                action_change_password();</font></div>
                            <div><font face="courier new, monospace">}</font></div>
                          </div>
                          <div><font face="courier new, monospace">[gallery
                              module]</font></div>
                          <div><font face="courier new, monospace">class
                              Controller_UserProfile
                              extends&nbsp;Gallery_Controller_UserProfile&nbsp;{}</font></div>
                          <div><font face="courier new, monospace">class
                              Gallery_Controller_UserProfile {<br>
                            </font></div>
                          <div><font face="courier new, monospace">&nbsp;
                              public function action_show();</font></div>
                          <div><font face="courier new, monospace">&nbsp;
                              public function action_contact();</font></div>
                          <div><font face="courier new, monospace">}</font></div>
                          <div><br>
                          </div>
                          <div>My thought:<br>
                          </div>
                          <div>- in the gallery module, change
                            Controller_UserProfile to make it an
                            abstract class in IdentityProvider.</div>
                          <div>- add three abstract action functions
                            that reflect the three links it wants.</div>
                          <div>- in the user module, make
                            Controller_UserProfile extend the abstract
                            class in Gallery.</div>
                          <div><br>
                          </div>
                          <div>Then, we'd have something like:</div>
                          <div>
                            <div>
                              <div><font face="courier new, monospace">[user
                                  module]<br>
                                </font></div>
                              <div><font face="courier new, monospace">class
                                  Controller_Users extends
                                  User_Controller_Users {}</font></div>
                              <div><font face="courier new, monospace">class
                                  User_Controller_Users extends
                                  IdentityProvider_Controller_Users {</font></div>
                              <div>
                                <div><font face="courier new, monospace">&nbsp;
                                    public function action_edit();</font></div>
                                <div><font face="courier new, monospace">&nbsp;
                                    public function
                                    action_change_email();</font></div>
                                <div><font face="courier new, monospace">&nbsp;
                                    public function
                                    action_change_password();</font></div>
                                <div><font face="courier new, monospace">}</font></div>
                              </div>
                            </div>
                            <div><font face="courier new, monospace">[gallery
                                module]</font></div>
                            <div><font face="courier new, monospace">abstract
                                class IdentityProvider_Controller_Users
                                extends
                                Gallery_IdentityProvider_Controller_Users
                                {}</font></div>
                            <div><font face="courier new, monospace">abstract
                                class
                                Gallery_IdentityProvider_Controller_Users&nbsp;{<br>
                              </font></div>
                            <div><font face="courier new, monospace">&nbsp;
                                public function action_show();</font></div>
                            <div><font face="courier new, monospace">&nbsp;
                                public function action_contact();</font></div>
                            <div><font face="courier new, monospace">&nbsp;
                                abstract public function action_edit();</font></div>
                            <div><font face="courier new, monospace">&nbsp;&nbsp;abstract&nbsp;public
                                function action_change_email();</font></div>
                            <div><font face="courier new, monospace">&nbsp;&nbsp;abstract&nbsp;public
                                function action_change_password();</font></div>
                            <div><font face="courier new, monospace">}</font></div>
                            <div><br>
                            </div>
                            <div>Thoughts?</div>
                            <div><br>
                            </div>
                            <div>Take care,<br>
                            </div>
                            <div>Shad</div>
                          </div>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                </div>
                <br>
              </div>
            </div>
            <br>
------------------------------------------------------------------------------<br>
            Learn Graph Databases - Download FREE O'Reilly Book<br>
            "Graph Databases" is the definitive new guide to graph
            databases and<br>
            their applications. This 200-page book is written by three
            acclaimed<br>
            leaders in the field. The early access version is available
            now.<br>
            Download your free book today! <a moz-do-not-send="true"
              href="http://p.sf.net/sfu/neotech_d2d_may" target="_blank">http://p.sf.net/sfu/neotech_d2d_may</a><br>
            __[ g a l l e r y - d e v e l ]_________________________<br>
            <br>
            [ list info/archive --&gt; <a moz-do-not-send="true"
              href="http://gallery.sf.net/lists.php" target="_blank">http://gallery.sf.net/lists.php</a>
            ]<br>
            [ gallery info/FAQ/download --&gt; <a
              moz-do-not-send="true" href="http://gallery.sf.net"
              target="_blank">http://gallery.sf.net</a> ]<br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/neotech_d2d_may">http://p.sf.net/sfu/neotech_d2d_may</a></pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --&gt; <a class="moz-txt-link-freetext" href="http://gallery.sf.net/lists.php">http://gallery.sf.net/lists.php</a> ]
[ gallery info/FAQ/download --&gt; <a class="moz-txt-link-freetext" href="http://gallery.sf.net">http://gallery.sf.net</a> ]</pre>
    </blockquote>
    <br>
  </body>
</html>


--===============0546725233240009287==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
--===============0546725233240009287==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]
--===============0546725233240009287==--