Wednesday, 31 December 2014

WCM Rest

http://infolib.lotus.com/resources/portal/8.0.0/doc/en_us/PT800ACD004/wcm/wcm_rest.html

Table 1. Query parameters
ParameterDetails
approverThis parameter is used to query items with a specific approver.
A user ID must be specified when using this parameter.
For example:
/query?approver=userid
authoringtemplateidThis parameter is used to query items with a specific authoring template ID.
For example:
/query?authoringtemplateid=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53
authorThis parameter is used to query items with a specific author.
 A user UID must be specified when using this parameter.
For example:
/query?author=uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm
categoryidThis parameter is used to query items with a specific category ID.
For example:
query?categoryid=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53
createdafterThis parameter is used to query items created after a specific date and time.
For example:
/query?createdafter=2011-01-11T11:43:29.0150Z
createdbeforeThis parameter is used to query items created before a specific date and time.
For example:
/query?createdbefore=2011-01-11T11:43:29.0150Z
creatorThis parameter is used to query items with a specific creator.
A user UID must be specified when using this parameter.
For example:
/query?creator=uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm
dateformatThis parameter is used to define the date format of query parameters.
For example:
/query?dateformat=mm-dd-yyyy&createdbefore=12-31-2011
If a date format not specified, then the default format yyyy-MM-dd'T'HH:mm:ssz is used.
depthThis parameter is used with the parentid and is used to define whether to search for all descendants of a parent, or just the immediate children of a parent item.
For example, to query only the immediate children of an item, you add &depth=CHILDREN to the query:
/query?parentid=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53&depth=CHILDREN
To query all descendants of an item, you add &depth=DESCENDANTS to the query::
/query?parentid=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53&depth=DESCENDANTS
expireafterThis parameter is used to query items that have expired after a specific date and time.
For example:
/query?expireafter=2011-01-11T11:43:29.0150Z
expirebeforeThis parameter is used to query items that were expired before a specific date and time.
For example:
/query?expirebefore=2011-01-11T11:43:29.0150Z
idThis parameter is used to query an item with a specific ID.
For example:
/query?id=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53
keywordThis parameter is used to query items that are profiled with a specific keyword.
For example:
/query?keyword=keywordValue
lastmodifiedafterThis parameter is used to query items that were last modified after a specific date and time.
For example:
/query?lastmodifiedafter=2011-01-11T11:43:29.0150Z
lastmodifiedbeforeThis parameter is used to query items that were last modified before a specific date and time.
For example:
/query?lastmodifiedbefore=2011-01-11T11:43:29.0150Z
lastmodifierThis parameter is used to query items that were last modified by a specific user. A user UID must be specified when using this parameter.
For example:
/query?lastmodifier=uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm
libraryidThis parameter is used to query items that are stored in a specific library.
For example:
/query?libraryid=uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm
namelikeThis parameter is used as a wildcard query for items with names like the specified namelike parameter.
For example:
/query?namelike=nameApproxValue%
nameThis parameter is used to query an item with a specific name.
For example:
/query?name=nameValue
ownerThis parameter is used to query items with a specific owner. A user UID must be specified when using this parameter.
For example:
/query?owner=uid=WCMUT_Editor_A,o=defaultWIMFileBasedRealm
pagesizeThis parameter is used to restrict the number of items returned by a query to a set number. It can be used with the page parameter to return specific pages of results.
For example, to restrict the number of queries to be returned to 5:
/query?type=PresentationTemplate&pagesize=5
pageThis parameter is used with the pagesize parameter to define what set of results to display. For example, if pagesize is set to 5, and the pageparameter is set to 2, then only results 6 to 10 will be displayed.
For example:
/query?type=PresentationTemplate&pagesize=5&page=2
parentidThis parameter is used to query items that are the children of a specific parent item.
For example:
/query?parentid=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53
You can use the depth parameter to define whether to search for all descendants of a parent, or just the immediate children of a parent item.
projectidThis parameter is used to query items that are linked to a specific project.
For example:
/query?projectid=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53
projectstateThis parameter is used to query items that are linked to a project with a specific state. The following values can be used with this parameter:
  • ACTIVE
  • SYNDICATING
  • PENDING
  • PUBLISHING
  • PUBLISHED
  • PUBLISHED_FAILED
For example, to query items linked to projects with a state of "active" you would use the following query:
/query?projectstate=ACTIVE
publishafterThis parameter is used to query items that have been published after a specific date and time.
For example:
/query?publishafter=2011-01-11T11:43:29.0150Z
publishbeforeThis parameter is used to query items that were published before a specific date and time.
For example:
/query?publishbefore=2011-01-11T11:43:29.0150Z
sortThe sort parameter is appended to queries to determine how query results are sorted. The following values can be used with the sort parameter.
  • author
  • created
  • modified
  • name
  • title
  • parents
