Showing posts with label SDL Tridion Sites 9. Show all posts
Showing posts with label SDL Tridion Sites 9. Show all posts

Thursday 29 August 2019

SDL Tridion Sites 9.1 New Feature Integration Framework

Today SDL released the latest version SDL Tridion Sites 9.1 and in this release we have so many new features, but today we are going to discuss the SDL Tridion Integration Framework. These features enable you to quickly connect with your DAM, CRM, ERP, Marketing Automation, Commerce, PIM, Portal technology, Analytics, and Social Media platforms.

In this blog we will see how Unified Extensions/Connectors build using this framework will simplify the process of deploying multiple extensions in SDL Tridion Sites it combines multiple extensions that should be deployed together as a single solution. We can pack all together Content Manager, Content Manager Explorer, Dynamic Content Delivery and External Content Library extensions.

With EMS the problems that it solves is, we don't have to do configuration on multiple places, no need to restart services and IIS, one single package for multiple extensions and one of the biggest advantage is it supports scaled out environments - so if you have 3 x CM, 5 x publishers, etc. it's a one drop shop.


The package that is built contains.
  • Single zipped file
  • Manifest.json in the root of the zip
  • All reference to jars, dlls and other resources in the manifest.json file will be relative to the root of the zip
  • Dependent jars and dlls should be in the same folder as the source jar or dll
SDL released number of ready made connectors for us, we can download it from  https://appstore.sdl.com/

  1. Adding existing connector [Read More] If the Connector you are adding is written in C# (.NET Core), ensure that version 2.2 of the .NET Core Runtime is installed on the host machine the Content Service. Download the .NET Core Runtime for either Windows or Linux from the following location: https://dotnet.microsoft.com/download/dotnet-core/2.2
  2. Build a new connector [Read More]




In the next blog, we will be creating Extensions until then. 

Happy Coding and keep Sharing!!!
  

Sunday 16 June 2019

Extending Content Delivery Storage in SDL WEB 8.5 - Part 3

In the last blog, we saw what happened when we publish a new component, it only calls the create method, but when we re-publish an item it first calls the remove method and then create.

Remove Method


public void remove(int publicationId, int componentId, int componentTemplateId, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
log.debug("Custom storage remove Method");
super.remove(publicationId, componentId, componentTemplateId, componentPresentationType);
log.debug("Custom storage remove Method :- "+componentId);
 
}
Re-Publish an item


As you can see when I re-published an item, we have remove method invoked first and then create method. Next, is un-publish an item and see how it works/ in what sequence.


Un-Publish an Item

When we publish a new item only create method is called, re-publishing will call the remove method and then create and finally in un-publish only remove method is called.   


In the last two blogs, we learned how to set up and configure the project to build storage extension and Publishing a new item and in this blog, we saw other functionalities as well and how they are invoked, in what sequence/order, with this approach we can add/update/remove DCPs in custom storage e:g SOLR, ElasticSearch, MongoDB, etc.

This data can further be used for analytics and for third-party applications.


Happy Coding and Keep Sharing !!!



Extending Content Delivery Storage in SDL WEB 8.5 - Part 2

In the previous blog, we set up the project and configured all the required config and based on that we published a DCP and saw custom logs are available which means everything is working fine.

Today we are going to read the content of DCP and will see how Storage Extension work when we publish, re-publish and un-publish an item.

The Content is available in the form of Bytes and we need to convert that, below is the code snippet that will allow you to access the DCP content in your custom code.

public void create(ComponentPresentation itemToCreate, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
          super.create(itemToCreate,componentPresentationType);
          log.debug("Custom Code Create Method COMID :- " + itemToCreate.getComponentId());
          log.debug("Custom Storage create Method:- "+ itemToCreate.getContent());
          log.debug(String.valueOf(itemToCreate.getComponentId()));
          byte[] dcpComponent= itemToCreate.getContent();
          try
          {
                  componentPresentation = new String(dcpComponent,"UTF-8");
                  log.debug("Custom Storage create DCP :- " + componentPresentation);
          }
          catch (UnsupportedEncodingException ex)
          {
                  log.error("Custom Storage create Unsupported " + ex);
          }

}

