COLNEO Pro 1.0
Loading...
Searching...
No Matches
ProjectAPI

Description

Project API interface.

Register with "cnProjectAPI".

The Project API provides project related functions such as ...

Since
1.0

Functions

PROJECT
ApiJsonResponse getInfo ()
 
ApiJsonResponse setInfo (QVariantMap &projectInfo)
 
ApiJsonResponse create (QVariantMap settings)
 
ApiJsonResponse open (QString filepath)
 
ApiJsonResponse saveAs (QString &filepath)
 
ApiJsonResponse archive (QString &filepath)
 
ApiJsonResponse getEvaluation ()
 
ApiJsonResponse getTemplates ()
 
ApiJsonResponse getRecentProjects ()
 
ApiJsonResponse removeRecentProject (QString &filename)
 
MACROS
ApiJsonResponse getMacros ()
 
ApiJsonResponse getMacroById (QString &id)
 
ApiJsonResponse createMacro (QVariantMap &macroAsJson)
 
ApiJsonResponse updateMacro (QString &id, QVariantMap &macroAsJson)
 
ApiJsonResponse deleteMacro (QString &id)
 
ApiJsonResponse runMacro (QString &id)
 
INFOHUB
ApiJsonResponse getInfohubSettings ()
 
ApiJsonResponse setInfohubSettings (QVariantMap &settings)
 

Events

 macroFinished (QString &macroId, bool success)
 

Public Member Functions

Constructors/Destructor
Interface IApiObject
QString & getApiObjectName ()
 

Function Documentation

◆ archive

ApiJsonResponse archive ( QString & filepath)
slot

Creates a project archive (zip).

Parameters
filepath
Returns
{
key: value
}
Since
1.0.0

◆ create

ApiJsonResponse create ( QVariantMap settings)
slot

Create a new, empty project.

Parameters
settings
{
name: "",
code: "",
description: ""
}
Returns
Since
1.0

◆ createMacro

ApiJsonResponse createMacro ( QVariantMap & macroAsJson)
slot

Create a new macro. If no ID is specified, it is generated automatically.

Parameters
macroAsJsonObject holding the data
{
name: "MyMacro",
desc: "Set all object visible in domain design",
code: "cnCoreAPI.setVisibleAll(true, \"geo\")",
actionName: ""
}
Returns
ID of new macro
data : string
Since
1.0, May 2025

◆ deleteMacro

ApiJsonResponse deleteMacro ( QString & id)
slot

...

Parameters
id
Since
1.0.0, ...

◆ getApiObjectName()

QString & getApiObjectName ( )
Returns
'cnProjectAPI'

◆ getEvaluation

ApiJsonResponse getEvaluation ( )
slot

...

Returns
{
key: value
}
Since
1.0.0

◆ getInfo

ApiJsonResponse getInfo ( )
slot
Note
Usable with script properties

Get project information.

Returns
{
"filePath": "C:/Documents/COLNEO Projects/Test/test.cnp",
"id": "",
"name" : "Test",
"shortDescription" : "",
"createdBy": "max@colneo.email",
"createdOn": "2025-04-09T08:41:17.054Z",
"budget": "",
"client": "",
"description": "Test Project",
"executionPeriod": "",
"projectNumber": "",
"projectPhase": "",
"savedBy": "max@colneo.email",
"savedOn": "2025-04-09T08:41:17.055Z",
"savedWithVersion": "1.0.0",
"scope" : "",
"shortId" : ""
}
Since
1.0, 04.2025

◆ getInfohubSettings

ApiJsonResponse getInfohubSettings ( )
slot
Note
Usable with script properties

Get infohub settings such as scope and project shortid,

Returns
data : {
'scope' : ' ... ',
'project_shortid' : ' ... '
}
Since
1.0, Apr 2025, jh

◆ getMacroById

ApiJsonResponse getMacroById ( QString & id)
slot

Get macro data with specified ID.

Parameters
idID of macro.
Returns
{
id: "",
name: "",
desc: "",
code: "",
actionName: ""
}
Since
1.0, May 2025

◆ getMacros

ApiJsonResponse getMacros ( )
slot

Get list of available macros in project.

Returns
List of macro IDs.
data : Array<string>
Since
1.0, May 2025

◆ getRecentProjects

ApiJsonResponse getRecentProjects ( )
slot

Get recent project as list.

Returns
Array with recent project records.
[
{
code: "12345",
name: "MyProject",
lastOpenedOn: "2024-01-01T12:21:04",
lastOpenedBy: "User",
fileName: "C:/Tmp/test.cpn"
},
{
code: null
name: "ABC",
lastOpenedOn: "2024-05-22T08:15:00",
lastOpenedBy: "User",
fileName: "C:/Tmp/abc.cpn"
}
]
Since
1.0.0, ...

◆ getTemplates

ApiJsonResponse getTemplates ( )
slot

...

Returns
{
key: value
}
Since
1.0.0

◆ macroFinished

macroFinished ( QString & macroId,
bool success )
signal

Set visible columns from bookmark.

Parameters
bkmId
domainCode
Since
1.0.0, ..., sl

Create a bookmark in the given tree structure.

Parameters
domainCode
bookmarkAsJson
Returns
ID of the newly created bookmark
Since
1.0.0, ..., sl

Delete the bookmark with the given ID. The bookmarks for each tree structure are searched for the ID.

Parameters
id
Returns
Since
1.0.0, ..., sl

◆ open

ApiJsonResponse open ( QString filepath)
slot

Open the project from a given file path.

Parameters
filepath
Returns
true, if project was opened successful, otherwise false
{
key: value
}
Since
1.0

◆ removeRecentProject

ApiJsonResponse removeRecentProject ( QString & filename)
slot

Removes a recent project with the given filename from the recent project list

Returns
success message or error code
{
}
Since
1.0.0, ...

◆ runMacro

ApiJsonResponse runMacro ( QString & id)
slot

Run (evaluates) a macro

Parameters
idID of macro.
Returns
Result of evaluation
Since
1.0.0, 2025-02-05

◆ saveAs

ApiJsonResponse saveAs ( QString & filepath)
slot

Saves the project under the current file path.

Returns
{
key: value
}
\since 1.0.0
/
/*!
Saves the project under a new file path.
\param filepath
\returns
\code
{
key: value
}
Since
1.0.0

◆ setInfo

ApiJsonResponse setInfo ( QVariantMap & projectInfo)
slot

Set Project Information.

Returns
{
data:
}
Since
1.0.0

◆ setInfohubSettings

ApiJsonResponse setInfohubSettings ( QVariantMap & settings)
slot

Set infohub settings such as scope and project shortid

Parameters
settings
{
'scope' : ' ... ',
'project_shortid' : ' ... '
}
Since
1.0, Apr 2025, jh

◆ updateMacro

ApiJsonResponse updateMacro ( QString & id,
QVariantMap & macroAsJson )
slot

Update a macro. The ID cannot be changed!

Parameters
id
macroAsJson
Returns
True, if macro was updated (changed!) successfully
data : boolean
See also
createMacro()
Since
1.0, May 2025