Linking to a Page that "contains" a specific Web Content Article in Liferay 6 - portlet

I'm building a Portlet for a site powered by Liferay EE 6.0 SP1 that will suggest related or otherwise interesting content depending on what the user is currently looking at.
For example, suppose the user is on a Page that contains a Web Content Display portlet that is displaying Web Content Article 5. My portlet will contain HTML links to the Pages where the user can view Web Content Articles 6 and 7 (which contain content that is determined to be similar to the content in Web Content 5).
The problem comes in because I don't want my portlet to display HTML links to Web Content Articles 6 and 7 (assuming such a concept is even valid), I want my portlet to display links to the Pages on which those items are displayed (i.e., links to the Pages that contain Web Content Display portlets configured to show those Web Content Articles).
Is there a way to:
Associate a Web Content Article with a Page so that if I have the former, I can fetch the latter?
Or, determine the page(s) that contain portlets that display a Web Content Article?
Alternatively, if there were a way to get all portlet instances associated with a particular page, that might lead to a solution as well.

One approach to this problem appears to be to add a "Link to Page" control to the Web Content Article's Structure. Content managers can use this to create many-to-one relationships between Web Content Articles and Pages.
This solution is problematic, though, because there is no constraint on what page is selected when the Web Content is edited.
For example, a content manager might create a Web Content Article entitled "Our History", but specify the "Products" page as the value of that Article's "Link to Page" control. When the related content portlet renders the "Our History" Article, it will create a hyperlink to the "Products" page which in this case does not display the "Our History" Article anywhere.
Arguably, this could be considered a feature, but perhaps there is a better way to do it.

I afraid this is a feature that does not exist yet on Liferay. At least on Liferay pages there is an feature request on the very same topic. Dates on the discussion are on March 2011 so probably something is coming soon :)

Another solution that we are currently considering is to create a custom view mode for the portal (i.e., "VIEW", "PRINT", etc.) called "XML". When the portal detects that the browser is requesting the XML mode (similarly to how Sitecore detects which device to use), it bypasses the theme, and all portlets that support this XML mode would render their content in XML format.
The output might look something like this:
<?xml version="1.0" encoding="utf-8" ?>
<portal>
<portlet id="..." title="..." ...>
<JournalArticle>
<uuid_>...</uuid_>
...
</JournalArticle>
...
</portlet>
</portal>
A periodic process would then crawl the site in XML mode and update a Lucene index.
The obvious problem with this approach is that it requires that every portlet we use on the site be custom-developed. For various reasons (some would call it an over-ambitious creative department; I call it a significantly deficient existing feature set), we might end up having to go this route anyway.

Related

What is a component, template and page in AEM/CQ

Please give me an overview of what a component, page, page component and template is in AEM. How are they related to each other. Please give example if possible.
Suggest any site to start as a beginner.
Your are mixing up technical and non-technical terms a bit. So I try to explain it in two ways: From an abstract, non-technical level, and from a technical point of view.
Abstract, non-technical explanation
The content of your AEM project mostly contains pages. A page is tied to an URL like www.example.com/products/teddybear. When a user opens this page he sees the content of the page. An image of the teddy bear, some descriptive text but also the header and footer of your page. This is where components come in. Content like the image, the text, the header and footer are all different components on that page.
Pages are composed of components.
Technical explanation
When developers try to implement pages and components they will need to create page templates, page components and components.
Page templates are basically XML files that define a few things about the page. For example the title of the page (e.g. "Content Page", "News Page", etc.) that is shown in the page creation dialog, a description, allowed parent pages (templates), allowed child pages (templates) and paths in your content where this page template can be used. Besides those things you can also define the basic structure of the page. Add a parsys, already add components to this parsys so those components are "hard wired" into every page you create.
Page components are the "implementation" of page templates. Here you can add the HTML for that page.
Components are the building blocks of pages. A component usually contains a JSP or HTML file that contains the HTML markup and maybe some business logic for that component.
Obviously, there are a lot more things to consider. But this should give you a basic overview over the relationship between all of those things.
Links:
Page Template documentation AEM 6.2
Component documentation AEM 6.2

Entity Property in URL and SEO

I have coded my ASP.NET MVC application in a way that allows stored entities to be retrieved via a friendly name in the URL, for example:
www.mysite.com/artists/james-brown/songs
Where james-brown is a URL friendly string stored on my Artist entity.
Now imagine I add an artist that no one has heard of before, and no one ever navigated to that artist's songs page.
How would Google/Yahoo/Other Search Engines know that my site does indeed have songs for that unknown artist.
Do I create a sitemap and maintain it through code as I add / remove artists?
There are few defined known ways to make the new links visible to search engine world.
XML and HTML Sitemap:
Add it to sitemap and submit it through webmaster tools.
HTML sitemaps are another way to achieve it. If your site has footer sitemap, you can add it to them.
Internal Links
Create internal links from your high ranking pages or highly crawled pages to the new pages. Google and other search engines tend to crawl pages where the content changes frequently. So if you have a refreshed content pages, try adding it to those pages and chances are high for those pages to be discovered quickly.
External Links
Create links from external blogs, company blogs and sites like pagetube.org which can help it to be discovered.
Yeah just add them to either sitemap, internal or even external links

