I have created a lightning app page with type Record Page and override default Opportunities page. I have added a new tab to it's content and added a visualforce page as it component. Please see the image below.
The visualforce page contains codes to display documents and download link. The code is as below.
<apex:page controller="stageDocus">
<apex:panelGrid columns="5" id="theGrid" width="80%" style="margin:30px auto; text-align:center;">
<apex:repeat var="sld" value="{!docs}">
<div style="float:left; width:20%;">
<apex:panelGroup id="theGroup1">
<apex:image width="100%" id="theImage1" value="http://icons.iconarchive.com/icons/alecive/flatwoken/512/Apps-Google-Drive-Slides-icon.png"/>
<apex:outputLink value="/servlet/servlet.FileDownload?file={!sld.Id}" target="_blank" id="theLink1">{!sld.Folder.Name}/{!sld.Name}</apex:outputLink>
</apex:panelGroup>
</div>
</apex:repeat>
</apex:panelGrid>
</apex:page>
The page is working fine, if I display all the documents and when the folder name is given hard coded.
Our goal is to display the documents under the 'Folder' with name same as the 'StageName' of the opportunity under this tab.
The apex class code I used is a below
public class stageDocus
{
public String currentRecordId {get;set;}
public Opportunity Oppo{get;set;}
currentRecordId = this. ApexPages.currentPage().getParameters().get('Id');
Oppo = [SELECT Id, Name, StageName, Amount FROM Opportunity WHERE Id = :currentRecordId];
public List<Document> getdocs()
{
List<Document> doc = [SELECT Id, Name, FolderId, Folder.Name FROM Document WHERE Folder.Name like :Oppo.StageName];
return doc;
}
}
This is returning error
unexpected token: '='
How can I access the Opportunity Id or Stage Name inside this controller? Please help me. I am stuck.