DCP content

Publish a new component and in the deployer log file, you will see the DCP content but what will happen when we re-publish the same component or un-publish this. How we are going to manage that in the custom code, will see in the next blog, until then.


Happy Coding and Keep Sharing !!!





Saturday 13 April 2019

SDL Tridion sites 9 PCA with REACT - Part 2

In the previous post, we saw how to set up the project using Apollo Client, ReactJS and interact with Tridion Sites 9 PCA. We also build a new schema, Dynamic CT and published 3 components using the Dynamic CT in order to retrieve them via PCA (GraphQL).

In the last exercise, we rendered the list of Dynamic News Components on the Landing page. Today we are going to continue using the same code and build the Details page and later on will see the deployment process and how to deploy ReactJs App.

So, let's start with the News details page, we already created the landing page and while doing that we had sufficient information to get the DCP of that particular component. If you have noticed in the code or screenshot from my last blog the Href that I've created for each News and Article items contains the combination of ItemId and CT and we need that same combination to get the Component Presentation.

DCPs with ItemID-CT available on Landing Page

Here are the JSX and Graphql code to render the News details page

News Detail Page

Here is the News and Article Details page again not a very attractive UI 😊.

Details Page

Let's build the App and see how's the production-ready build looks like. The below commands build the deployment package after npm build we need to run serve -s from the build folder and this will spin the Website

 $ npm run build
 $ serve -s

Build Package

Final Output 

Final Build

The updated code is available on GitHub and in the next blog, we will see more features works until then.

Happy Coding and Keep Sharing !!!


SDL Tridion sites 9 PCA with REACT

Tridion sites 9 PCA is getting popular more and more every day, and today in this blog, we will be creating an app using Apollo Client to communicate with SDL Tridion GraphQL API. We will integrate Apollo Client with ReactJS, but you can use it with several other client platforms as well.

Setting Up The Project


To get started we first need to set up a new React project. The easiest way to do so is to use create-react-app. This script creates a new React project.
 npm install -g create-react-app react-graphql  
 cd react-graphql  
 npm start  

with this, you will have the default app up and running on port number 3000, This is initiating a new basic React project in the newly created project folder react-graphql. By using the npm start to command the live-reloading development web server is started and the output of the default React project can be accessed in the browser:

Default ReactJS

In order to work with GraphQL, we have to install Dependencies. The next step is to install the needed dependencies.

  • apollo-boost: Package containing everything you need to set up Apollo Client
  • react-apollo: View layer integration for React
  • graphql-tag: Necessary for parsing your GraphQL queries
  • graphql: Also parses your GraphQL queries
The installation of these dependencies can be done by using the following NPM command

 $ npm install apollo-boost react-apollo graphql-tag graphql  

Project Structure 
As you can see I've imported react-apollo in order to work with GraphQL. In today's demo, we will see how to get the Dynamic Component Presentation and reder the same in React based webapp. To start this I've created a new schema with Title and Description as content fields and used the default DXA standard Metadata Schema as well.

Based on this new schema I've created 3 new components and published them using Dynamic CT. They are now available via PCA.
3 DCPs for Demo Purpose

DCPs via GraphiQL

Next, is call PCA using Apollo Client and ReactJS and render the DCPs.

Here is the query to get all the DCPs to render them on the News and Article Landing page.
 const repoQuery = gql`  
  query  
 {  
  componentPresentations(namespaceId: 1, publicationId: 11, filter: {schema: {id: 789}}) {  
   edges {  
    cursor  
    node {  
     itemType  
     rawContent {  
      data  
     }  
    }  
   }  
  }  
 }  
 `  

Based on the query criteria we are getting 3 DCPs which is correct

PCA output

Next, Display the Data

