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 (QString key=QString())
 
ApiJsonResponse setInfo (QVariantMap &projectInfo)
 
ApiJsonResponse create (QVariantMap settings)
 
ApiJsonResponse open (QString filepath)
 
ApiJsonResponse saveAs (QString &filepath)
 
ApiJsonResponse archive (QString &filepath)
 
ApiJsonResponse close ()
 
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)
 

Function Documentation

◆ archive

ApiJsonResponse archive ( QString & filepath)
slot

Creates a project archive (zip).

Parameters
filepath
Returns
{
data: ...
}
Since
1.0.0

◆ close

ApiJsonResponse close ( )
slot

Closes the current project without confirmation. Handle with care!

Returns
{
data: void
}

◆ 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, ...

◆ getEvaluation

ApiJsonResponse getEvaluation ( )
slot

...

Returns
{
key: value
}
Since
1.0.0

◆ getInfo

ApiJsonResponse getInfo ( QString key = QString())
slot

Usable in scripted properties

Get project information.

Parameters
keyIf specified, only the corresponding attribute is returned, otherwise the entire object.
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, Jul 2025

◆ getInfohubSettings

ApiJsonResponse getInfohubSettings ( )
slot
Note
Usable with script properties

Get infohub settings such as scope and project shortid which store the connection between the local COLNEO pro project and a project on infohub.

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

◆ 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
{
data: boolean
}
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