Liferay cms url changes on content change - content-management-system

We've been trying to work with Liferay CMS to create Web Content (liferay terminology). The content is versioned in the sense, each time we change the content and publish it, the version increments.
This has an impact on the URL which is publicly exposed, and we're facing the trouble of changing the URL on content change.
Is there a way of getting a published URL that reflects change in content without changing the URL?

You could use friendly urls in this case. Have a look at this post for some more info.

It doesn't appear that you are able to grab the latest journal content with any invokable URL because it requires a version number to be passed along with the request (otherwise it will just grab the first version not the last).
A work around would be to create a hook plugin that modifies the /journal/view_article_content action path with your custom implementation to return the latest article.
See Liferay's Portal Hook Plugins wiki page on how to create a hook.
Then see Mika's blog post on the specifics of overwriting a struts path.
Good Luck!

Related

deleting page version numbers in form action URLs in wicket for stress testing purposes

I want to stress test a system based on Apache Wicket, using grinder.
So what I did was that I used grinder's TCP Proxy tool to record a test session in my Application and then fed the generated test script to grinder to stress test the system; but we found out the tests aren't carried out successfully.
After a lot of tweaking and debugging, we found out that the problem was within the wicket's URL generation system, where it mixes the page version number into its URLs.
So I searched and found solutions for removing that page version number from the URLs (Like this), and used them and they worked and removed those version numbers from the URLs used in the browser. But then again, the tests didn't work.
So I inspected more and found out that even though the URLs are clean now, the action attribute of forms still use URLs mixed with page version number like this one : ./?4-1.[wicket-path of the form]
So is there anyway to remove these version numbers from form URLs as well? If not, is there any other way to overcome this problem and be able to stress test a wicket web application?
Thanks in advance
I have not used grinder, but I have successfully load-tested my wicket application using JMeter Proxy; without changing Wicket's default version mechanism.
Here is the JMeter step-by-step link for your reference:
https://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
Basically, all I did was running proxy server to accept web requests from the browser to capture the test scenarios. Once done collecting the samples, then change the target host url to whichever server you want to point to (other than your localhost).
Alternatively, there is another load testing tool BlazeMeter (compatible with JMeter). You could add the chrome browser plugin for quick understanding.
Also, you might want to consider mounting your packages to individual urls for 'cleaner' urls. That way, you have set of known urls generated for pages within same package (for example, /reports for all the reports pages within reports package).
Hope this helps!
-Mihir.
You should not ignore/remove the pageId from the urls. If you remove them then you will request a completely new instance of the page, i.e. you will lose any state from the original page.
Instead of using the href when recording you need to use the attribute set (by you!) with org.apache.wicket.settings.DebugSettings#setComponentPathAttributeName(String).
So Grinder/JMeter/Gatling/... should keep track of this special attribute instead of 'href' and later find the link to click by using CSS/XSLT selector.
P.S. If you are not afraid of writing some Scala code then you can take a look at https://github.com/vanillasource/wicket-gatling.

Where is the zend logic for deciding controller?

Ive inherited a project created using Zend.
I need to move the site to a new server, same platform but with a new base URL and domain.
Currently if I go to www.domain.com/index.php the first page of the site will be correctly pulled up. No other pages work.
On the old site, the url convention worked like this: www.domain.us/module/view
So for example the index page could be pulled up by going to www.domain.us/index/index
Im sure this is a simple issue of changing some path or setting (the include path, application path and application environment are dynamically generated and appear to be correct) but I have not been able to find anything.
Where does zend decide what controller to include? Is this url convention of using the subdomain to determine the controller standard and if not any hints as to where this logic might be?

how can I force cdn.rawgit.com use updated file

I am using cdn.rawgit.com to host some of my scripts and css for a project but I cannot refresh it. According to the FAQ:
Requests to cdn.rawgit.com are routed through MaxCDN's super fast content delivery network, and are cached permanently the first time they're loaded. This results in the best performance and reduces load on RawGit and on GitHub, but it means that reloading won't fetch new changes from GitHub.
Does this mean I can never refresh? Or is there a way to force a refresh to use the most recent version?
Yes, permanent means never.
From the documentation:
Since files are not refreshed after the first request, it's best to use a specific tag or commit URL, not a branch URL.
This wouldn't update the file per-se, but it would allow you to specify the new version.
I just created a page with github pages and I hosted the files there. You create a repository, in settings create the page then when you update the files it will automatically do it for you!
Since rawgit.com is shutting down you want to use combinatronics.com it is an alternative for rawgit.com
It also automatically gets the latest file.
It is impossible to refresh a cdn link. But there is a way of doing this.
Instead of specifying the URL directly:
https://github.com/<user>/<repo>/file.txt
you can make it tag specific like this one
https://github.com/<user>/<repo>/1.2/file.txt
So when you change the file, make a draft release and change the tag 1.2 to the tag release you made recently!

how to change index page/wrong url to something customized in playframework

I am using play framework 2.x. I am seeing when the url is not in the ones as specified in route, there will be a index page showing up with all of the available url patterns.
Is there any way to customize this page by changing to a locally built and published play framework? I want to be able to do this in dev mode.
Thank you
The all-available-routes-page is only shown in run/dev mode, not in production. It is there as a help for you as a developer to easily figure out why the url you accessed didn't lead anywhere.
You can override the not found page by adding a Global object with a onHandlerNotFound method to your liking. Read more in the play docs: http://www.playframework.com/documentation/2.2.x/ScalaGlobal

TYPO3 does not resolve url correctly

I'm pretty new to TYPO3 and currently stuck with the following issue:
I copied the templates from another webpage that is currently in business.
When I'm on the startpage of my homepage (www.domain.com) and click on one of the links it contains I always get an error 404. The link that is generated looks like this.
http://www.domain.com/testpage.440.0.html
So I guess something like RealUrl was in use on the webpage that I copied from? Do I understand this right? I don't see that RealUrl is installed though.
However If i manually change this link to
http://www.domain.com/?id=440.0.html
the site is being created.
How does Typo3 know to generate a page when it receives the first version of these two links?
Does not really look like a standard out-of-the-box REAL URL url. That would rather have been /testpage-404.html . So maybe the problem is somewhere else, could be:
simulate static (check if that extension is running). A common mistake is to run real url an simulate static at the same time. If you do not need speaking urls for the moment, just uninstall simulate static.
make sure you add a domain to your shortcut. Use the the list modul and select the root shortcut. Then click create new record, select domain. and enter your domain there. Flush all the caches and try again.
If you'd post your TS Code (of the root shortcut page) here, I could probably tell what's going wrong.
real url configuration typically use .htaccess files.. maybe that file still contains information from the original destination.
check if the root ts contains some baseUrl statement
Which version of TYPO3 are you using?
HTH, but feel free to post more infos.
If your typoscript template is expecting to find realurl and its not installed as a plugin, that could be the cause. You'll need to either install it, or find the settings in the TS template and remove them.
Try the template object browser to look for it (use the template tool, click to the site root, then use the drop down menu in the r/h pane to choose the Template Obect Browser.)
How does Typo3 know to generate a page when
it receives the first version of these two links?
Any page request that it doesn't understand will give a 404 error.