Let's write some JSX to display the fetched data. I'm fetching/rendering the data from both Metadata and Content fields, just to test the feasibility/flexibility and syntax.

 class News extends Component {  
  render() {  
   console.log(this.props)  
   return (  
    <div>  
     <h2>News and Articles Landing Page</h2>   
     {  
      this.props.data.loading === true ? "Loading" :   
       this.props.data.componentPresentations.edges.map  
       (  
        data =>  
       <ul key={data.node.rawContent.data.Id}>  
       <li style={{fontWeight: 'bold'}}>  
         <a href={"newsdetails?ids="+data.node.rawContent.data.Id +  
          "&name="+data.node.rawContent.data.Content.title.replace(/[^a-zA-Z0-9]/g, '-')}>  
          {data.node.rawContent.data.Content.title}  
         </a>  
       </li>  
       <p>  
        {  
         data.node.rawContent.data.Metadata.metadata.description  
        }  
        </p>  
      </ul>  
       )  
     }  
    </div>  
   );  
  }  
 }  


And Finally, our News and Article Landing page with DCPs is ready, not the very attractive UI though 😊 

DCPs Rendering on ReactJS app
In the next blog, we will be creating News details page and will try to implement search and other features as well. 
You can download the sample application from GitHub, don't forget to update the PCA URL 

Happy Coding and Keep Sharing !!!! 

Saturday 6 April 2019

Hybrid Architecture SDL WEB 8.5 and SDL Tridion Sites 9

Well, In my previous post we saw how we can use GraphQL with SDL WEB 8.5 by simply installing Tridion Sites 9 Content Service that will work isolated and read data from 8.5 Broker. But, this has some limitations I saw some difference in the Broker Database of 8.5 and Tridion 9.e:g The "Component Presentation" table has a new column CONTENT_ID in the Tridion 9 Broker. This field is not there in the 8.5 Broker and this caused an issue while accessing Dynamic Component Presentations using GraphQL.

To, sort any such issues which we might face, we discussed the new Hybrid approach where we will have the Tridion 9 Broker and State Store Database with Tridion 9 Services Discovery, Deployer, and Content service running parallelly with 8.5 CMS .


High-Level Architecture Diagram

  1. Install Tridion 9 Broker and State_Store Database (As per the recommendation by SDL we need to install SQL Server 2016 SP2 or 2017).
  2. Update storage configuration as per the new Tridion 9 DB details in the Tridion 9 Discovery, Deployer and Content service(These services could be on the same box or in a new) and then install the services.
  3. After installation of service run the “java -jar discovery-registration.jar update” from discovery service config folder. This command will register the discovery service capabilities.
  4. The above steps/command will set up the services for the content delivery environment.
  5. Next is create a new topology manager in order to set the publishing
    1. We need to keep 8.5 and Tridion 9 broker DB in sync. So that we can run existing  8.5 and at the same time we should be able to query Tridion 9 Broker DB using GraphQL.
    2. We need targets that will publish to both the Brokers (e:g WEB8_Staging, Tridion9_Staging, WEB8_LIVE, and Tridion9_LIVE). This will keep the existing env. working and at the same time, we can use Graphql.
      • WEB8_Staging will point WEB 8 Staging Discovery 
      • Tridion9_Staging will point to Tridion 9 Staging Discovery
  6. There is another advantage here, so when you MIGRATE from CM 8.5 to Tridion 9 you already have your Broker DB up-to-date, content delivery microservices are already working.
The above setup will let you continue with the 8.5 and it will also give us the privilege to use GraphQL as well.


Happy Coding and Keep Sharing !!!

Thursday 4 April 2019

SDL India Tridion DX Summit 2019

Yet another successful, knowledgeable and full of fun SDL Tridion DX DEV Summit 2019,  where people from across the globe participated and shared their thoughts and knowledge.

