How to get metadata on another jsp? - liferay

I have a custom code for DL Portlet. The content uploaded of in DL folder displayed like this in below image. I want to display the metadata of each content on click of file name on another jsp.
Code used is:
<tr ng-repeat="f in files" ng-hide="f.deleted" class="animate-hide">
<td><a title="{{f.name}}" ng-click="viewFile(f.id);">{{f.name}}</a></td>
<td>{{f.size}}</td>
<td>{{f.version}}</td>
<td>{{f.permission}}</td>
<td>{{f.lastChange}}</td>
<td>{{f.downloadCount}}</td>
<td ng-switch on="f.actions.length > 0">
Any help would be helpful.

Use hook and customize..
when you onclick simple open jsp page in AUI dialog..
Have a look into following link for AUI Dialogs in Liferat
working with AUI Dialog in Liferay

Related

Export Excel in VF Page - Image not getting displayed while using dynamic image URL

I am exporting a VF page as Excel document. While I export excel file, Image cell contains blank data. Below is my VF page code. It is working fine if I am using static url (<img alt="Image" src="https://myorgurl/resource/DefaultProfileImage" />) instead of dynamic Image url.
<apex:page controller="Users_Profile" contentType="application/vnd.ms-excel#Users.xls">
<table border="0" cellspacing="0" cellpadding="0" style="width:100%;">
<thead>
<tr>
<th>Profile Image</th>
<th>Name</th>
<th>City</th>
<th>State</th>
</tr>
</thead>
<tbody>
<apex:repeat value="{!lstUsers}" var="user">
<tr>
<td>
<image alt="Image" src="{!BaseUrl}{!URLFOR($Resource.DefaultProfileImage)}" />
</td>
<td>{!user.Name}</td>
<td>{!user.City__c}</td>
<td>{!user.State__c}</td>
</tr>
</apex:repeat>
</tbody>
</table>
I have tried XML structure instead of HTML tags in VF page to get this resolved but it is not working.
Static resources display OK only if the "browser" has successfully logged in to Salesforce. I mean think about it, there's nothing globally unique in a link like https://eu1.salesforce.com/resources/DefaultProfileImage. Excel fails to download the image. Go to your image's url in private browsing (incognito mode), it will not display OK until you log in. This is similar to email templates that use resources or VF pages generating PDFs with images.
You need to upload the image to Documents (switch to SF Classic UI), tick "externally available image" checkbox and the link that's generated will look like https://instance.content.force.com/servlet/servlet.ImageServer?id=015...&oid=00D.... This is globally unique enough, it contains your org id and document record's id.
You can also upload the image somewhere else (Heroku?), create Site in Salesforce or Community and reference it as a public url like that... Basically anything to make the image available without logging in.
I Agree with Eyescream's answer. In addition to it, you can create 'Externally Available Image' document and upload your image in it. Now you can access your image without login into salesforce.
Use following steps to create a document.
Go to Documents tab in salesforce
Click on 'New Document'
Fill Document Name and other details
Select checkbox 'Externally Available Image'
Upload Image and Click on Save button
You will get Image preview and you can use that image url outside salesforce.

DocuSign Branding Email Merge Field

I have a logo (210 x 73 px) which I uploaded to the primary position under Branding -> Resources in the DocuSign Branding page primary logo position at the DocuSign site.
I have included the logo inside the Email Resource file which makes up my email template, said html:
<table cellpadding="0" cellspacing="0" border="0" align="center" width="520" class="fullWidthWithGapMobile">
<tr>
<td>
<a href="http://www.example.com/">
<img src="[[Data:PresetPath]][[BrandString:LogoPath]]" alt="blah blah blah" />
</a>
</td>
</tr>
Unfortunately the image is not being displayed, but upon inspection with Chrome Developer Tools it appears as though the image path is being set by the merge field [[Data:PresetPath]][[BrandString:LogoPath]] because the html img src is "https://www.docusign.net/Member/Image.aspx?i=logo&l=e0297835-51a2-4148-8d85-b57713876c88".
Furthermore, when I preview the http headers for the image it's getting an HTTP response code of 200. The strange thing is though that when I try to view the response for the image asset inside Developer Tools, there is no response data available.
Additionally, the output of other merge fields appears to be not working, e.g.
style="color:[[BrandString:DialogHeaderColor]];"
The data for [[BrandString:DialogHeaderColor]] is available in the brand resource file which I have downloaded and checked. A sample extract of the Branding XML is here for your convenience:
<Brand>
<BrandId>a81a087c-4R3d-4d90-9zpf-c8399a555e46</BrandId>
<BrandName>Brand X</BrandName>
<CompanyName>Company X</CompanyName>
<BackgroundColor>#00B0B9</BackgroundColor>
<BackgroundTextColor>#333333</BackgroundTextColor>
<DialogHeaderColor>#008C95</DialogHeaderColor>
...
Any assistance that anybody can provide would be greatly appreciated, thank you in advance.
Here's the screen capture of the uploaded logos in the docusign web interface.

