I made a hook from DocumentAndMedia. In portal.properties i wrote com.liferay.portlet.documentlibrary.action.EditFileEntryAction=com.mycompany.acciones.Test so when i see the file entry view i can get the fileentry. I want to cast FileEntry to org.apache.chemistry.opencmis.client.runtime.DocumentImpl document from the fileEntry.getModel() to get some extra properties but an exception is throw.

Test Action Class

```
package com.mycompany.acciones;

import javax.portlet.*;
import org.apache.chemistry.opencmis.client.runtime.*;
import com.liferay.portal.kernel.repository.model.*;
import com.liferay.portal.kernel.struts.*;
import com.liferay.portal.kernel.util.*;

public class Test extends BaseStrutsPortletAction{

    public void processAction(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

        originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig, actionRequest, actionResponse);
    }

    @Override
    public String render(StrutsPortletAction originalStrutsPortletAction,PortletConfig portletConfig,RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {

        String ret = originalStrutsPortletAction.render(null, portletConfig, renderRequest, renderResponse);
        renderRequest.setAttribute(WebKeys.PORTLET_DECORATE, Boolean.TRUE);

        FileEntry fileEntry = (FileEntry)renderRequest.getAttribute("DOCUMENT_LIBRARY_FILE_ENTRY"); 

        // Exception is throws here
        DocumentImpl doc = (DocumentImpl)fileEntry.getModel();      

        String propertyName = doc.getProperties().get(0).getDisplayName();
        String propertyvalue = doc.getProperties().get(0).getValue();

        String propertyName2 = doc.getProperties().get(1).getDisplayName();
        String propertyvalue2 = doc.getProperties().get(1).getValue();

        return ret;
    }
}

```

Stacktrace

```
17:33:52,796 ERROR [http-bio-8080-exec-398][render_portlet_jsp:154] java.lang.ClassCastException: org.apache.chemistry.opencmis.client.runtime.DocumentImpl cannot be cast to org.apache.chemistry.opencmis.client.runtime.DocumentImpl
    at com.mycompany.acciones.Test.render(Test.java:31)
    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
    at com.liferay.portal.struts.PortletActionAdapter.render(PortletActionAdapter.java:74)
    at com.liferay.portal.struts.PortletAction.execute(PortletAction.java:111)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at com.liferay.portal.struts.PortletRequestProcessor.processActionPerform(PortletRequestProcessor.java:441)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:224)
    at com.liferay.portlet.StrutsPortlet.include(StrutsPortlet.java:274)
    at com.liferay.portlet.StrutsPortlet.doView(StrutsPortlet.java:153)
    at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:218)
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:548)
    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:607)
    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:359)
    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1207)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

```