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'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 <<a href=3D"mailto:[email protected]">tommyhp2@g= mail.com</a>> 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("mediaFile.error.view.dirNameEmpty&q= uot;);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (this.newDirectoryName.cont= ains("/")) {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 addErro= r("mediaFile.error.view.dirNameInvalid");<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'm just curious about reason(s) why it checks to con= tain '/' when it's just another character in a string in the SQ= L back end while this character '\' 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 'Delete folder= 9; is misleading because,=C2=A0intuitively, it represents deleting the '= ;default' directory instead of the 'imgs' directory.=C2=A0 Howe= ver, the 'default' 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 'Delete folder' 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<s:select id=3D"sortByMenu" nam= e=3D"sortBy" list=3D"sortOptions" listKey=3D"key&q= uot; listValue=3D"value"<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"document.m= ediaFileViewForm.submit();"/><br><br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0<s:if test=3D"currentDirectory.name !=3D 'default&= #39; && !pager"><br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0<s:submit value=3D"%{getText('mediaFileView= .deleteFolder')}" cssClass=3D"btn"<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"mediaFileView!deleteFolder" onclick=3D"onDelete= Folder();return false;"/><br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0</s:if><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</div><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<s:select id=3D"moveTargetMenu" name=3D&q= uot;selectedDirectory" cssStyle=3D"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"allDirectories" listKey=3D= "id" listValue=3D"name"/><br>-<br>- =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<s:if test=3D"currentDirec= tory.name !=3D 'default' && !pager"><br>- =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<s:submit = value=3D"%{getText('mediaFileView.deleteFolder')}" cssCla= ss=3D"btn"<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"media= FileView!deleteFolder" onclick=3D"onDeleteFolder();return false;&= quot;/><br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<= /s:if><br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</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 <<a href=3D"mailto:[email protected]" target=3D"_blank">snoopd= [email protected]</a>> 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> "Add a new folder" 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 <<a href=3D"mailto:tommyhp2@g= mail.com" target=3D"_blank">[email protected]</a>> wrote:<br> <br> > Hello everyone,<br> ><br> > I'm don't think that roller has any hierarchical directory str= ucture for<br> > the media files such as:<br> ><br> > + default (root)<br> > |---- images<br> > |=C2=A0 =C2=A0 =C2=A0|---- CES_2020<br> > |=C2=A0 =C2=A0 =C2=A0|---- EEE_2020<br> > |=C2=A0 =C2=A0 =C2=A0|---- Auto_2020<br> > |---- documents<br> > |---- videos<br> > |=C2=A0 =C2=A0 =C2=A0|---- presentations<br> > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|---- San_Francisco_202002<b= r> ><br> > which doesn't seem to be supported in the SQL backend:<br> ><br> > CREATE TABLE `roller_mediafiledir` (<br> >=C2=A0 `id` varchar(48) NOT NULL,<br> >=C2=A0 `name` varchar(255) NOT NULL,<br> >=C2=A0 `description` varchar(255) DEFAULT NULL,<br> >=C2=A0 `websiteid` varchar(48) NOT NULL,<br> > -- `parentid` varchar(48) NOT NULL COMMENT 'missing to support hie= rarchy'<br> >=C2=A0 PRIMARY KEY (`id`),<br> > -- KEY `parentid `=C2=A0 (`parentid `) --=C2=A0 missing to support hie= rarchy<br> >=C2=A0 KEY `mf_weblogid_fk` (`websiteid`)<br> > )<br> ><br> > Would someone please confirm?=C2=A0 If the hierarchical structure is n= ot<br> > supported, how can I go about requesting this feature since it makes<b= r> > organization of the media files easier?<br> ><br> > Thanks,<br> > Tommy<br> ><br> </blockquote></div> </blockquote></div> --0000000000001713dd059f3359f6-- --0000000000001713de059f3359f7--