wso2am store - Trying to hide the carbon.super tenant - wso2-api-manager

I am trying to set up a multi tenant installation of wso2am.
i have created some new tenants and when visit the public store site, i can see all tenants, including the carbon.super.
Is it possible to hide the super.carbon tenant store?

If you need to hide carbon.super tenant domain please follow the instructions below.
in template.jag(/store/site/themes/fancy/templates/api/tenant-stores-listing/template.jag) paste following before this line
<%for(var i=0;i< tenantDomains.length;i++){
if(tenantDomains[i] != "carbon.super"){
var site = require("/site/conf/site.json");
%>
<a href="<%= encode.forHtmlAttribute(encode.forUri(jagg.getSiteContext() +
"?tenant="+tenantDomains[i])) %>" title="<%=tenantDomains[i]%>">
<li class="thumbnail span3 tenent-thumb">
<center><img src="<%=jagg.getAbsoluteUrl(jagg.getThemeFile("images/tenant-store.png"))%>" alt="">
<h3><%=tenantDomains[i]%></h3>
<span>Visit Store</span>
</center></a></li><%}}%>
Then it will filter out carbon.super from main store view. You can do this change using sub theme and override default page. To do that please follow this article about API Manager sub themes.

Related

retrieving different renditions created by DAM Adobe CQ

This might be simple question.
How to get different renditions of an image in jsp ?
For example
<img src"/content/dam/travel/Desert.png" />
image has 48x48 and 140x100 etc renditions. How to access these in the component jsp ?
I appreciate the help!
Thank you,
Sri
You can do next on jsp page of your component:
<%#include file="/libs/foundation/global.jsp" %>
<%
ResourceResolver resolver = slingRequest.getResourceResolver();
AssetManager assetManager = resolver.adaptTo(AssetManager.class);
Asset asset = assetManager.getAsset("/content/dam/travel/Desert.png");
List<Rendition> renditionList = asset.getRenditions();
//Now iterate through the renditionList to get the absolute path of each renditon for the specified asset
eachRendition.getPath();
%>
If you open an asset in the DAM, you can see the renditions on the right hand side. If you double click them, they will open in a new tab/window where you can see the direct url. In your case I'd guess the urls would be:
<img src"/content/dam/travel/Desert.png/jcr:content/renditions/cq5dam.thumbnail.48.48.png" />
<img src"/content/dam/travel/Desert.png/jcr:content/renditions/cq5dam.thumbnail.140.00.png" />
If you want custom rendition :
Go on http://<author_ip>:4502/cf#/conf/global/settings/workflow/models/dam/update_asset.html
Double click on Process Thumbnails.
In Thumbnails section you can see default rendition :
140:100:false
48:48:false
319:319:false
Below, you can add new rendition on Add Item .
Do not forget to save after editing.

Hide Menu option based on Role Visual Studio 2013 asp.net web site

When creating a standard asp.net web site with vs2013 I notice that no site map is used and I also note that the menu created is a new nav bar class.
You get this as a default:
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a runat="server" href="~/">Home</a></li>
<li><a runat="server" href="~/About">About</a></li>
<li><a runat="server" href="~/Contact">Contact</a></li>
<li><a runat="server" href="~/Upload">Upload Files</a></li>
<li><a runat="server" href="~/Portal/UploadCust">Customer Portal</a></li>
</ul>
So, no site map is used here. And the menu system in asp.net NOW does not use the site.map. What is the suggested approach NOW THAT NO SITEMAP is used in these templates to hide a given menu based on role?
Is the suggestion to create a sitemap by hand? and then simply enable trimming as was done in the past? I have role permissions working fine (sql providers) but I am perplexed why this new menu system does not support nor have anything to do with site maps? I am simply looking to hide menu options based on role membership but am at a loss as to why the default menu systems don't use sitemap anymore? Right now users just get a 404 error.
So is some suggested way to hide menu options in above or is it still best to adopt a site map and enable trimming? This being the case then must I drop use of the above new nav bar class?
edit:my current solution is to add a id like this
"<a id="PortalLink" runat="server" href="~/Portal/UploadCust">Customer Portal</a>
And then in the web site on-load in VB, I use this:
If Roles.IsUserInRole("Portal") Then
Me.PortalLink.Visible = True
Else
Me.PortalLink.Visible = False
End If