Merge Orchard Blog Into Existing Website

I'm trying to determine the best way to "merge" my orchard blog into my existing website. Currently the blog accessed outside the site.
I threw together a quick view in my MVC site that just loads the blog into an iframe. Any other ideas?
The blog is tuned up with a great theme and tons of mods & styling that matches my main site design to a T.
On the home page of my site, I'm using the RSS feed to output a list of the last 3 blog posts. My idea is that the user will click on a blog post link and go directly the view that hosts the blog in the inline frame.
I guess the only variable that I haven't handled yet is how to load up the correct page in the blog based on the link that the user clicked on my main site home page.
I've read other posts on this subject and it seems like the solution that is always offered is to merge all the code from the main website into Orchard which seems insane...I have a very large auction based website, taking all that logic & content and putting into Orchard is not an option.
Hope all that makes sense, thanks for the input. I can't think it would be a huge issue to "seamless" integrate my blog with my MVC site.
Orchard was never designed to be integrated into an existing application, so something like what you've done is what you have to do. The iframe however has a number of problems, such as its fixed size, and awkward navigation. It's better to integrate data than markup. It's now easy to build WebAPI controllers to expose Orchard data. You could consume that data in your application and render it there. That enables you to manipulate the data before rendering, which is of course easier than manipulating rendered HTML. For example, you can build your own link URLs so that clicking on a post's title goes to an action on your site that fetches the post contents rather than the Orchard post URL.
One final comment: It is a little weird that an auction website would need to integrate a blog in the middle of its own rendering. Shouldn't the blog be a separate section of the site?

problem getting my domain redirect to update .html files in dropbox after used iweb SEO TOOL

So I created a nice 6 page website hutchspropertyandtree.co.nr using freedomain.co.nr via dropbox public folder. Everything was working and updating properly until i updated with iwebs SEO TOOL. I added meta and title tags as well as description etc... PROBLEM is that even though my .html files in dropbox are correct and show all new code and tags. when i open up my domain hutchspropertyandtree.co.nr it doesnt show any of my recent seo tool updates.
im thinking that the cheap domainname from .co.nr is the problem? Is it possible that the default tags and titles and keywords entered into the co.nr website creation boxs are overwriting the newer ones in the html within my dropbox?
But still doesnt explain why a stat counter code and google analytics code in the footer and header respectively still do not show up when i view source in browser.
PLEASE PLEASE HELP.
It's because the page at hutchspropertyandtree.co.nr uses a frame to show the content from another location. The meta information comes from the page with the frame, not the page in the frame. You should be able to see the content of the frame using an inspector (comes with all browsers these days) or "View frame source", if your browser does that.
Note that any search engine hits to your pages will link to the dropbox URL, not the frame page (that has essentially no content from the viewpoint of a search engine). If you want search engine results to show up under that domain, you'll have to get hosting that lets you point a domain directly to it.

gwt multi-page application

I have a multipage application which needs to manually switched from one page to another. could it be done in GWT since it is targeted towards single page application. I am learning from the Google code and online forums but could not find any application which had multi-pages not linked by a common entry-point. Any ideas?
GWT has support for "pages" within application via URL fragment identifier (FI), i.e. http://www.yourhost.vom/main#pagename, where "pagename" is a fragment identifier representing a "page" within your app.
This "pages" (note that browser never really reloads the page, so GWT app stays the same), have full history support and are bookmarkable.
NOTE: throughout GWT docs fragment identifier is sometimes referred to as place token or history token.
Enable history support by adding an iframe to your host page:
<iframe src="javascript:''"
id="__gwt_historyFrame"
style="width:0;height:0;border:0">
</iframe>
Register a ValueChangeHandler to be notified when FI (page) changes: History.addValueChangeHandler(..). Within this handler you put a logic that displays the new page.
Go to a particular page by calling History.newItem("newpage") (without #)
You can even pass "parameters" to page, by dividing fragment identifier into sub parts: for example "#edit/user4". Just parse this FI, invoke code that shows edit page and pass "user4" to it. You can use any character to divide FI into a "page" part and "parameter" part (I use "/" here). To see this in real life: open a message in gmail and look at URL.
While you can use GWT to switch pages, the resulting code will be slow and suboptimal, with the pages taking longer to load.