Is there any API in Liferay that can be used to create the Journal Article XML Content? - liferay

We have a custom Journal Article web content structure and currently using the hard-coded XML content to populate the structure with the values. Is there any API in Liferay that we can make use in order to create the XML content for Journal Article.

I guess you are looking for this guy: com.liferay.dynamic.data.mapping.util.FieldsToDDMFormValuesC‌​onverter
DDMFormValues ddmFormValues = DDMUtil.getDDMFormValues(ddmStructure.getStructureId(), ...);
Fields fields = DDMUtil.getFields(ddmStructure.getStructureId(), ddmFormValues);
String content = _journalConverter.getContent(ddmStructure, fields)

Related

How to get content from Liferay structure

I need help getting JournalArticle content of a particular content structure in liferay.
I want to display the field values of the Journal content. This content has a custom structure.
The structure is essentially an xml structure of the type DYNAMIC ELEMENT tags.
The value of the different fields of the structure that defines the article can be extracted using the format
Document document = SaxReaderUtil.read(journalarticle.getContent());
Node fieldNode = document.selectSingleNode("/root/dynamic-element[#name='Field-Name']/dynamic-content");
String brand = brandNode.getText();
`
See more at http://liferayiseasy.blogspot.com.ng/2015/08/get-web-contentjournal-article-fields.html

Extract IBM Notes View/Folder full ACL form Java API

Is there any way to extract View or folder ACL using Java API? In case of Document (like Extract Lotus Notes Document's complete ACL from Java) there is possibility to read item field $Readers or $UpdateBy, but there is no such fields in View object or any connected to users.
You can get view's or folder's readers by view.getReaders():
View view = db.getView("yourViewOrFolderName");
Vector readers = view.getReaders();
Update:
Folders have updaters in addition. Unfortunately, there is no method getUpdaters.
Create a NoteCollection, select view design elements only, iterate through views and find your folder and read item $Updaters.

Custom Metadatafield in Document and Web content in Liferay

I want a metadata field getting values from database record. This metadata field should be added to document.
Can anyone provide a solution to my requirement.??
I presume you are using Liferay 6.1.
Web Content Structures
As for Web Content, you could programmatically create a JournalStructure (see JournalStuctureLocalServiceUtil) and populate the list of possible values for your structure field with values coming out of the database. You can put this "import code" inside a batch job, so your structure field and the values inside the external database are always in sync.
Document Metadata
How to do this with Metadata Sets is probably more interesting, as not only Dynamic Data Lists and Documents & Media use this in Liferay 6.1; as of 6.2, Web Content structures will utilize the same metadata API in favor of the old Journal API.
For this to implement, check out the xsd column of the DDMStructure table. It has more or less the same format as the XML for a JournalStructure, however there are more options available. Use DDMStructureLocalServiceUtil#addStructure to add such a new structure. Again, run this inside a batch so you always have the latest external DB values.

Sharepoint Document Library Schema.xml Customization

Hi I am trying to add a custom field to the Schema.xml of Document library in sharepoint
here is the code that I took from a blog
In the ID i have to put the guid to do so
do I have to add my own guid or do i have to query the sharepoint database and find the guid and paste it there...
If i have to get it from sharepoint database which database and in what table I will find this information....
any help will be greatly appreciated
Thanks,
srikrishna.
This is now a duplicate post from MSDN forms
http://social.technet.microsoft.com/Forums/en-US/sharepointcustomization/thread/72df8c80-9e58-4c09-b1a6-ddfe1fb96b0a
there is a sure and safe mean :
1 - create a list with the SharePoint UI
2 - add a column to the list within the SharePoint UI
Create an applicative page that gets the schema of the list and you are done :
SPList mylist=SPContext.Current.Web.Lists["myNewList"];
string schema = mylist.SchemaXml;
schema = schema.Replace("<", "<");
schema = schema.Replace(">", ">");
string myAddedColumnSchema = mylist.Fields["MyAddedColumn"].SchemaXml;
myAddedColumnSchema = myAddedColumnSchema .Replace("<", "<");
myAddedColumnSchema = myAddedColumnSchema .Replace(">", ">");
Response.Write(schema);
Response.Write("<br>");
Response.Write("<br>"); Response.Write(myAddedColumnSchema );
Response.Write("<br>");
Response.Write("<br>");
This gives you the schema of the list with the field, and also just the field row in the list schema (of course copy the result in Visual Studio and use "Format Document" because on the web page it is just unreadable.
You cannot use this list schema by copying and pasting it in a SharePoint 2010 list Schema but you can locate the place where put the XAML correponding to your custom field.
After that you have to create a custom Content Type just for your custom field.
With SharePoint 2007 you could put a local content type corresponding to the custom field within the list schema but IT IS OVER. (I think... if someone can do it I will be pleased to be wrong ;-))
Then install the list feature with the new schema, and activate it within a site.
Then install the Content Type feature and activate it.
Then create a list based on the new schema, allow content type gestion for that list and add the new content type.
All the items based on the new content type will be allowed to use the new field.

Redefine folder structure of document library with metadata

I have a problem in my sharepoint document library structure. Currently the document library consiste of folder sub-folder structure to store a document categorywise. Now our client want to redefine this folder structure with a metadata structure.
Can any one tell me how can I use metadata instade of folder sub folder structure..?
any related articles or links will be appriciated.
Thanks
Sachin
As already stated, you need to use columns for the metadata, preferably through a new Content Type. After creating this Content Type, you need to attach it to the library and convert all documents to it. Lastly, you also need to modify the views of the library, e.g. depending on your metadata you might only want to display certain columns or filter them.
There is an excellent whitepaper from Microsoft on Content Types available here:
http://technet.microsoft.com/en-us/library/cc262729.aspx
You can also read more about content type planning on Technet:
http://technet.microsoft.com/en-us/library/cc262735.aspx
And here's some info about Views:
http://office.microsoft.com/en-us/sharepointtechnology/HA100215771033.aspx
You must define columns for the metadata fields you want to have, create a content type that includes these columns, and assign this content type to your documents.
You might also change the default view of your document library, or create a new view, to make the new metadata columns visible.

Resources