Re: [Roller6] Media Files Directory hierarchy

Tommy Pham <[email protected]> Sat, 22 Feb 2020 16:27:07 -0800
Newsgroups gmane.comp.java.roller.user
Message-ID <CANPW+MtVqwC3fs73R8JSG_nHeS5AjKk3NKuXNYL-jonTMqahng@mail.gmail.com>
--0000000000001011db059f335138
Content-Type: multipart/alternative; boundary="0000000000001011d9059f335137"

--0000000000001011d9059f335137
Content-Type: text/plain; charset="UTF-8"

Hi Dave,

Thanks for the feedback and clarification.  It makes sense.  I guess I
could use this to represent hierarchical structure in a linear bread crumb
view:

videos\presentations\San_Francisco_202002

Looking at the back end code for validation:

package org.apache.roller.weblogger.ui.struts2.editor;

public class MediaFileView extends MediaFileBase {
    public String createNewDirectory() {
        boolean dirCreated = false;
        if (StringUtils.isEmpty(this.newDirectoryName)) {
            addError("mediaFile.error.view.dirNameEmpty");
        } else if (this.newDirectoryName.contains("/")) {
            addError("mediaFile.error.view.dirNameInvalid");
        } else {
// ...
        }
    }
}

I'm just curious about reason(s) why it checks to contain '/' when it's
just another character in a string in the SQL back end while this character
'\' works...  Also, from this screen shot:

[image: image.png]

I think the button 'Delete folder' is misleading because, intuitively, it
represents deleting the 'default' directory instead of the 'imgs'
directory.  However, the 'default' directory is grey-ed out because there
are no files to select for (delete or move to) actions.  Even when there
are files, that drop down is only selectable when at least one file is
selected.  In either case, I still think that 'Delete folder' button is
still misleading.  I made the following changes in WEB-INF/jsps/editor:

--- MediaFileView.jsp.ori       2020-02-22 16:11:17.461733000 -0800
+++ MediaFileView.jsp.patch     2020-02-22 16:13:38.513752000 -0800
@@ -130,6 +130,10 @@
             <s:select id="sortByMenu" name="sortBy" list="sortOptions"
listKey="key" listValue="value"
                       onchange="document.mediaFileViewForm.submit();"/>

+            <s:if test="currentDirectory.name != 'default' && !pager">
+                <s:submit value="%{getText('mediaFileView.deleteFolder')}"
cssClass="btn"
+                          action="mediaFileView!deleteFolder"
onclick="onDeleteFolder();return false;"/>
+            </s:if>
         </div>


@@ -293,11 +297,6 @@

                 <s:select id="moveTargetMenu" name="selectedDirectory"
cssStyle="display: inline; width: 15em"
                           list="allDirectories" listKey="id"
listValue="name"/>
-
-                <s:if test="currentDirectory.name != 'default' && !pager">
-                    <s:submit
value="%{getText('mediaFileView.deleteFolder')}" cssClass="btn"
-                              action="mediaFileView!deleteFolder"
onclick="onDeleteFolder();return false;"/>
-                </s:if>

             </div>

for what I think is a more user friendly UI:

[image: image.png]

Thanks,
Tommy


On Sat, Feb 22, 2020 at 2:03 PM Dave <[email protected]> wrote:

> Roller did once have a media file folder hierarchy but at one point we
> decided to simplify that and only allow one level of grouping. You can use
> "Add a new folder" to add a new folder, but you cannot add folders inside
> that folder.
>
> Dave
>
>
>
> On Sat, Feb 22, 2020 at 4:30 PM Tommy Pham <[email protected]> wrote:
>
> > Hello everyone,
> >
> > I'm don't think that roller has any hierarchical directory structure for
> > the media files such as:
> >
> > + default (root)
> > |---- images
> > |     |---- CES_2020
> > |     |---- EEE_2020
> > |     |---- Auto_2020
> > |---- documents
> > |---- videos
> > |     |---- presentations
> > |           |---- San_Francisco_202002
> >
> > which doesn't seem to be supported in the SQL backend:
> >
> > CREATE TABLE `roller_mediafiledir` (
> >  `id` varchar(48) NOT NULL,
> >  `name` varchar(255) NOT NULL,
> >  `description` varchar(255) DEFAULT NULL,
> >  `websiteid` varchar(48) NOT NULL,
> > -- `parentid` varchar(48) NOT NULL COMMENT 'missing to support hierarchy'
> >  PRIMARY KEY (`id`),
> > -- KEY `parentid `  (`parentid `) --  missing to support hierarchy
> >  KEY `mf_weblogid_fk` (`websiteid`)
> > )
> >
> > Would someone please confirm?  If the hierarchical structure is not
> > supported, how can I go about requesting this feature since it makes
> > organization of the media files easier?
> >
> > Thanks,
> > Tommy
> >
>