The values _ascending or _descending are appended to the query to determine sort order.
For example, to sort a presentation template query in ascending order of creation, you would use:
/query?type=PresentationTemplate&sort=created_ascending
To sort a presentation template query in descending order of creation, you would use:
/query?type=PresentationTemplate&sort=created_descending
If _ascending or _descending are not specified, the results as displayed in ascending order.
stateThis parameter is used to query items that are in a specific state. The following values can be used with this parameter:
  • DRAFT
  • PUBLISHED
  • EXPIRED
For example:
/query?state=PUBLISHED
titlelikeThis parameter is used as a wildcard query for items with titles like the specified titlelike parameter.
For example:
/query?titlelike=nameApproxValue%
titleThis parameter is used to query an item with a specific title.
For example:
/query?title=titleValue
typeThis parameter is used to query items of a specific item type.
For example, to query a list of components::
/query?type=LibraryHTMLComponent
workflowidThis parameter is used to query items that use a specific workflow.
For example:
/query?workflowid=wcmrest:8d25860b-7a5c-4015-9cd5-bdcc60ce14bb
workflowstageidThis parameter is used to query items that are currently active within a specific workflow stage.
For example:
/query?workflowstageid=wcmrest:18cfc80c-a490-4d75-9057-fed3db89de53



Thursday, 11 December 2014

Different ways of delivering web content in WCM

Delivering web content :-  The core concept of this topic is how many ways can we display a WCM content.I have mentioned below all possible ways to display a WCM content

Three ways :-
1) Display it via servlet
2) Display it in a portal page
3) Pre render delivery

1) Display it in a servlet :- Using this WCM servlet you can display WCM content without using web-sphere portal server.
Table 1. Service options
Service optionDetails
srv=cmpntThis will retrieve a component either from the component library or from a site area or content item. You must also specify the following:
source=
This determines where the component is being sourced from. This is either:
  • library
  • sitearea
  • content
cmpntname=[componentname]
This is the name of the component being retrieved.
srv=pageThis will retrieve a content item. As srv=page is returned as default, this can be omitted from the URL.
The presentation template to use when displaying this content is specified by adding:
presentationtemplate=library/presentationtemplatename

keys and values :- 
localhost:10039 - Name of the server
wps - portal context
wcm - wcm context
myconnect - servlet context
SecurityLibrary - library name
SA_AuthoringTool - site area name
CT_AuthoringTool - content name


Example1(Retrieving content directly):- 
http://localhost:10039/wps/wcm/myconnect/SecurityLibrary/SA_AuthoringTool/CT_AuthoringTool

Example2(Retrieving content by specifying presentation template):- 
http://localhost:10039/wps/wcm/myconnect/SecurityLibrary/SA_AuthoringTool/CT_AuthoringTool?presentationtemplate=SecurityLibrary/PT_AuthoringTool

Example3(Retrieving component by specifying some site-area to have a preview):-
http://localhost:10039/wps/wcm/myconnect/SecurityLibrary/SA_AuthoringTool?srv=cmpnt&source=library&cmpntname=ATool_component


2) Display it in a portal page :-  For displaying it in portal page IBM had come up with a concept called web content viewer which will be added to portal page later that portlet will display the WCM content.IB has come up with a little new concept called page association it means you can associate a page to a site area. Later add a web content viewer portlet by default it will display the content from page association. The other way is to use both association and web content viewer where base path will be page association later path will be take from web content viewer portlet.

A) Core of web content viewer portlet :-  Create a page and add web content viewer portlet to it. Then navigate to edit mode. It contains 4 sections of editable content as given below.

                      Content(Here you can associate content)



 Content Type :-  You can select content item or component or element depending upon what you are including.

Content Behavior :-  If (Select content and path) is selected then it will use path from content viewer portlet. If (Select content and use content association of current page) is selected then it will use page association and content viewer path.

Content :- Select the content item which need to be displayed

Profile(To pass parameters) and Portlet settings(To set portlet display title and cache settings)


Categories :- Set category that will be passed in the url which can be used in menu component
Site Areas :- Set sitearea that will be passed in the url which can be used in menu component
Authoring Template :- Set sitearea that will be passed in the url which can be used in menu component


Advance options(Using this you can achieve events between two content viewer portlets)


Links :- Using this you can achieve linking between two content viewer portlet

   B) Page association :-  You can navigate to page associations in edit page as given below

                                        Click on edit beside web content to change associations


Now click on add web content to change the library location


After changing the library click ok 



