Foros de discusión

documents and media portlet show date created?

thumbnail
michael hamlett, modificado hace 9 años.

documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
the 6.2 documentation plainly states that creation date and modified date are available.
but not for me.
any ideas why?


Under the Show Columns heading, you can customize which columns appear when your Documents and Media portlet uses the list display style. By default, file names, sizes, statuses, downloads, and actions are displayed. You can also configure the portlet to display files’ create dates and modified dates.
thumbnail
Jesse Rao, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 58 Fecha de incorporación: 12/07/10 Mensajes recientes
The create date and modified date fields are available but they are not configured to be displayed by default. To make them appear in the List view of the Documents and Media portlet, use these steps:

1. Open the Configuration window (click on wrench icon -> select *Configuration*).

2. On the Display Settings tab, scroll down until you see the Entries Listing for List Display Style area.

3. Move the Create Date and Modified Date fields from Available to Current.

4. Click Save, close the Configuration window, make sure the Documents and Media portlet is using List view, and look for the date fields.
thumbnail
michael hamlett, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
thank you for your reply.
i know about what you are referring to but however you are referring to the wrong portlel.
there are 2 portelets
Document and Media - this allows the date to be displayed
Document and Media Display - this does not have the date option

i use the document and media display. it is simpler and more compact for displaying documents on a portal page
it does not have the left side folder navigation either. so it displays better.

thanks for your help
thumbnail
michael hamlett, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
i just added the documents and media portlet to my page and configured to show a folder(2014 documents) on my site.

i then added the documents and media portlet to another page and configured to show a folder(2013 documents)

whats interesting is now both pages show 2013 documents. if i change the portlet on one page, the other page instance of the portlet is changed.

what is the problem.
looks like a major bug.

michael
thumbnail
michael hamlett, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
i see that the Documents and Media Portlet says it can only be added "ONCE"
i thought that meant once per page, not once for the entire portal!

anyone have any thoughts on this portlet and why it can only added once for the entire portal?
is the way it was designed or is this a bug?

msh
thumbnail
Jesse Rao, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 58 Fecha de incorporación: 12/07/10 Mensajes recientes
By default, the Documents and Media portlet is scoped to the current site.

You can change the scope to Global (the entire portal) or to the page to which you added the portlet.

To access the Scope selector, open the Configuration window and click on the Scope tab.
thumbnail
Jesse Rao, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 58 Fecha de incorporación: 12/07/10 Mensajes recientes
Also, the Documents and Media portlet is non-instanceable (only one portlet instance allowed per page).

The Documents and Media Display portlet is instanceable (you can add multiple portlet instances to the page and configure each one differently).
thumbnail
michael hamlett, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
ok
looks like Liferay missed the boat on this portlet as far as I am concerned.
I did the scope and got the portlet added.
now I was using WEBDAV with the documents and media display portlet.
works great. much better than Liferay sync. simply map a drive and all is great.

now I created a 2013Documents folder. works but I cannot find the folder in WebDAV.
tells me where it is under web-2010:8080/WebDAV but no 2013documents shows up in windows explorer.
have you ever tried this?

the easiest solution is for the documents and media display portlet to work correctly and show the dates of the documents
thumbnail
michael hamlett, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
very simply, I will ask the same question.

how in the "documents and media display" portlet do you show the documents upload/creation/modified date in the initial grid shown.
anyone have the ability to fix this portlet and send me the new files?

thanks
thumbnail
Jesse Rao, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 58 Fecha de incorporación: 12/07/10 Mensajes recientes
To make the Documents and Media Display portlet show the create and modified dates, you could use a JSP hook. You'd have examine Liferay's source code to figure out which JSPs or JSP fragments need to be edited and then edit them in your hook project.

For example, if you examine Liferay's portal-web/docroot/html/portlet/document_library_display/view.jsp, you'll find that the following line appears in the search container responsible for displaying documents:

<%@ include file="/html/portlet/document_library/file_entry_columns.jspf" %>

If you open portal-web/docroot/html/portlet/document_library/file_entry_columns.jspf, you'll see how the "name" and "size" search container columns are defined. You can add columns for create date and modified date. For configuring the `fileEntryColumns` to include the create date and modified date, it looks like you'll have to override portal-web/docroot/html/portlet/document_library_display/init.jsp and/or portal-web/docroot/html/portlet/document_library_display/configuration.jsp.

For info on JSP hooks, please see https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/overriding-web-resources-with-hook-liferay-portal-6-2-dev-guide-en

