wraping text in outputText in Oracle ADF

Requirement- Wraping long text in outputText

Solutions- Many developer find solution to convert to input text and make read only.But that is just a work around.
Try this in inline Style – width:180px;display:inline-block;word-wrap:break-word
make nowrap property to false.

wrap


That’s it.

Happy coding with Vinay Kumar in techartifact….

Full text search using RIDC API in webcenter Content (UCM)

Requirment -I got task to accomplish to Search UCM using RIDC.

Solution– After spending so much time on it.I got solution on some blog.Not recall the blog name.for my reference , i am writing here.

We need to change some confi file which is in specified path –

Oracle/middleware/userprojects/yourdomain/ucm/cs/config/confing.cfg

There will be property name ‘SearchIndexerEngineName’ equal OracleTextSearch i.e

SearchIndexerEngineName=OracleTextSearch

Delete this and add the following one

SearchIndexerEngineName=DATABASE.FULLTEXT

Then by calling the RIDC API it enable Full text Search in UCM.

IdcClientManager manager = new IdcClientManager();
IdcClient idcClient = manager.createClient(“idc://192.167.3.232:4444″);

IdcContext userContext =new IdcContext('username', 'pwd'); 
DataBinder binder = idcClient.createBinder();

binder.putLocal(“IdcService”, “GET_SEARCH_RESULTS”);
binder.putLocal(“QueryText”,“dDocFullText <substring> <qsch>” + “our query” +”</qsch>”);

binder.putLocal(“SearchEngineName”, “databasefulltext”);
binder.putLocal(“ResultCount”, “10″);

ServiceResponse response = idcClient.sendRequest(userContext, binder);
DataBinder serverBinder = response.getResponseAsBinder();
binder = response.getResponseAsBinder();

DataResultSet resultSet =binder.getResultSet(“SearchResults”);
for (DataObject dataObject : resultSet.getRows()) 
{
  System.out.println(“Title is: ” + dataObject.get(“dDocTitle”));
  System.out.println(“Author is: ” + dataObject.get(“dDocAuthor”));
}


Restart the UCM server and try search again.

happy coding with Vinay in techartifact . 🙂

Java send mail in text and html

We posted earlier how send email using java email api.
Here is example of sending email in plain text and html format in same email.

  //get mail session
        Properties props = new Properties();
        props.put("mail.smtp.host", "localhost");
        Session session = session.getDefaultInstance(props);

        // create the messge.
        MimeMessage mimeMessage = new MimeMessage(session);

        MimeMultipart rootMixedMultipart = new MimeMultipart("mixed");
        mimeMessage.setContent(rootMixedMultipart);

        MimeMultipart nestedRelatedMultipart = new MimeMultipart("related");
        MimeBodyPart relatedBodyPart = new MimeBodyPart();
        relatedBodyPart.setContent(nestedRelatedMultipart);
        rootMixedMultipart.addBodyPart(relatedBodyPart);

        MimeMultipart messageBody = new MimeMultipart("alternative");
        MimeBodyPart bodyPart = null;
        for (int i = 0; i < nestedRelatedMultipart.getCount(); i++) {
            BodyPart bp = nestedRelatedMultipart.getBodyPart(i);
            if (bp.getFileName() == null) {
                bodyPart = (MimeBodyPart) bp;
            }
        }
        if (bodyPart == null) {
            MimeBodyPart mimeBodyPart = new MimeBodyPart();
            nestedRelatedMultipart.addBodyPart(mimeBodyPart);
            bodyPart = mimeBodyPart;
        }
        bodyPart.setContent(messageBody, "text/alternative");

        // Create the plain text part of the message.
        MimeBodyPart plainTextPart = new MimeBodyPart();
        plainTextPart.setText("This is plain text message", "UTF-8");
        messageBody.addBodyPart(plainTextPart);

        // Create the HTML text part of the message.
        MimeBodyPart htmlTextPart = new MimeBodyPart();
        htmlTextPart.setContent("<h1>This is plain HTML message", "text/html;charset=UTF-8");
        messageBody.addBodyPart(htmlTextPart);

        mimeMessage.setReplyTo(new InternetAddress[]{new InternetAddress("[email protected]")});
        mimeMessage.setFrom(new InternetAddress("[email protected]"));
        mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
        mimeMessage.setSentDate(new Date());
        mimeMessage.setSubject("Mixed message");
        Transport.send(mimeMessage);