I would like to thanks to the organizers SDL and all the sponsors and special thanks to all the members of the SDL India community, who made this event possible. People from the different regions joined in this event and shared their knowledge, experiences with others. The event was scheduled for 2 days, where more than 14 speakers participated and 16 sessions.

Highlights of this year SDL Tridion DX India Dev Summit   
Day 1, 29th March 2019

We started with celebrating the 10th anniversary of the MVP program where Sagar Hasamnis (Senior Director, SDL) presented his thoughts about this program and thanked the SDL community.

Jim Saunders (Chief Product Officer, SDL) Keynote speaker presented the vision and future of AI & The digital transformation of content he also demonstrates how this SDL helps us in the entire process from starting form Content Creator to Content Consumers.

After that, Ivo van de Lagemaat (Tridion DX Product Owner), he explained the SDL Tridion DX Roadmap and there was another session on the latest Extensions Management System where he explained the new Unified Extensions and its features, and how it will help in deployment and the best part is it will support the scale out. so if you have 2x CM and 4x Publishers it is a one-stop shop. I will be writing a separate blog on this starting with the Installation process, Features, and benefits.

Next speaker was Venu Ireddy (Solution Architect, SDL), Venu explained the features of DXA 2.1, and Search Module using Elastic Search and he also explained the difference between DXA 2.0 and 2.1.

After the amazing Lunch, it was Pankaj Gaur (Director, Content Bloom India) who started interacting with Audience with MentiMeter Game and then he presented how we can use SDL Tridion sites 9 feature Graphql with 8.5 also, we all loved it. 

The last two sessions were taken by Naveen (Senior Consultant, SDL)  presented the Tridion Docs, DD Module, and GUI using React and DXA  and Rajesh Kumar (Technical Architect, Global Solutions, SDL) presented the new Content API & GraphQL with React based Web application.


Day 2, 30th March 2019

SDL ecosystem from Wilhard Rass (VP Professional Services, SDL) gave us brief information about what is going on in the SDL Tridion world, what cloud service has to offer and about the Partners and their roles.

The Experience Manager DEMO and features this was explained by Venu Ireddy (Solution Architect, SDL). Content Editors are really going to like this new GUI.

After the first session on day 2, we decided to have some fun and we played “dumb-charade”.

Next, Presenter was Manish Mehmood(Technical Consultant, Content Bloom India), Manish showcase how to customize the exiting DXA Form Module.

I also got the opportunity to present and my topic was How to Scale-out Publishing in Tridion sites 9 using Split deployers (Deployers Endpoint, Deployer Workers, Redis, ActiveMQ).[here]

Mark Van der wal (Chief Architect Cloud Operations)  explained SDL cloud offerings, its advantages, and features.

Neetesh and Shalivahan (Technical Consultants, SDL) They explained the TridionDocs API integration this was the last session and we before all say goodbye, Event Closer by Sagar Hasamnis.   








Happy Coding and Keep Sharing!!

Monday 4 March 2019

SDL Tridion Sites 9 Content API GraphQL with SDL WEB 8.5

Recently, One of our customers requested this, can we have new SDL Tridion Sites 9 feature GraphQL in SDL WEB 8.5. They have the following questions before we can proceed to POC.

The client is very excited about this new GraphQL feature as this will bring lots of improvement in their existing implementation. So, they wanted to know can we have this new feature in 8.5.

  1. Can the CD side be upgraded to Sites 9 to have the GraphQL API, but the CM be left on Web 8.5?
  2. Can only the content microservice be updated to Sites 9 (while leaving the Broker and Deployer on 8.5) 
  3. Broker and Deployer also have to upgrade to 9?

We also need to think about downtown while we do all these. 

We did some investigation and come up with this idea/approach that we are not going to upgrade anything here just to have the new Content API feature (GraphQL).

So, We decided to Install only the Tridion Sites 9 Content Microservice and this will read the data from existing WEB 8.5 broker DB. NOTE:- We are still running the 8.5 services here no upgrade yet on CM or CD side.