3) Pre render delivery :-  If we are going to display wcm content in a non-portal environment then we sue pre-render delivery. In this case all wcm content specified for site-area is changed to an html and saved to disk. Using a url we can render this static content. Prefer this approach if content changes periodically.

Draw backs:-
Search cannot be used
Personalization cannot be used
Navigator component cannot be used 

The security for the entire pre-rendered site is based on the connect.moduleconfig.cacher.rendereruser property as specified in the WCM WCMConfigService service using theWebSphere Integrated Solutions Console.

Step1 :- To create a static site you need to construct below url and enter in browzer

http://host_name:port_number/wps/wcm/connect?MOD=Cacher&SRV=cacheSite&sitearea=sitearea_name&library=library_name

http://localhost:10039/wps/wcm/myconnect?MOD=Cacher&SRV=cacheSite&sitearea=SA_AuthoringTool&library=SecurityLibrary

Table 1. CacherModule options
ServiceRequired ParametersOptional Parameters
SRV=cacheSite
Initializes prerendering for the given site area with a delay as given (in seconds).
sitearea=<site area name>DELAY=<delay>
LIBRARY=<library>
Note: If no library is specified, the default library is used, as specified by thedefaultLibrary property in the WCM WCMConfigService service.
SRV=flushSiteCache
Clears (flushes) the given site cache. Deletes all pre-rendered data.
sitearea=<siteareaname>
LIBRARY=<library>
Note: If no library is specified, the default library is used, as specified by thedefaultLibrary property in the WCM WCMConfigService service.
SRV=flushPageCache
Flushes the page from the site cache. The site area and page are determined from the request URL.
  
No SRV specified
The CacherModule attempts to retrieve the given page from the cache.
  



Step2 :- Accessing pre-rendered sites
To enable users to access the pre-rendered site through a Web Content Manager application, specify the connect.businesslogic.module.default.class property in the WCM WCMConfigService service using the WebSphere® Integrated Solutions Console.
Property name: connect.businesslogic.module.default.class
Value: com.aptrix.cacher.CacherModule



Step3 :- Enter below url to view it

http://localhost:10039/wps/wcm/myconnect/SecurityLibrary/SA_AuthoringTool

Monday, 8 December 2014

Creating tempates in websphere portal8.0

Templates :- You can create page templates which consists of basic structure which can be later reused for faster creation of pages

Step 1 :- Navigate to administration->managed pages->hidden pages and create your page template



Step2 :- Now click on new page from and enter the details for creating a new page.


Now click ok


Step 3 :- Now go to edit mode and add web content viewer portlet. If needed in edit shared setting set your content



Step 4 :- Now go back to Managed pages and try creating new page from template . Select your custom template.



Step5 :- Fill remaining details and click ok .Then a page will be created from Template1 with web content viewer added and content associated with it.


Sunday, 7 December 2014

Blogs and Wiki's in WCM8.0 websphere portal

Blogs :- It s a place where you post a solution and ask ideas of others related to that solution. Either you can start a new topic and ask views of others.

Wikis :- Is the place where you can put all information related to a topic and let all authors to have inline editing. By this we can have one wiki as single point of contact for any domain or topic.

1) Blogs :- WCM provides default library for blogs like Web Resource template v7.0, Blog solo v7.0 and Blog v7.0 library.


Adding a blog or blog library to a page

With Editor access to the portal or the portal page, you can add a blog or blog library to a page. Choose a blog to collaborate with your team on a single topic. Choose a blog library to collaborate with your team on multiple topics in a centralized view.

Step 1 :-

  1. Create a page for the blog or blog library or open an existing page(Make sure it has full/defered dojo profile).
  2. Click the Content tab, then click Communications.
  3. Click Blog Library to add a team blog or click Blog to create a single-topic blog.
  4. Click Add to page.
  5. Provide a name. Then click Add.
  6. This action copies the appropriate IBM® Web Content Manager blog template library and places an instance of the web content viewer on the page.

A library with same name is created


 Step 2 :Create Post to add content. You can click Edit to modify content, delete a post by clicking Delete.



Now try to login with a different user apart from wpadmin and post a comment for previous post.




Now click on Add a comment and then put some comments


Conclusion :- Like this you can create multiple posts inside a blog. There is another option of adding blog library to a page. where we can view list of blog posts .



2) Wikis :-  In wiki's we store multiple content as one repository it contains two libraries . As blogs it has two libraries web resource v7.0 library and wiki library v7.0 library.

Step1 :- Similarly like Blogs add wiki's also to a portal page as given below.



Step2 :- You can click new page and create new pages. Below view is for administrator role he can delete and create new pages. 