Unable to access ASP.NET Page inside a folder

I am using ASP.NET/C#.
In my menu I have this li item
<li>Update Deposit Interest</li>
But when I try to click on the a tag it just gives me this error
Cannot use a leading .. to exit above the top directory.
Can anyone just point me as to what might be missing here?
Any suggestions are welcome.
The problem could be caused by the DepositInterest.aspx page that you are navigating to. Are there any javascript/CSS files liked on that page or in the master page? If so you might want to check out that they are linked correctly.
Cannot use a leading .. to exit above the top directory
http://forums.asp.net/t/1019849.aspx
link should starts with tilde which represent root of your site or mention your complete address
<li><a href="~/Deposits/DepositsInterest.aspx" runat="server" >Update Deposit Interest</a></li>
// or type complete address
<li>Update Deposit Interest</li>
// or use asp.net hyperlink
<li> <asp:HyperLink id="hl1"
NavigateUrl="~/Deposits/DepositsInterest.aspx"
Text="Hyperlink"
Target="_new"
runat="server"/> </li>
Updated answer:
If you are adding hyperlinks dynamically then add them as:
MenuItem mi = new MenuItem();
mi.NavigateUrl = "~/Deposits/DepositsInterest.aspx";
mi.Text = "MY hyperlink";
Menu1.Items.Add(mi);
Menu1.DataBind();

ASP.NET localization translating HTML Content

I am localizing an ASP.NET site using automatic feature , where it creates a local resource file and adds the meta keyword to asp.net controls. However I have a lot of HTML like below
<h2> Welcome to our page"</h2>
<li> Option one </li>
Is there a way to get these automatically translated using the automatic localize utility ?
I tried adding the runat="server" for these tags but to no avail.
Also instead of localizing page by page is there a way to localize bulk - it a directory or a site at one go
thanks
You need to use Localize control for static text - for example,
<h2>
<asp:Localize runat=server ID="WelcomeMessage"
Text="Welcome to our page" meta:resourcekey="WelcomeMessage" />
</h2>
Alternatively,
<h2>
<asp:Localize runat=server ID="WelcomeMessage"
Text="<%$ Resources:WebResources, WelcomeMessage %>" />
</h2>
You can also use syntax such as
<h2><%= Resources.WebResources.WelcomeMessage %></h2>
where Resources.WebResources is strongly typed resource class generated by Visual Studio resource generator. For across page resources, you can create global resources and then refer then using syntax as shown above (meta key will not work for global resources).
See MSDN for more information.

How to WelCome control in Webpart code?

I need to place a webpart on the page. The webpart need to change Welcome control title. I need to change "WelCome UserName" to "UserName".
I tried http://www.wictorwilen.se/Post/Having-fun-with-the-SharePoint-Welcomeascx-control.aspx , But it did not worked in Webpart. If anybody have idea to change this control. Please share with me.
That article is a pretty comprehensive walkthrough of one way to do this - perhaps your focus should be to determine where you have gone wrong in the implementation of it?
An alternative (hacky) method would be to put some javscript into the page using a CEWP or modifying the master page that will search for the welcome string and remove it.
Hint - don't search for "Welcome", search for its container which looks a little like this (some attributes stripped out for clarity
<span title="Open Menu">
<div id="zz7_Menu_t" ...
class="ms-SPLink ms-SpLinkButtonInActive" >
<a accesskey="L" id="zz7_Menu" ... href="#" serverclientid="zz7_Menu"
menutokenvalues="MENUCLIENTID=zz7_Menu,
TEMPLATECLIENTID=zz3_ID_PersonalActionMenu">
Welcome UserName
</a>
</div>
</span>
Some links to get you started
http://www.dlocc.com/articles/style-a-page-using-the-content-editor-web-part-and-css/
http://www.cleverworkarounds.com/2008/02/28/more-sharepoint-branding-customisation-using-javascript-part-2/
http://blog.pathtosharepoint.com/2008/08/10/the-content-editor-web-part/

Resources