Skip to content

OpenText Command Line it's not only a command line it's like programming language you can write our commands with native JavaScript code. this Tool is an open source tool for helping company to configure OT content server environment using some logic . The main advantage of OTCL is to write (your configuration) once and deploy everywhere.

Notifications You must be signed in to change notification settings

karimomaya/OTCL

Repository files navigation

OTCL

OpenText Command Line it's not only a command line it's like programming language you can write our commands with native JavaScript code. this Tool is an open source tool for helping company to configure OT content server environment using some logic . The main advantage of OTCL is to write (your configuration) once and deploy everywhere.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. Pull the repo onto your localmachine open cmd and type node server.js access the application from http://localhost:3001/ voila everything is working enjoy configure you application using simple commands line. for help you can press on the icon ? from the top right corner

Deployment

sudo npm install -g https://github.com/karimomaya/OTCL.git

OTCL Command line

ot-cli [options] [command]

Options: -V, --version output the version number -s, --server <url> OT server URL (default: "http://localhost/") -h, --help output usage information

Commands: run|r <script-file> run script file compile|c <script-file> <out-js-file> compile script file to js

Simple Commands

Authentication to Content Server

auth %username% %password%

Create Nodes

1- create document %name% , %parent id% , %document file system%
2- create folder %name% , %parent id%
3- create news %name%, %parent id%
4- create project %name%, %parent id%
5- create shortcut %name%, %parent id%
6- create task %name%, %parent id%
7- create task_group %name%, %parent id%
8- create task_list %name%, %parent id%
9- create task_milistone %name%, %parent id%

Delete Node

  • delete %node id%

Useful tips in creation Nodes

  • if you not specify a parent id by default it will set it below the enterprise
  • if you change parent id with folder path it will put it into that folder
  • or you can set only the parent id of the node

Get Folder ID by path

  • $pathID = get %path%

Get Sub Nodes

  • $objects = subnodes %node id%
    in the previous code you will get variable object that contains all a list of sub nodes properties you can iterate on it to see what it hold

Declare Categories

1- create folder called config under the project path
2- inside config folder create a file with extension .cat
3- make your category look like this

<?xml version="1.0" encoding="UTF-8"?>
<categories>
	<category>
		<name>%category name%</name>
		<type>%category type%</type>
	</category>
</categories>

4- Note: the Supported category is string, int and date

Create Categories

  • create category %name% , %parent id% , %name of the declaration catergory without extension%

set category

  • set category %node id% , %category id%

Declare permission

1- create folder called config under the project path
2- inside config folder create a file with extension .per
3- supported permissions add, delete, deleteversions, edit, editpermissions, modify, reserve, see, seecontent
4- make your permission look like this

<?xml version="1.0" encoding="UTF-8"?>
<permissions>
	<permission>
		<type>owner</type>
		<name>%owner name%</name>
		<access>%permission%</access>
	</permission>
	<permission>
		<type>ownergroup</type>
		<name>%owner group name%</name>
		<access>%permission%</access>
	</permission>
	<permission>
		<type>public</type>
		<access>%permission%</access>
	</permission>
	<permission>
		<type>user</type>
		<name>%username%</name>
		<access>%permission%</access>
	</permission>
	<permission>
		<type>group</type>
		<name>%group name%</name>
		<access>%permission%</access>
	</permission>
</permissions>
  • Note: if owner didn't set by default it will set the use that you authenticate with.
  • Note: write you permissions with comman seperated.

set permission

  • set permission %node id% , %name of the declaration permission without extension%

Write native Javascript code

<% for(var i=0; i< 10; i++){ %> create folder %name% , %parent id <%} %>

Examples

auth username password 
$cat = create category "category 1", 5961, "categoryConfiguration" // note that the variable cat hold the id of the category 
$folder = create folder "name", 5961
set category folder, cat // now you set the category you just created to the folder you just created :) 
$parentID = 5961
$x = 0
<% for(var i=0; i< 10; i++){ %> 
$x = create folder x, parentID 
<%} %>

About

OpenText Command Line it's not only a command line it's like programming language you can write our commands with native JavaScript code. this Tool is an open source tool for helping company to configure OT content server environment using some logic . The main advantage of OTCL is to write (your configuration) once and deploy everywhere.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published