Step3 :- For editors we should not provide access to delete . So we need to assign a user group to editor role. 

 Navigate to the library which is created and edit access permissions.


Now edit the role for editor and add Editor group to it.


Click edit and then click on ok button.




Step 4 :- Now login as editor and view the wiki page. You will not have a option to delete a wiki.



Conclusion :- Blogs and wiki's are social portlets readily available for use.

Thursday, 4 December 2014

Syndication in WCM8.0 websphere portal

Syndication :-  Syndication is nothing but replication the web content from one library to another library. For this we need to set a subscriber and a syndicator. Syndicator will be sending data to subscriber and subscriber will be receiving content from syndicator.


Live items:
Live item syndication is mostly used when syndicating to a staging or delivery server. The following items are syndicated:
  • Published
  • Expired
Draft items, projects and items in a project are not syndicated.
Live and projects:
The advantage of using "Live and projects" syndication is to gradually syndicate projects to a staging or delivery server rather that waiting to syndicate all the items in a project after they all achieve a published state. The following items are syndicated:
  • Published
  • Expired
  • Projects
  • Draft items in a project
Draft items outside of projects are not syndicated.
All items:
All item syndication is mostly used when syndicating between servers within an authoring environment. The following items are syndicated:
  • Published
  • Expired
  • Projects
  • Draft items in a project
  • Other draft items
  • Versions
  • Deleted items              

Steps to create syndicators :-
  • To syndicate a library that contains more than 10000 items, update the maximum Java heap size used by the portal application server on the subscriber server:
    1. In the WebSphere® Integrated Solutions Console, navigate to the Java virtual machine settings.
      Stand-alone server:
      Servers > Server Types > WebSphere application servers > WebSphere_Portal > Java and Process Management > Process definition > Java Virtual Machine
      Clustered server:
      System administration > Deployment manager > Java and Process Management > Process Definition > Java Virtual Machine
    2. Update the value in the Maximum Heap Size field. A value of at least 1024 MB is recommended.
    3. Click OK, and then save your changes.

Procedure

To set up a syndication relationship, complete the following steps:

  1. Ensure both the subscriber and syndicator are running and that they can access each other over a network.
  2. On your subscriber server, log in to IBM WebSphere Portal.
  3. Go to Administration > Access > Credential Vault and create a shared credential vault slot to allow you to access the syndicator
  4. Go to Administration > Portal Content > Subscribers.
  5. Click Subscribe Now.
  6. Enter the syndicator URL in the form of http://HostName:HostPort/WcmContextRoot. For example: http://authoring:10039/wps/wcm
    Note:
    When syndicating from a virtual portal:
    Using the URL context of a virtual portal:
    http://HostName:HostPort/wps/wcm/url_context
    Using the hostname of a virtual portal:
    http://VirtualHostName:HostPort/wps/wcm
  7. Enter a name for the syndicator item. This name is used for the syndicator item that is created on the syndicator server. Enter a name that helps identify the syndication relationship you are creating. This name must be unique and cannot be the same as an existing syndicator name.
    Note: To reuse syndicator names of previously deleted syndication relationships on a subscriber, you must also delete the same relationship on the syndicator.
  8. Enter a name for the subscriber item. This name is used for the subscriber item that is created on the subscriber server. Enter a name that helps identify the syndication relationship you are creating. This name must be unique and cannot be the same as an existing subscriber name.
  9. Select the credential vault slot you created previously.
  10. Click Next
  11. Select the libraries you want to subscribe to.
  12. To begin syndication, click either Update Subscriber or Rebuild Subscriber button.

Explaining Authoring tool and its uses in IBM WCM8.0

Authoring tool :-  Authoring tool provides you authoring functions like editing contents in web content viewer portlet.

Step1 :- Create a AT by adding component reference in manage elements.


Create a site area to hold the content




Step2 :- Create a Authoring Tool as given below.


Fill the details then select the Authoring Template, Sitearea


Everywhere put a place holder tag for href and name


In header design put a div structure and separate remaining by span and br tags



Step 3 :- Now create the content with previously created AT and then map above Authoring Tool component to it.


Step 4 :- Now create a PT and include the AT as element tags in it


Step 5 :- Now map the AT and PT in site area 


Step 6 :- Now create page add web content viewer portlet and map site-area to it.


                          Click on new it will take you to new content. 


Click on read then you can read the content


Note :- You can even make the tab to open as a separate browser tag. To do that you need to change the tag to  ( <a href=" [Placeholder tag="href" format="url"]" target="_blank">
 [Placeholder tag="name"]</a> )

Custom single threaded java server

 package com.diffengine.csv; import java.io.*; import java.net.*; import java.util.Date; public class Server { public static void main(Str...