With this approach, we were able to deliver what the client was requested from us. Now they are running their existing site using 8.5 content delivery and parallelly they started planning on building apps using 8.5 broker data using Tridion sites 9 GraphQL API. 

It was an interesting POC.

WEB 8.5 Content Service


Tridion Sites 9 Content Service running on same ENV and hitting 8.5 Broker to fetch the data.


Happy Coding and Keep Sharing !!!



Thursday 15 November 2018

SDL Tridion Sites 9 New Feature - GraphQL

The New SDL Tridion sites 9 Content API uses GraphQL. GraphQL is a data fetching and Query Language for APIs. It was created by Facebook in 2012 and was open sourced in 2015.

Advantages of GraphQL
  1. Instead of making multiple endpoints call in REST version here in the just single endpoint we can get the data(JSON).
  2. Documentation is available online [click]
  3. Online Community support [click]
GraphQL can be used with multiple deceives, like Facebook developed this to power their mobile application.GraphQL can be used in any application, web application or mobile app many different programming languages support GraphQL [learn more].

So, let get back to the content API, when you install the content API you will see a new endpoint.
content API
Now, let run some query to get the data but first, we need to install GraphQL client tool, I have GraphiQL installed [download]

Let's run some sample queries.

Page content
Page
Component Presentation
Component Presentation 
Publication
Publication

To learn more, how to structure GraphQL queries the documentation about GraphQL query is available on SDL docs site you can refer that.[link]

Happy coding and keep sharing !!!

SDL Tridion Sites 9 with DXA 2.0 on Windows 10

On Wednesday 7th NOV, SDL Announces the new release SDL Tridion Sites 9 and I got this opportunity to explore this new version and today we are going to install the SDL Tridion 9 on Windows 10 (Not Recommended/supported by SDL though).

The first Step is Install Database by running the PowerShell scripts. I have MSSQL Server 2016 SP2 Developer Edition installed on my local machine and the following DBs are installed.


Next is run the SDLTridionSites9.exe installer but this time from the command line.

Once the step is finished successfully you would able to browse the SDL Tridion Sites 9.
SDL Tridion Sites 9

Next Step is Installed the Content Delivery Microservice and for that go to the installation media folder and navigate to \Content Delivery\resources\quickinstall

First, we need to update the setenv.ps1 and after the run the quickinstall.ps1 
setenv

After the quickinstall.ps1 stop executing go and check the windows services to confirm the service are installed properly and they are running as well.
Microservice
and last the discovery-registration.jar to update the capabilities.

So we finally able to install SDL Tridion Sites 9 and all Microservice on Windows 10 but we also need to updte the Topology Manager to be able to start Publishing and for that, we need to open PowerShell in Administrator mode and run the following command in the sequence.


 > Add-TtmCdTopologyType -Id "TOPOLOGYTYPEID" -Name "TOPOLOGYTYPENAME" -EnvironmentPurposes “PURPOSES”  
 > Add-TtmCdEnvironment -Id "CDENVIRONMENTID" -EnvironmentPurpose "CDENVIRONMENTPURPOSE" -DiscoveryEndpointUrl "DISCOVERYENDPOINTURL"   
 > Add-TtmCdTopology -Id "TOPOLOGYID" -Name "TOPOLOGYNAME" -CdTopologyTypeId "TOPOLOGYTYPEID" -CdEnvironmentIds "CDENVIRONMENTIDS"  
 > Add-TtmWebsite -Id "WEBSITEID" -CdEnvironmentId "CDENVIRONMENTID" -BaseUrls “BASEURLS”  

Once that is done you can create a dummy publication create BPT map that BPT with Topology Type, create SG and page and test publishing.

I've installed the latest DXA CMS import, Downloaded the DXA .NET Framework and we also need DXA-Model-Service from SDL official GitHub, after some tweak in the code I was able to run the DXA web application.
DXA CMS import

DXA WEB Application 


Happy coding and Keep Sharing !!!