Change the subsite Logo URL IN SharePoint

I have created a main site and I have created many subsite under the main site.
When I am in any main page and click on the logo icon, the page redirects to the home page.
But, when I am in any subsite and click on the logo icon, the page redirects to the subsite homepage rather than the main hompage.
I would like to change the navigation URL to the root site. Let me know if I have to edit any masterpage, or is there any common page that will inherit to all the child application.
Thanks
We have 2 ways to do this.
Method 1:
From the Snippet Gallery, copy and paste the default SiteLogo code snippet into your master page into the appropriate place you want it to be displayed.
In the SiteLogo code, search for SharePoint:SPSimpleSiteLink to find the relevant opening and closing tags. Now simply change the tag names to SharePoint:SPLinkButton instead.
Then simply add the attribute NavigateUrl to this tag and set it’s value to “~sitecollection/”.
Example:
Default snippet code:
<!--MS:<SharePoint:SPSimpleSiteLink runat="server" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">-->
...
<!--ME:</SharePoint:SPSimpleSiteLink>-->
Should become this:
<!--MS:<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">-->
...
<!--ME:</SharePoint:SPLinkButton>-->
Ref link
Method 2:
We are going to add custom js in the master page => our site is a publishing site
We find the site logo in the below hierarchy(in a rendered page).
<div id='DeltaSiteLogo'>
<a href='site url'>
<img src='siteIconPath.png/whatever extension'/>
</a>
</div>
So we may try the following for redirecting to the site collection/root web url on click of the logo.
// Add the following js in the '.html' design file that associates with the corresponding masterpage.
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
$("div#DeltaSiteLogo a").attr("href",_spPageContextInfo.siteAbsoluteUrl);
});
//]]>
</script>
It works.
Edit on the SharePoint Designer Master Pages > seattle.master .
Crtl F - Search for DeltaSiteLogo
DEFAULT:
<SharePoint:SPSimpleSiteLink CssClass="ms-siteicon-a" runat="server" id="onetidProjectPropertyTitleGraphic" >
<SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=47" runat="server"/>
</SharePoint:SPSimpleSiteLink>
Change To This (copy & paste the script):
<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">
<SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=47" runat="server"/>
</SharePoint:SPLinkButton>

How to open a modal aspx page from the devexpress aspxpopupcontrol

I have a button which should open a web form from my project in a modal window. How can I achieve that with the devexpress popup control?
Use the Popup Control - Content URL to show another webform in the control. open popup on the button's client click event.
example:
<dx:ASPxPopupControl ID="popup" runat="server" ContentUrl="~/ContentPageWithTextBox.aspx"
Top="100" ClientInstanceName="clientPopup" CloseAction="CloseButton">
<ClientSideEvents Shown="OnShown" />
</dx:ASPxPopupControl>
Check this search Result
Reference:
How to manipulate client-side objects within a ASPxPopupControl with the specified ContentUrl - check example also.
Hope this help...
Here is sample code:
<input id="openBtn" type="button" value="Open popup"
onclick="myPopup.SetContentUrl('http://www.google.com');myPopup.Show();" />
<dx:ASPxPopupControl runat="server" ClientInstanceName="myPopup" Modal="True"
CloseAction="CloseButton" Width="500px" Height="400px"/>
ASPxClientPopupControl members
ASPxPopupControl members
See ASPxPopupControl Online Demos and the Code Central Examples to learn more on how accomplish this task.

How can the width of a SharePoint:FormField be adjusted?

Within MOSS2007, I'm building a custom form (newform2.aspx) for a list, and having a real problem trying to adjust the width of my form fields.
Here is some of the code I'm trying to adjust:
<tr>
<td colspan="3" style="padding-top:5px; padding-bottom:5px; width:100%; ">DescriptionText<br/>
<SharePoint:FormField runat="server" id="ff16{$Pos}" ControlMode="New" FieldName="Jobsite" __designer:bind="{ddwrt:DataBind('i',concat('ff16',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(#ID)),'#Jobsite')}"/>
</td>
</tr>
I've tried setting DisplaySize within the Form:Field control, and it changes within SharePoint Designer, but when I view the actual page, the box always remains at it's default length.
Nothing like solving your own question. ;)
I found that wrapping the FormField control in <div>'s in combination with the DisplaySize attribute gave me the control I needed to format the fields properly.
I tried to insert text input into table and had same trouble.
Add
.ms-long{width:95%;}
as style into PlaceHolderAdditionalPageHead placeholder:
https://gist.githubusercontent.com/Gennady-G/91f045816068d9a38f1133135dc94bae/raw/271eb9012497b57f667b26858e0e7796625803e9/gistfile1.txt
Add this in your custom page. It works for me under SharePoint 2010.
<style type="text/css">.ms-long{width:100%;}</style>"

Resources