Re: [Roller6] Media Files Directory hierarchy

Tommy Pham <[email protected]> Sat, 22 Feb 2020 16:29:22 -0800
Newsgroups gmane.comp.java.roller.user
Message-ID <CANPW+Mt5ujmdtpwe0pHV+fbH+iuyEn6B2_sNZ-x-5Xb8rxeNGA@mail.gmail.com>
--0000000000001713de059f3359f7
Content-Type: multipart/alternative; boundary="0000000000001713dd059f3359f6"

--0000000000001713dd059f3359f6
Content-Type: text/plain; charset="UTF-8"

In case the image attachments didn't make through, here is the link:

https://imgur.com/a/m1eXGR9

Images are in the order of the previous e-mail.

On Sat, Feb 22, 2020 at 4:27 PM Tommy Pham <[email protected]> wrote:

> 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
>> >
>>
>

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

<div dir=3D"ltr">In case the image attachments didn&#39;t make through, her=
e is the link:<br><div><br></div><div><a href=3D"https://imgur.com/a/m1eXGR=
9">https://imgur.com/a/m1eXGR9</a>=C2=A0</div><div><br></div><div>Images ar=
e in the order of the previous e-mail.=C2=A0<br></div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Feb 22, 2020=
 at 4:27 PM Tommy Pham &lt;<a href=3D"mailto:[email protected]">tommyhp2@g=
mail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><div dir=3D"ltr">Hi Dave,<br><div><br></div><div>Thanks for the fee=
dback and clarification.=C2=A0 It makes sense.=C2=A0 I guess I could use th=
is to represent hierarchical structure in a linear bread crumb view:</div><=
div><br></div><div><font face=3D"monospace">videos\presentations\San_Franci=
sco_202002</font></div><div><br></div><div>Looking at the back end code for=
 validation:</div><div><br></div><div><font face=3D"monospace">package org.=
apache.roller.weblogger.ui.struts2.editor;<br></font></div><div><font face=
=3D"monospace"><br></font></div><div><font face=3D"monospace">public class =
MediaFileView extends MediaFileBase {<br></font></div><div><font face=3D"mo=
nospace">=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 (StringUtils.isEmpty(this.newDirectoryName)) {<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 addError(&quot;mediaFile.error.view.dirNameEmpty&q=
uot;);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (this.newDirectoryName.cont=
ains(&quot;/&quot;)) {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 addErro=
r(&quot;mediaFile.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><d=
iv><br></div><div>I&#39;m just curious about reason(s) why it checks to con=
tain &#39;/&#39; when it&#39;s just another character in a string in the SQ=
L back end while this character &#39;\&#39; works...=C2=A0 Also, from this =
screen shot:</div><div><br></div><div><div><img src=3D"cid:ii_k6y9gvts0" al=
t=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&#3=
9; is misleading because,=C2=A0intuitively, it represents deleting the &#39=
;default&#39; directory instead of the &#39;imgs&#39; directory.=C2=A0 Howe=
ver, the &#39;default&#39; directory is grey-ed out because there are no fi=
les to select for (delete or move to) actions.=C2=A0 Even when there are fi=
les, that drop down is only selectable when at least one file is selected.=
=C2=A0 In either case, I still think that &#39;Delete folder&#39; button is=
 still misleading.=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"monospace">--- MediaFileView.jsp.ori =C2=A0 =C2=A0 =C2=A0 2020-02-22 16=
:11:17.461733000 -0800<br>+++ MediaFileView.jsp.patch =C2=A0 =C2=A0 2020-02=
-22 16:13:38.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; nam=
e=3D&quot;sortBy&quot; list=3D&quot;sortOptions&quot; listKey=3D&quot;key&q=
uot; listValue=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.m=
ediaFileViewForm.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;&amp; !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&quot;mediaFileView!deleteFolder&quot; onclick=3D&quot;onDelete=
Folder();return false;&quot;/&gt;<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0&lt;/s:if&gt;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;/div&gt;<br><b=
r><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&q=
uot;selectedDirectory&quot; cssStyle=3D&quot;display: inline; width: 15em&q=
uot;<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;currentDirec=
tory.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; cssCla=
ss=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;media=
FileView!deleteFolder&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&g=
t;</font><br></div><div><br></div><div>for what I think is a more user frie=
ndly UI:</div><div><br></div><div><div><img src=3D"cid:ii_k6ya98le1" alt=3D=
"image.png" width=3D"562" height=3D"250"><br></div></div><div><br></div><di=
v>Thanks,</div><div>Tommy</div><div><br></div></div><br><div class=3D"gmail=
_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Feb 22, 2020 at 2:03 =
PM Dave &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">snoopd=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex">Roller did once have 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>
</blockquote></div>

--0000000000001713dd059f3359f6--
--0000000000001713de059f3359f7--