oracle endeca developer's guide

39
Oracle Endeca Introduction to Assembler Application & Cartridges - Keyur Shah (http://www.linkedin.com/in/keyurkshah ) Note: Source for some of the images is Oracle Endeca Documentation

Upload: keyur-shah

Post on 14-Feb-2017

20.819 views

Category:

Software


11 download

TRANSCRIPT

Page 1: Oracle Endeca Developer's Guide

Oracle EndecaIntroduction to Assembler Application & Cartridges

- Keyur Shah (http://www.linkedin.com/in/keyurkshah)

Note: Source for some of the images is Oracle Endeca Documentation

Page 2: Oracle Endeca Developer's Guide

Endeca Component Interaction

Page 3: Oracle Endeca Developer's Guide

Endeca Component Interaction - 2

Offline processing raw data sources

Endeca ITLEndeca MDEX Engine

Endeca Application Tier

Online processing

Your Application

User’s Browser

Page 4: Oracle Endeca Developer's Guide

Endeca Pipeline

The end result is an Endeca index which possesses enriched source data and enhanced search and Guided Navigation capabilities

Loading Data

Caching & Joining Data Manipulating Data Dimension

Mapping

The Endeca pipeline

Page 5: Oracle Endeca Developer's Guide

Endeca Index Architecture

Crawl

Website

Configuration

Content

Database & File System

Indexing

MDEX Dgraph / Index

ConsoleWSDL

CMS Connector

File System

JDBCMerge

Record Store

Record Store

MDEXCompatible Output

DimensionMapping

Manipulators

DocumentConversion

Content Acquisition System

Custom

Page 6: Oracle Endeca Developer's Guide

ATG-Endeca Integration

Endeca Content Acquisition

System

Product Record Store

DimensionRecord Store

ATG Web Commerce

Product Exporter

Category Exporter

Schema Exporter SchemaRecord Store

Endeca Application Controller

Endeca ITL Endeca MDEX

ConfigurationForge

Web Application

Product Catalog

Indexing Admin

ATG Deployment Template Module

Endeca Configuration

Publish Product Catalog Assets to Endeca Records Publish Categories to Endeca Dimensions Publish Schema Metadata from ATG Web Commerce

to Endeca Operational Support

Page 7: Oracle Endeca Developer's Guide

MDEX Engine

The MDEX Engine uses proprietary data structures and algorithms that allow it to provide real-time responses to client requests. The MDEX Engine stores the indices that were created the Dgidx indexing program. After the indices are stored, the MDEX Engine receives client requests via the application tier, queries the indices, and then returns the results.

The two primary components of the MDEX Engine package are the following:

• Dgraph • Dgidx

MDEX engine is designed to be stateless.

Page 8: Oracle Endeca Developer's Guide

Overview of CAS & Crawler

Page 9: Oracle Endeca Developer's Guide

Endeca – Type of Pages

Site may have 3 basic page types:

Page 10: Oracle Endeca Developer's Guide

Page Structure & Content Type

Page 11: Oracle Endeca Developer's Guide

Templates & Cartridges Work Together

Page 12: Oracle Endeca Developer's Guide

Cartridge Structure

Page 13: Oracle Endeca Developer's Guide

Endeca Assembler Application

The Endeca Assembler application enables a WEB application to query the MDEX Engine and retrieve the appropriate dynamic content based on user’s navigation state or other triggers

The Assembler application provides a RESTful web service API that returns results either in JSON or XML.

The Assembler API is powered by Java, but the query interface is language-agnostic web service

Page 14: Oracle Endeca Developer's Guide

Example of JSON Returned by Assembler Application

Page 15: Oracle Endeca Developer's Guide

Example of JSONhttp://localhost:8006/discover/?format=json

Explicitly retrieve JSON

from Assembler

Open the JSON in Notepad++

Download the JSON Viewer

for Notepad++

Page 16: Oracle Endeca Developer's Guide

JSON Viewer in Notepad++ You can download the JSON Viewer for Notepad++ from Sourceforge http://sourceforge.net/projects/nppjsonviewer/?source=dlp Unzip the download This plugin is meant to display a JSON string in a Treeview. It also marks the error

position in case of parsing errors. Thats it!!!============Instruction:============1. Paste the file "NPPJSONViewer.dll" to Notepad++ plugin folder2. open a document containing a JSON string3. Select JSON fragment and navigate to plugins/JSON Viewer/show JSON Viewer or press

"Ctrl+Alt+Shift+J"

Page 17: Oracle Endeca Developer's Guide

Cartridge Creation WorkflowReviewAs we have seen, the high-level workflow for creating a basic cartridge is: 1. Create a cartridge template and upload it to Endeca

Workbench 2. Use Experience Manager to create and configure and

instance of the cartridge 3. Add a renderer to the front-end application

FOR DEVELOPERS

Step 2 is necessary during development in order to have a cartridge instance with which to test.However, once the cartridge is complete, the business user is typically responsible for creating and maintaining cartridge instances in Experience Manager.

Page 18: Oracle Endeca Developer's Guide

Endeca Content & Indexing

Page 19: Oracle Endeca Developer's Guide

What Happens @ Runtime?

The Assembler retrieves this configuration at runtime and uses it to build the response model that it returns to the client application.

Page 20: Oracle Endeca Developer's Guide

How does it all work?

Page 21: Oracle Endeca Developer's Guide

Hello Cartridge - ExampleTo create and configure a basic “Hello cartridge”:

Create a cartridge template

1. Open a new plain text or XML file2. Type or copy the following contents to the file (with .xml extension)3. Save the file into C:\Endeca\Apps\Discover\config\cartridge_templates folder

Page 22: Oracle Endeca Developer's Guide

Hello World Cartridge – Example (Cont’d)

<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:editors="editors" type=“SecondaryContent" id="Hello">

<Description>A sample cartridge that can display a simple message.</Description>

<ThumbnailUrl>/ifcr/tools/xmgr/img/template_thumbnails/sidebar_content.jpg</ThumbnailUrl>

<ContentItem>

<Name>Hello cartridge</Name>

<Property name="message">

<String />

</Property>

<Property name="messageColor">

<String />

</Property>

</ContentItem>

<EditorPanel>

<BasicContentItemEditor>

<editors:StringEditor propertyName="message" label="Message" />

<editors:StringEditor propertyName="messageColor" label="Color" />

</BasicContentItemEditor>

</EditorPanel>

</ContentTemplate>

Save the file into

C:\Endeca\Apps\Discover\config\cartridge_templates folder

Page 23: Oracle Endeca Developer's Guide

Save & Upload Cartridge

Page 24: Oracle Endeca Developer's Guide

Add a Cartridge to a Page(Experience Manager)

Page 25: Oracle Endeca Developer's Guide

Workbench & Experience Manager

Page 26: Oracle Endeca Developer's Guide

“Add/Change” for Cartridge Selector

Page 27: Oracle Endeca Developer's Guide

Add New “RightContent”

12

3

4

Page 28: Oracle Endeca Developer's Guide

New RightContent Added“Hello Cartridge”

Add the custom “Message” and “Color” values followed by clicking on the “SAVE CHANGES” BUTTON (right top)

Page 29: Oracle Endeca Developer's Guide

Review the Changes in Discover Authoring

Right Content

Top Related Products

Hello

The error displays because we have not yet created a renderer for the Hello cartridge.

http://localhost:8006/discover-authoring

Page 30: Oracle Endeca Developer's Guide

Viewing the JSON for Cartridge Verification At the footer of the discover authoring default page, you

should see couple of interesting links “json” and “xml” You can click on JSON or XML link to view the MDEX

response (content type + content) to the page request

Clicking on “json” – you will be able to view the page response in json format

Goto the bottom of JSON response or search “Hello” in the response

You will be able to confirm the presence of Hello Cartridge

Page 31: Oracle Endeca Developer's Guide

Hello.JSP – Bring It All TogetherAdding the Basic Renderer Endeca application have no way to render the content to the front-

end (Either JSON or XML or Custom XML) Create a new JSP file (Hello.jsp) in the C:\Endeca\

ToolsAndFrameworks\3.1.2\reference\discover-electronics-authoring\WEB-INF\views\desktop\Hello folder (You need to create the Hello folder)

<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%><%@include file="/WEB-INF/views/include.jsp"%><div style="border-style: dotted; border-width: 1px;border-color: #999999; padding: 10px 10px"><div style="font-size: 150%;color: ${component.messageColor}">${component.message}</div></div>

Color-coded

For your copy-paste

purpose

Page 32: Oracle Endeca Developer's Guide

Testing the Hello.jsp Once you have created the JSP and dropped in the Hello folder as

described in previous slide, you are ready to test the changes Just refresh the Discover authoring home page

http://localhost:8006/discover-authoring , and you should be able to see the Hello World! Message as defined in the experience manager

Page 33: Oracle Endeca Developer's Guide

Customize Cartridge Editor

Page 34: Oracle Endeca Developer's Guide

Experience Manager ImpactCartridge Editor Customization Previous

Now

Page 35: Oracle Endeca Developer's Guide

Save & Confirm ChangesIn Authoring View

Page 36: Oracle Endeca Developer's Guide

Customize Thumbnail ImageCustom Image & Dimension Create a custom JPG image in your favorite image

tool e.g. You can use Windows paint application

Images are typically of 81x81 dimension in Experience Manager (below are examples of default images)

Page 37: Oracle Endeca Developer's Guide

You can copy/save the custom thumbnail image on your web or image server

For this example, We are saving the image to below folder

Customize Thumbnail Image(Cont’d) – Common Location

Page 38: Oracle Endeca Developer's Guide

Customize Thumbnail Image(Cont’d) – Modify the Cartridge XML

We have commented the default ThumbnailUrl TAG, and customized the ThumbnailUrl TAG to use the Hello.jpg from the images folder where we saved this file in previous slide

NOTE: Remember to run the set_templates script in Control folder

Page 39: Oracle Endeca Developer's Guide

Customize Thumbnail Image(Cont’d) – Verify the changes