Recreating Liferay Site Pages - liferay

we have several users that have personal public pages.
What we want to do is to recreate their personal pages because they have been assigned the wrong ones (using the wrong Site Template).
So we want to :
1) Delete the old User pages
2) Create them again using a Site Template.
In the end the users should have the "new" Pages.
Is there any way to do this programmatically ?
I have posted the same question in the liferay message board:
https://web.liferay.com/de/community/forums/-/message_boards/message/87001817

While you might need some adoption to API changes, the old and ancient SevenCogs code (part of Liferay CE up to 6.0 AFAIK) might help you doing so. The principles still hold well, and the last adoption has been made by James Falkner to 6.1 - to detect & fix the differences to 6.2 shouldn't be that hard. Alternatively look up the original sevencogs-hook implementation, which is extremely well readable (a lot of code, but linear, no complexity: It's a single script that runs exactly once. No conditionals, top-to-bottom)

Related

How can we override liferay module in liferay7?

I am very new to liferay 7 ,actually we are migrating liferay 6.2 to liferay-7 ,in the 6.2 we are using ext to override the action class but in the liferay-7 I am getting some cofusion,could you please help me out.
The main theme of my ext is : whenever a new role getting created in an organization from the control panel, we need to store the role information and organization information in our custom table for that we have overriden EditRoleAction.java in LR6.2 so same thing we are trying to achieve in LR7.
Action class in Liferay 6.2 :
Portal path :
D:\Liferay6.2workspace\portal\portal-impl\src\com\liferay\portlet\rolesadmin\action\EditRoleAction.java
Ext Path:
CutomRoles-ext/docroot/WEB-INF/ext-impl/src/com/liferay/portlet/rolesadmin/action/EditRoleAction.java
Action class in Liferay 7.0GA4 :
D:\Liferay7GA4\portal\modules\apps\foundation\roles\roles-admin-web\src\main\java\com\liferay\roles\admin\web\internal\portlet*RolesAdminPortlet.java*
It really sounds like overriding the Action is not the right place to go. Look up ServiceWrappers - these will run on the business layer, and you can add additional code to (from memory) RoleLocalService.addRole(...) and other related methods.
Ext was never necessary for this purpose and shouldn't have been used in the first place. In fact, with the use of ext you deliberately make maintenance and upgrades a lot harder than when you go the regular plugin route. And with Liferay 7 and DXP the use of ext should be the extremely rare absolute exception to the rule. In fact, it's just now being reintroduced after being absent so far (because in a few rare exceptional cases it's still the only way). However, it's safe to assume that you don't need it.
Now that the description in the comments to this answer goes much further than the description in the question: You might need some portlet-level customizations as well. For this: Identify where the portlet is currently implemented (e.g. identify the module) and override its actions (there's a good chance that this article can help) and potentially also the UI.
And yet another alternative: You might be able to achieve the same by using Teams in the organization's site: They behave almost like roles but are only available to a single site (no organization though, but you state that your organizations have sites anyway)

Using Liferay for an already developed project

First of all, let me tell you what I am or my company is intended to do. We have already developed a project using Java, JSP and Servlet. We want it to integrate with Liferay so that we can change logo, css, images, themes or any other UI related component at run time using Liferay admin panel. But backend should be what we have developed.
In short, the UI of our project is controlled by Liferay, but control of data displayed on UI or submitted from UI should be from our developed backend code.
Now I have a few questions regarding above said approach of fulfilling the requirement:
What we are trying to do is possible?
Is this approach recommendable for what we intended to do?
Or do we need to develop our project from scratch to fit into Liferay? Like developing portlets and deploying in Liferay or other approach that has been given in Liferay documentation.
What about database integration? We have around 15 columns/fields in user table in database of our project which is completely different from that of Liferay's user table.
Liferay is a very new for us. We have checked the documentation section of Liferay but still few things like above said requirements and its implementation is not clear. Also, we would like to know in what scenarios/requirements Liferay is useful.
Ok let me try to answer your question point-wise and I would answer your last question first, which should automatically clear other questions:
Q. Also, we would like to know in what scenarios/requirements Liferay is useful.
This can have a very wide answer, but I have made it shorter for you:
If your site is content heavy and not data heavy then go for Portal
If you plan to use only a single web-application in a portal then I would suggest standalone custom developed web-application is much better.
I agree liferay portal will give you lot of things out-of-box like Single Sign-on, authorization, authentication, friendly-url and page creation and also lot of applications like Blogs, Wikis, Document library, some social networking apps etc. But think about it, do you really need all this? if not, then this is overkill
Here are some really nice links to better understand a portal's usage:
When to use a portal
Why to use portal technology
liferay tag wiki: It has nice description as to what is liferay and it also contains relevant links to Admin guide which will tell you what all functionalities liferay has and how you can manage it.
So still if you find your other questions unanswered, read-on ...
Q1. What we are trying to do is possible?
Nope. Portlet technology is different from Servlet technology. Liferay (or anyother portal) does not provide a way (atleast a simple one) to integrate servlets that would render pages inside a portal. For eg: Since with servlet you define URL mappings for a particular servlets before-hand in a web.xml but in a portal the URLs are generated by the Portlet Container. So portals work with portlets and not Servlets.
Q2. Is this approach recommendable for what we intended to do?
Nope. As I already explained in Q1.
Q3. Or do we need to develop our project from scratch to fit into Liferay? Like developing portlets and deploying in Liferay or other approach that has been given in Liferay documentation.
If you want to go the liferay way then Yes.
If you want to build applications that talk to your custom tables then portlets are the way to go.
Q4. What about database integration? We have around 15 columns/fields in user table in database of our project which is completely different from that of Liferay's user table.
If you go with Liferay. In this scenario you can create a combination of liferay-hook & portlet (may be using service-builder) to customize liferay's User creation mechanism and there by store data in both Liferay's User table and your custom tables.
Liferay's permission system is really fine-grained so you can also benefit from this system and put permission even on the data level.
In conclusion I would say:
Everything boils down to what your requirements are and what resources you have. And sometimes what future requirements you can have.
Note: All the terms used in this answer which are specific to liferay (like service-builder, hook etc) are explained in the liferay tag wiki.
Hope this helps. If you would like to know anything specific I would gladly update my answer.

Creating a new CMS, importing content from ASP - Umbraco or Sharepoint?

I'm working on a project to create a CMS, which will entail importing a lot of existing content, most of which is static, but in ASP (so they're not all just pure HTML, there are includes and sometimes other server-side code).
We're considering using Umbraco or Sharepoint (2010) for managing the external content, which currently comprises a few thousand pages. I've read this and I think there are good cases to be made for both sides. However, while I've read about the features of adding and managing content, I have not seen anything regarding the importing of existing content into either. And since we have a lot of content that will have to be imported, the ability of either CMS to facilitate this will be a major factor in the decision.
I'd like to know if anyone has any experience trying to import a lot of content into either Umbraco or Sharepoint, or if you have any idea how I might go about doing that. Is it easy for either? Are there plug-ins I can find, or scripts I can write? Or will I pretty much have to import each existing file manually with either CMS?
If you have experience with Umbraco or Sharepoint and have any ideas about this, I would value your input and/or recommendations.
Are you just using SharePoint as a CMS? IMHO whilst SharePoint can be used as a CMS that is not where its real strengths lie - its more suited to Intranet/Portals/Collaboration tools.
I am sure someone will be on in a minute with links to SharePoint showcase sites but the disadvantages :-
Its expensive (even with 'free' WSS
version you need Internet connector
license) + windows licenses.
The
markup can be fairly 'heavy' and
difficult to customise (tables galore in 2007
and javascript files measured in
hundreds of kb)
Questionable cross
browser functionality in 2007
Relatively poor 'website' features e.g. blogging engine as compared to some dedicated CMS's
Basically - if all you are after is a CMS then perhaps there are better options?
(I should say that I think that in an Intranet/Portal setting SharePoint is brilliant, frustrating sometimes for sure, but brilliant).
I cannot speak for SharePoint but I have had to import content from a MS Content Management Server 2002 database into Umbraco.
Umbraco is very extensible and I was able to build a dashboard component that allowed me to do this.
It effectively examined the MSCMS channels and postings and recreated the structure using Umbraco document types. It was very much working at the API level but I would say the learning curve wasn't too steep and Umbraco documentation has come on leaps and bounds over the last two years.
There is also the possiblity that someone has already written a package to do what you need to do so it is worth checking out the community at http://our.umbraco.org.
Hi I don't know Sharepoint but I build a package for Umbraco which can help you importing data from other systems into Umbraco. In the way you dewscribe it you could export your site to a file format using the HTML Agility pack and then use my tool www.cmsimport.com to import the data into Umbraco.
Hope this helps,
Richard
I haven't done any Sharepoint but I've imported content into Umbraco and found it very flexible.
I imported data from a database and created doctypes and custom datatypes in Umbraco then created and populated umbraco documents with code like this:
using umbraco.cms.businesslogic.web;
...
DocumentType dt = DocumentType.GetByAlias("myDoc");
Document doc = Document.MakeNew(name, dt, user, parentId);
doc.getProperty("whatever").Value = getWhateverXML();
doc.Save();

Objective reasons for using a wiki tool over Sharepoint? [duplicate]

This question already has answers here:
Developer Documentation: Sharepoint Document Management vs. ScrewTurn Wiki [closed]
(11 answers)
Closed 7 years ago.
Duplicate
Developer Documentation: Sharepoint Document Management vs. ScrewTurn Wiki
I have been tasked with picking a wiki tool for a development organization, comprised of several different development teams. Sharepoint is installed and upper management would prefer this to be used, but in the past it has only used when PMs are forced to use it. None of the developers will update it with content that needs to be shared. I developed in Sharepoint and I liked it, so I have nothing against it. But for this to work I need something I can get everyone using, so Sharepoint will not work.
Step one is to convince management why Sharepoint will not work. We need the typical wiki features:
WYSIWYG, Clean interface, Easy to use, Attach Files to pages, Support for groups of users, Open source, Hosted Locally. (Maybe others I am not considering now?)
Can anyone provide a list of objective reasons why Sharepoint is not the solution we can use to take our first step?
There are many such products out there so step 2 should be easier.
SharePoint is the exact opposite of a wiki: A wiki is lightweight, easy to use, obvious, quick, doesn't get in the way.
To elaborate: A wiki allows your to jot down an idea quickly and moving details to the next page. In SP, people start to create processes, editing rights, workflows.
Wikis are designed to not get in the way. SP is designed to prevent you from doing "something bad"; whatever that might be. Wikis are driven by the idea that brainstorming works in open space while SP is driven by FUD: Who can see this information? Can it be used against me? How can I prevent someone to see/edit something?
Note: This is not a critique of SP per se; it's just how it used in most organizations. If you look at the security settings and edit rights, you sometimes feel like the workers of the company must all have been inmates in some high-profile prison (or should be).
I have absolutely no sharepoint-foo at all, but the sharepoint setup by IT at my employer has a wiki that we can use for documentation. Wouldn't that be good enough? Works ok-ish in firefox on mac, so I'm a happy camper.
SharePoint is best when using many of it's features (eg DM, WCM, workflow, collaberation etc) - you get a lot of it's benefits from the synergy of using all these things together with a common interface.
In any one area though, it's far from the 'best of breed' application - so, if you want a product for a specific job (eg a wiki), SharePoint isn't the most fully-featured/easy-to-use/delete-as-applicable product to be using - there will be products that do that (single) job far better.
You could also try looking at this question to see others experiences with SharePoint wiki's
I have used MediaWiki, Instiki and Sharepoint. Sharepoint does not work correctly with firefox on purpose. Its wiki functionality is an after thought. All kinds of additional features nobody use. But it does appeal to managers.
Instiki can be up and running in less than a minute and MediaWiki has everything you could need. Sharepoint annoyed most people on our team so nobody wanted to use it which meant a lot of knowledge was lost.
Which version of SharePoint are you using WSS 3.0/MOSS 2007 includes both wiki and blog functionality.
Although the SharePoint wiki isn't as feature-rich as most, the fact is that if your developers would not update a SharePoint wiki, chances are that they would not update any other kind, either.
I recommend creating a SharePoint wiki, and then actually reading the starting page, where it gives the definition of wikiwiki. I recommend only using a wiki (of any kind) for documents that can be written quickly, so that developers can get back to developing as soon as possible. Let the structure and accuracy grow over time. Just get the facts into the wiki quickly.
Wikis offer workflows, Document management and more too. I would disagree with those who say you can't do this in a wiki. Check out Confluence by Atlassian

What are the best methods to ensure our SharePoint implementation is accessible?

Are there any blogs, guides, checklists, or controls we should be using to ensure our SharePoint implementation is accessible?
Preferrably to the W3C double A standard, or as close to that as we can get.
We're implementing an extranet solution.
This study has already been funded by Microsoft, and unfortunately the results only seem to be online in a Word Document.
The document is hosted on this blog:
http://blog.mastykarz.nl/best-practices-for-developing-accessible-web-sites-in-microsoft-office-sharepoint-server-2007/
And the path to the document is here:
http://go.microsoft.com/fwlink/?LinkId=121877
I'm unsure on whether it would be a good thing to copy the contents of that into here to fully answer the question in a way that will be indexed by search engines, but I'll play safe as it's not my content.
The best place to start is the Accessibility Kit for Sharepoint. With this, you may reach single A standard, but in my experience, you will find it very tough to reach AA.
Microsoft didn't factor in accessibility in Sharepoint, and even 2007 suffers from a huge overdependence on table layout.
Good luck!
How are you deploying the implementation? Is it as an Intranet, or, is it as a public facing website.
I think one of the first rules is to be extremely selective with the use of out of the box web parts. Many of the web-parts I looked at weren't compliant even on a basic level.
Andrew
The best way is to run checks as you develop so you know where your pain points are.
The next step maybe to start with a minimal masterpage so you can choose what elements are presented to the user.
More advanced you can override the render methods to remove or change bits of the page that are not compliant with your checks. EG changing the case of tags (XHTML does not like all caps)
A bit more in this guide.
http://techtalkpt.wordpress.com/2008/06/18/building-accessible-sharepoint-sites-part-1/
http://techtalkpt.wordpress.com/2008/08/07/building-accessible-sharepoint-sites-part-2/
I recently read the MOSS book by Andrew Connell (www.andrewconnell.com) and it has a chapter dedicated to accessibility and SharePoint sites.
Simply put SharePoint sites are very difficult to generate W3C AAA standards, but the Accessibility Kit is one of the best starting points.
Stronly recommend his book for this chapter (http://www.amazon.com/dp/0470224754?tag=andrewconnell-20&camp=14573&creative=327641&linkCode=as1&creativeASIN=0470224754&adid=18S6FKQJR5FZK56WHH6A&)
It depends how much of Sharepoint out of the box you are intending to use. In implementing our public facing site we managed to achieve AA compliance, although the amount of custom development required has raised questions over the benefits we are actually gaining from using Sharepoint in the first place.
A few pointers:
We made heavy use of SPQuery/SPSiteDataQuery to render site data to screen using xslt which gave us full control over the output. I found this link helpful:
http://blog.thekid.me.uk/archive/2007/02/25/xml-results-using-spsitedataquery-in-sharepoint.aspx
Check out RadEditor for Sharepoint for a nice accessible rich text editor for publishing.
For xhtml compliance, things were a little more tricky, we had to override most of the Sharepoint publishing controls' render methods to correct dodgy output.
If you are wanting to leverage the portal like capabilites of Sharepoint in your extranet it is more problematic. The web part framework is not accessible and I have not yet found a way to make it so. Any suggestions welcome!

Resources