--0000000000001011d9059f335137
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Dave,<br><div><br></div><div>Thanks for the feedback an=
d clarification.=C2=A0 It makes sense.=C2=A0 I guess I could use this to re=
present hierarchical structure in a linear bread crumb view:</div><div><br>=
</div><div><font face=3D"monospace">videos\presentations\San_Francisco_2020=
02</font></div><div><br></div><div>Looking at the back end code for validat=
ion:</div><div><br></div><div><font face=3D"monospace">package org.apache.r=
oller.weblogger.ui.struts2.editor;<br></font></div><div><font face=3D"monos=
pace"><br></font></div><div><font face=3D"monospace">public class MediaFile=
View extends MediaFileBase {<br></font></div><div><font face=3D"monospace">=
=C2=A0 =C2=A0 public String createNewDirectory() {<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 boolean dirCreated =3D false;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (Str=
ingUtils.isEmpty(this.newDirectoryName)) {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 addError(&quot;mediaFile.error.view.dirNameEmpty&quot;);<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (this.newDirectoryName.contains(&quot=
;/&quot;)) {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 addError(&quot;me=
diaFile.error.view.dirNameInvalid&quot;);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 } =
else {</font></div><div><font face=3D"monospace">// ...<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 }<br></font></div><div><font face=3D"monospace">=C2=A0 =C2=A0=
 }<br></font></div><div><font face=3D"monospace">}</font></div><div><br></d=
iv><div>I&#39;m just curious about reason(s) why it checks to contain &#39;=
/&#39; when it&#39;s just another character in a string in the SQL back end=
 while this character &#39;\&#39; works...=C2=A0 Also, from this screen sho=
t:</div><div><br></div><div><div><img src=3D"cid:ii_k6y9gvts0" alt=3D"image=
.png" style=3D"margin-right: 0px;" width=3D"835" height=3D"783"><br></div><=
/div><div><br></div><div>I think the button &#39;Delete folder&#39; is misl=
eading because,=C2=A0intuitively, it represents deleting the &#39;default&#=
39; directory instead of the &#39;imgs&#39; directory.=C2=A0 However, the &=
#39;default&#39; directory is grey-ed out because there are no files to sel=
ect for (delete or move to) actions.=C2=A0 Even when there are files, that =
drop down is only selectable when at least one file is selected.=C2=A0 In e=
ither case, I still think that &#39;Delete folder&#39; button is still misl=
eading.=C2=A0 I made the following changes in=C2=A0<font face=3D"monospace"=
>WEB-INF/jsps/editor</font>:</div><div><br></div><div><font face=3D"monospa=
ce">--- MediaFileView.jsp.ori =C2=A0 =C2=A0 =C2=A0 2020-02-22 16:11:17.4617=
33000 -0800<br>+++ MediaFileView.jsp.patch =C2=A0 =C2=A0 2020-02-22 16:13:3=
8.513752000 -0800<br>@@ -130,6 +130,10 @@<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0&lt;s:select id=3D&quot;sortByMenu&quot; name=3D&quot;s=
ortBy&quot; list=3D&quot;sortOptions&quot; listKey=3D&quot;key&quot; listVa=
lue=3D&quot;value&quot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0onchange=3D&quot;document.mediaFileViewF=
orm.submit();&quot;/&gt;<br><br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
&lt;s:if test=3D&quot;currentDirectory.name !=3D &#39;default&#39; &amp;&am=
p; !pager&quot;&gt;<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0&lt;s:submit value=3D&quot;%{getText(&#39;mediaFileView.deleteFolder&=
#39;)}&quot; cssClass=3D&quot;btn&quot;<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0action=3D&quo=
t;mediaFileView!deleteFolder&quot; onclick=3D&quot;onDeleteFolder();return =
false;&quot;/&gt;<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/s:if&g=
t;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/div&gt;<br><br><br>@@ -293,11 =
+297,6 @@<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0&lt;s:select id=3D&quot;moveTargetMenu&quot; name=3D&quot;selectedDir=
ectory&quot; cssStyle=3D&quot;display: inline; width: 15em&quot;<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0list=3D&quot;allDirectories&quot; listKey=3D&quot;id&quot;=
 listValue=3D&quot;name&quot;/&gt;<br>-<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;s:if test=3D&quot;currentDirectory.name !=3D=
 &#39;default&#39; &amp;&amp; !pager&quot;&gt;<br>- =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;s:submit value=3D&quot;=
%{getText(&#39;mediaFileView.deleteFolder&#39;)}&quot; cssClass=3D&quot;btn=
&quot;<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0action=3D&quot;mediaFileView!delet=
eFolder&quot; onclick=3D&quot;onDeleteFolder();return false;&quot;/&gt;<br>=
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/s:if&gt;<br><=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/div&gt;</font><br><=
/div><div><br></div><div>for what I think is a more user friendly UI:</div>=
<div><br></div><div><div><img src=3D"cid:ii_k6ya98le1" alt=3D"image.png" wi=
dth=3D"562" height=3D"250"><br></div></div><div><br></div><div>Thanks,</div=
><div>Tommy</div><div><br></div></div><br><div class=3D"gmail_quote"><div d=
ir=3D"ltr" class=3D"gmail_attr">On Sat, Feb 22, 2020 at 2:03 PM Dave &lt;<a=
 href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex">Roller did once hav=
e a media file folder hierarchy but at one point we<br>
decided to simplify that and only allow one level of grouping. You can use<=
br>
&quot;Add a new folder&quot; to add a new folder, but you cannot add folder=
s inside<br>
that folder.<br>
<br>
Dave<br>
<br>
<br>
<br>
On Sat, Feb 22, 2020 at 4:30 PM Tommy Pham &lt;<a href=3D"mailto:tommyhp2@g=
mail.com" target=3D"_blank">[email protected]</a>&gt; wrote:<br>
<br>
&gt; Hello everyone,<br>
&gt;<br>
&gt; I&#39;m don&#39;t think that roller has any hierarchical directory str=
ucture for<br>
&gt; the media files such as:<br>
&gt;<br>
&gt; + default (root)<br>
&gt; |---- images<br>
&gt; |=C2=A0 =C2=A0 =C2=A0|---- CES_2020<br>
&gt; |=C2=A0 =C2=A0 =C2=A0|---- EEE_2020<br>
&gt; |=C2=A0 =C2=A0 =C2=A0|---- Auto_2020<br>
&gt; |---- documents<br>
&gt; |---- videos<br>
&gt; |=C2=A0 =C2=A0 =C2=A0|---- presentations<br>
&gt; |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|---- San_Francisco_202002<b=
r>
&gt;<br>
&gt; which doesn&#39;t seem to be supported in the SQL backend:<br>
&gt;<br>
&gt; CREATE TABLE `roller_mediafiledir` (<br>
&gt;=C2=A0 `id` varchar(48) NOT NULL,<br>
&gt;=C2=A0 `name` varchar(255) NOT NULL,<br>
&gt;=C2=A0 `description` varchar(255) DEFAULT NULL,<br>
&gt;=C2=A0 `websiteid` varchar(48) NOT NULL,<br>
&gt; -- `parentid` varchar(48) NOT NULL COMMENT &#39;missing to support hie=
rarchy&#39;<br>
&gt;=C2=A0 PRIMARY KEY (`id`),<br>
&gt; -- KEY `parentid `=C2=A0 (`parentid `) --=C2=A0 missing to support hie=
rarchy<br>
&gt;=C2=A0 KEY `mf_weblogid_fk` (`websiteid`)<br>
&gt; )<br>
&gt;<br>
&gt; Would someone please confirm?=C2=A0 If the hierarchical structure is n=
ot<br>
&gt; supported, how can I go about requesting this feature since it makes<b=
r>
&gt; organization of the media files easier?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Tommy<br>
&gt;<br>
</blockquote></div>

--0000000000001011d9059f335137--
--0000000000001011db059f335138--