Thursday, May 5, 2022

Setup X11 forwarding on Oracle OCI (or Oracle JCS VM) - Oracle Linux 7

In general, there are a variety of tools, that can be selected for using X11 forwarding from a Linux machine, in this article I am using MobaXterm, as this tool have some very good features on top of a standard putty and related utilities.

 Connect to OCI VM via MobaXterm, most likely you will see X11 forwarding disabled by default.

Steps to be taken to make sure X11 forwarding is enabled on the  OCI VM :

  1. Log into the VM and sudo -s root, if you are not root.
  2. Configure SSHD to not to check if X11 forwarding is enabled:
    1. cd /etc/ssh
    2. vi sshd_config
    3. Check if the property X11Forwarding is set to yes.
    4. Add AddressFamily inet in the list


    5. Save the file
    6. Restart the ssh daemon by executing: systemctl restart sshd
  3. Install xauth by executing: yum -y install xauth
  4. Install xterm (used to verify X configuration) by executing yum -y install xterm
  5. Also install xclock for simple testing of the X Forwarding: yum -y install xclock

 Once the above activities are completed close the session and open a new session in MobaXterm, this time you should see xauth error by default as the folder doesn't exists, you can ignore that and run xclock(It is automatically created behind the scenes).

 

 But what if I want to run x11 forwarding as oracle user? Lets’ see what happens


Now, we focus on second problem:  the reason for  not setting DISPLAY , because display was only set for the original user which was used to connect session with MobaXterm. Do, these steps in order to set X11 forwarding for any user you switched after connecting to MobaXterm initially :

1.     Connect with default user, say opc.

2.     Type xclock , to check if display is working fine for the opc user.

3.      Type echo $DISPLAY



4.     Type xauth list $DISPLAY


5.      Now, switch to a different user , say oracle sudo su – oracle

6.      Upload export variable: export DISPLAY=localhost:11.0

7.     Add the cookie session reference to current user:

xauth add <output of step #4>

xauth add xxxx-wls-1/unix:10  MIT-MAGIC-COOKIE-1  dd413b3fb2aea0e4cd60f504c2893fcf

            and that’s it after this you will be able to run xclock.

Getting back to Blogging on OCI and HCM

 I took a break from blogging after I moved to US back in 2012  , I guess life had had a lot of other things to keep me busy on my journey of technical learning and  a lot of video gaming :) . Over last couple of years have worked extensively on different Oracle OCI cloud(s) like ATP, JCS, DBCS, OIC etc. along with Hcm.  So, starting back on blogging on  issues that touch everyday of our lives on Oracle PaaS and SaaS.

Friday, May 24, 2013

New page template for custom webcenter project : Not able to add as portal resource

I recently faced a strange issue while creating a new template for webcenter project in Jdeveloper. I created a custom page template for my portal application based on a quick start layout and added some custom code that displays content for header and footer region . Now when I tried to add this page template as a new page template in resource catalog by right clicking the PageTemplate.jspx and selecting create as portal resource. It gives me notification, that "the jspx document is not a valid page template or content presenter template. Recognizing the resource type as Page Style".

In <af:xmlContent> tag you should add:

<facet>
<description>Facet for content</description>
<facet-name>content</facet-name>
</facet>
And in some parte of your code you need add this:
<af:facetRef facetName="content"/>



After this change if you will try to add the template in resource catalog,it should work fine.Hope this helps.

Friday, April 19, 2013

ADF 11g Skinning

An excellent article by Frank on how to approach skinning in ADF , helps to understand how to approach skinning in ADF. Also with latest release of Jdeveloper you have a skin designer as part of Jdeveloper itself , which makes skinning a lot easier.Here is the link to the article : http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/adf-insider-skinning/adf-insider-skinning.html . 

ADF 11g .... now Free !

I was not aware that Oracle has now made ADF free, that is a great news for entire J2EE community, now you can quickly develop rich web applications on ADF 11g and deploy on any open source free server like Glassfish, etc. Here is the link for the declaration : http://www.oracle.com/us/corporate/press/1851249

Tuesday, April 16, 2013

Webcentre Discussions Dissection


Hi All , after sleeping for quite some time, thought to start blogging back. This  time I thought to start with ADF/Webcentre. Webcentre , as we all are seeing is gaining quite a momentum in consulting market now and I can see numerous projects being done some standard spaces implementation , but most projects are custom Webcentre portal as its gives you the liquidity to build any to integrate or build standard ADF application and use lot many features of Webcentre.

An essential part of Webcentre is Webcentre Discussions(Jive Forums) server and its service. Recently I worked on a custom webcentre project where I integrated the discussion service of webcentre. My idea of writing this article is to explain the discussion service terminology and  details and then programmatic API(s) which might help you to do something creative in your project with discussion service.


About Jive Forums
Jive forums is the software which runs on discussion server and is a self sufficient forums portal/website. In fact Oracle forums are built on the same platform. Its quite stable, robust and fast.There are currently two editions of Jive Forums: Silver Edition (for small to midsize deployments) and Gold Edition (for large deployments). Some Features unique to the Gold edition include:

• Question/answer workflow, through which users can mark a post as a question then designate
responses as helpful or correct (scoring points for the users who posted them).
• Expert email notification, in which email notifications are sent for unanswered questions.
• Multiple theme configurations to customize look and feel.
• Reward point system, where points are awarded for responses based on how useful the response
turns out to be.
• Community everywhere, through which users embed discussion threads into other web pages.
• Web services for programmatic access to Jive Forums data.


Discussion Forums basics
a) Community : A community typically corresponds to a group of people with a common set of interests and it usually has a single overall purpose.
b) Category : A category is the broadest classification of content in a community. Categories may contain other categories, forums, threads, and messages.
c)Forum: A forum generally focuses on a single thread or a small group of associated threads, and is narrower in scope than a category.
d)Thread : Threads are the individual questions or subjects discussed within the scope of a single forum.A thread is defined as an original message and all of its replies. Threads may run only a few messageslong, or may include hundreds of messages.
e)Message : A message refers to a single question, discussion point or reply that is posted to a forum.Messages comprise a subject header, a message body, and sometimes a file attachment or attachments.

Discussion Forums database details
Sometimes, its essential to look into the database of discussion forums, for a requirement like grooup update of something. For this reason, it is absolutely necessary for you to have the understanding of some of the main tables, used in Forums are :

Category : select * from jivecategory where name like ('')

Forums: select * from jiveForum where categoryid=<category id which you can get from jivecategory>

Thread :  Thread is created in the forum where root message id is the starting message of the thread.
select * from jivethread where forumid=92 order by modificationdate desc
You can get root messageid and thread id from the above query. Root message id is the starting message of the thread.

Message : All messages of a thread are stored in the table jivemessage with parent child relationship also maintaining the sequence of replies.If parentmessageid is null then root message, else child message.

select * from jivemessage where forumid= and threadid= and messageid=

--the direct child of this message can be found by quering with parent
--message id as message id
select * from jivemessage where forumid= and threadid= and parentmessageid=

-- using connect by prior getting entire message stack of a thread
--starting from root node
SELECT LEVEL,jv.*
      FROM jivemessage jv
      where jv.forumid= and jv.threadid=
      START WITH jv.messageid =
      CONNECT BY PRIOR jv.messageid = jv.parentmessageid
      ORDER by creationdate
   
-- Pls note that each message 's user id
-- is jive user id which is based on LDAP username configured in weblogic security realm
-- and the relationship is stored in jiveuser table  
SELECT * FROM JIVEUSER

Webcentre Discussion Services Available Taskflows:
With the discussion services, you have the following taskflows:

  1. Discussion Forums: Taskflow that integrates the basic functionality to allow discussions on a page
  2. Discussions - Popular topics: Taskflow that shows the popular topics
  3. Discussions - Quick view: A smaller view to list the topics
  4. Discussions - Recent topics: Taskflow that shows a list of the recent topics
  5. Discussions - Watched topics: Taskflow that shows the list of the watched topics from the current user
  6. Discussions - Watched forums: Taskflow that shows the list of the watched forums from the current user



Webcenter Discussion Forum Programmatic APIs:
Sometimes, you might get a requirement, where you  have requirement to play with code on creating category/discussions/forums. programatically, so giving common APIs used for the same:

Common code for all:

import oracle.webcenter.collab.announcement.AnnouncementFilter;
import oracle.webcenter.collab.announcement.AnnouncementService;
import oracle.webcenter.collab.announcement.AnnouncementSession;
import oracle.webcenter.collab.forum.Category;
import oracle.webcenter.collab.forum.CategoryService;
import oracle.webcenter.collab.forum.Forum;
import oracle.webcenter.collab.forum.ForumService;
import oracle.webcenter.collab.forum.ForumSession;
import oracle.webcenter.collab.forum.MyDiscussionsService;


public ForumSession session = null;
public CategoryService catService = null;
public ForumService forumService = null;


Category
catService = (CategoryService)session.getService(CategoryService.class);
Category newCreatedCategory = catService.createCategory(null, new Long(parentCategoryId).toString(),categoryName, categoryName, categoryName);
categoryId = Long.parseLong(newCreatedCategory.getId());

catService = (CategoryService)session.getService(CategoryService.class);
long rootCategoryId = Long.parseLong(catService.getRootCategoryId());


Forum
List forums = catService.getForums(new Long(categoryId).toString(), null,true);
forumService = (ForumService)session.getService(ForumService.class);
Forum newCreatedForum = forumService.createForum(null,new Long(RootCategoryId).toString(),TopicName, TopicName, TopicName);
forumId = Long.parseLong(newCreatedForum.getId());
Forum forum = forumService.getForum(new Long(forumId).toString());
long topicCount = forum.getTopicCount();


I hope this article gives you a clear picture of discussion forums service in webcentre.

Saturday, July 7, 2012

Proxy or DataControl with webservices in ADF

A recent article by Frank in Oracle Magzine issue July/August 2012 , provides a clear insight and guidelines, about which approach one should take while interacting with web services in an ADF application :
Frank's Article.