Skip to content

Instantly share code, notes, and snippets.

View aakash14goplani's full-sized avatar
🎯
Focusing

Aakash Goplani aakash14goplani

🎯
Focusing
View GitHub Profile
@aakash14goplani
aakash14goplani / OOTB_Asset_Include.md
Last active March 20, 2019 12:32
Out of the Box Asset Include Button for CKEditor

The Aim is to design an element to be used with custom file link i.e. Out of the Box Asset Include Button for CKEditor

  1. Create Template
  2. For Asset Type: Required asset type for which custom link/button is required. For sake of example I will go with Image File Asset.
  3. Applies to subtypes: Any (preferably)
  4. Legal Arguments: This is very important point. you need to provide arguments which you want while uploading an image (per my example). Here I want to enter alt text and image alignment value when Image is to be embedded in CKEditor.
    • Enter the Argument name. e.g. "Alignment" and then enter corresponding values. = Element Usgae: Set this to "Usage Unspecified"

OOTB 11

@aakash14goplani
aakash14goplani / Create_asset_using_rest_api_AJAX.md
Last active November 5, 2018 11:08
Create flex asset using REST API and AJAX
<%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"
%><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"
%><%@ taglib prefix="render" uri="futuretense_cs/render.tld"
%><%@ page import="com.fatwire.wem.sso.*"
%><cs:ftcs>
	<%-- Record dependencies for the SiteEntry and the CSElement --%>
	<ics:if condition='<%=ics.GetVar("seid") != null%>'>
		<ics:then>
			<render:logdep cid='<%=ics.GetVar("seid")%>' c="SiteEntry" />
@aakash14goplani
aakash14goplani / Create_asset_using_rest_api_java.md
Last active November 5, 2018 10:43
Create flex asset using REST API and Java

Make sure you have following jars in your class path

cas-client-core-3.1.9.jar 
commons-logging-1.1.3.jar
hk2-api-2.3.0-b05.jar
hk2-locator-2.3.0-b05.jar
hk2-utils-2.3.0-b05.jar
javax.inject-2.3.0-b05.jar
javax-servlet-api-3.0.1.jar
javax-ws-rs-api-2.0.jar
@aakash14goplani
aakash14goplani / REST_OPERATIONS_OWCS.md
Last active May 28, 2024 17:43
REST API operations in OWCS

1. CRUD Operation

There is sample code for using the Java REST API in the WebCenter Sites install package, under misc\Samples\WEM Samples\REST API samples. You can check this code:

  1. CreateAsset.java
  2. UpdateAsset.java
  3. DeleteAsset.java
  4. ReadAsset.java

2. Setting Associations Using Java REST API in WebCenter Sites

  1. Read the asset
@aakash14goplani
aakash14goplani / REST_API_OWCS.md
Last active November 5, 2018 11:39
REST API OWCS Introduction

The current REST APIs (for v11.x.x) allow you to the following:

  • Read, create and delete Asset Types and read subtypes
  • Create, read, edit and delete assets
  • Read the asset associations for a specific asset
  • Search for assets by asset type, by site, by site and asset type, search assets globally
  • Create, read, edit and delete search indexes
  • Create, read, edit and delete a Site
  • Read the site plan tree
  • Create, read, edit and delete Roles
@aakash14goplani
aakash14goplani / REST_API_TO_JSON_OWCS.md
Last active November 5, 2018 10:49
Get REST request to reply in JSON format rather than XML in OWCS

Send the request with Accept header set to application/json.

You can test this with FireFox by adding application/json near the front of the network.http.accept.default as follows:

  1. Open the URL about:config.

  2. Click "I'll be careful, I promise!"

  3. Search for network.http.accept.default.

@aakash14goplani
aakash14goplani / unshareAssets.md
Last active August 8, 2018 15:06
Unshare assets from Site

Unshare Assets from one site

To unshare asset you have to follow same process as you did in share asset, just one change - you have to mention only source publication id.

<asset:share name="publishAsset" publist='<%=source_pubid %>' /><% 

Unshare assets from all sites

@aakash14goplani
aakash14goplani / AssetAPIandDataTypes.md
Last active August 7, 2018 16:14
Updating various Data Types using Asset API

General Configuration

Session sessionFactory = SessionFactory.getSession();
AssetDataManager assetDataManager = (AssetDataManager)sessionFactory.getManager(AssetDataManager.class.getName());			
MutableAssetData mutableAssetData = null;

mutableAssetData = assetDataManager.newAssetData(assetType, flexDefinition); //flex
mutableAssetData = assetDataManager.newAssetData(assetType, ""); //basic
@aakash14goplani
aakash14goplani / OWCS_Git.md
Last active July 10, 2018 17:05
Setting Up a Development Environment in Oracle WebCenter Sites

This blog post will outline a detailed, step-by-step guideline to set up an Oracle WebCenter Sites (OWCS) development environment that runs on Tomcat, connects to Git and integrates with Eclipse and the Content Server Developer Tools (CSDT).

  1. Install a fresh OWCS JumpStart Kit (JSK), with no sample sites
    • The JSK could be a fresh local installation of OWCS
  2. Start the JSK
<%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"
%><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"
%><%@ taglib prefix="render" uri="futuretense_cs/render.tld"
%><%@ page import="COM.FutureTense.Interfaces.*, com.fatwire.assetapi.def.*, java.util.*, com.fatwire.system.*"
%><%
 /******************************************************************************************************************************
   *    Element Name        :  Practice/Automation/DetermineAssetDatatypeAndValue 
   *    Author              :  Aakash Goplani 
   *    Creation Date       :  (07/07/2018)