If you only want your JSP hook to take effect in one site, you can use an application adapater: https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/application-adapter-hook-liferay-portal-6-2-dev-guide-en

Hope it helps.
thumbnail
michael hamlett, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
hi thanks for the help.

I have been able to change the configuration of the Documents and Media Display to get Creation date and Modified date in the list of selectable fields.
this part works

to do this, I changed the init.jsp in the document_libary_display folder
String allEntryColumns = defaultEntryColumns + ",modified-date,create-date";

this allows the fields to be selected. I found this code in the Documents and media portlet.

I then started trying to change the File_entry_columns.jspf file in the document_libary folder
I added the code below the SIZE when test code
it works like this because I am simply retrieving the getSize data for creation date and modified date.
it actually displays the new document grid in page that has my documents and media display portlet.
of course it shows the headings for create date and modified date but shows the size data .
I have not found how to code the value= correctly to retrieve the creation date and modify date.

I feel I am so close with very minimal changes done so far.

any help would be appreciated.




<c:when test='<%= fileEntryColumn.equals("size") %>'>
<liferay-ui:search-container-column-text
href="<%= rowHREF %>"
index="<%= j %>"
name="<%= fileEntryColumn %>"
value="<%= TextFormatter.formatStorageSize(latestFileVersion.getSize(), locale) %>"
/>
</c:when>
<c:when test='<%= fileEntryColumn.equals("create-date") %>'>
<liferay-ui:search-container-column-text
href="<%= rowHREF %>"
index="<%= j %>"
name="<%= fileEntryColumn %>"
value="<%= TextFormatter.formatStorageSize(latestFileVersion.getSize(), locale) %>"

/>
</c:when>
<c:when test='<%= fileEntryColumn.equals("modified-date") %>'>
<liferay-ui:search-container-column-text
href="<%= rowHREF %>"
index="<%= j %>"
name="<%= fileEntryColumn %>"
value="<%= TextFormatter.formatStorageSize(latestFileVersion.getSize(), locale) %>"

/>
</c:when>

Archivos adjuntos:

Vishal Patel, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 83 Fecha de incorporación: 24/11/14 Mensajes recientes
Hi,

For creation date use this :

fileEntry.getCreateDate()


For modified date user this :

latestFileVersion.getModifiedDate();


Hope this will help you.
thumbnail
michael hamlett, modificado hace 9 años.

RE: documents and media portlet show date created?

Junior Member Mensajes: 30 Fecha de incorporación: 23/05/13 Mensajes recientes
thanks for the input, but I have already tried this code.
below is the code I use, but when I do all I get on the IE/firefox screen is the portlet title and blank.

if I simply use code for creation date and modified date to retrieve file size I get data to display for creation and modified dates.
so I know all is correct except for how to actually retrieve the date data. apparently that data is not available in this JSP code.
below is the excerpt code from ....

\\web-2010\c$\LifeRay62\liferay0926\liferay-portal-6.2-ce-ga2\tomcat-7.0.42\webapps\ROOT\html\portlet\document_library\file-entry_columns.jspf


<c:when test='<%= fileEntryColumn.equals("size") %>'>
<liferay-ui:search-container-column-text
href="<%= rowHREF %>"
index="<%= j %>"
name="<%= fileEntryColumn %>"
value="<%= TextFormatter.formatStorageSize(latestFileVersion.getSize(), locale) %>"
/>
</c:when>
<c:when test='<%= fileEntryColumn.equals("create-date") %>'>
<liferay-ui:search-container-column-text
href="<%= rowHREF %>"
index="<%= j %>"
name="<%= fileEntryColumn %>"
value="<%= fileEntry.getCreateDate() %>"

/>
</c:when>
<c:when test='<%= fileEntryColumn.equals("modified-date") %>'>
<liferay-ui:search-container-column-text
href="<%= rowHREF %>"
index="<%= j %>"
name="<%= fileEntryColumn %>"
value="<%= latestFileVersion.getModifiedDate() %>"

/>
</c:when>
Marwen Rezgui, modificado hace 7 años.

RE: documents and media portlet show date created?

New Member Mensajes: 9 Fecha de incorporación: 12/02/15 Mensajes recientes
<c:when test='<%= fileEntryColumn.equals("modified-date") %>'>
<liferay-ui:search-container-column-text
href="<%= rowHREF %>"
index="<%= j %>"
name="<%= fileEntryColumn %>"
value="<%= dateFormatDateTime.format(latestFileVersion.getModifiedDate()) %>"
/>
</c:when>