Plugin to send and get data from neoCMS.
Based on Headless Cockpit CMS:
https://github.com/agentejo/cockpit

The neoCms plugin for VisualNEO Web, introduced in version 21.12.21, integrates with a custom version of the Cockpit Headless CMS, facilitating content management via API. This setup enables content creation and access without being tied to a specific output, making it ideal for flexible, API-driven applications. Installation can be performed locally or on a server.

For more detailed setup instructions and sample applications, visit the VisualNEO forum here.

Version: 1.3

Sample Apps:

https://visualneo.com/tutorials/neocms1
https://visualneo.com/tutorials/neocms2
https://visualneo.com/tutorials/neocms3
https://visualneo.com/tutorials/neocms4

 

Description

The neoCms plugin for VisualNEO Web integrates with the Cockpit Headless CMS, enabling applications to manage and retrieve structured content dynamically. Here are its main features and possibilities:

    • Content Collection Management:
      • neoCms allows creation, retrieval, updating, and deletion of items within content collections, which can be used to store structured data such as articles, products, or user profiles. Commands like neoCmsAddCollectionItem, neoCmsGetCollection, and neoCmsUpdateCollectionItem provide comprehensive CRUD (Create, Read, Update, Delete) functionality for content management.
    • Singleton and Form Management:
      • Developers can work with singletons for managing single-instance content (like site-wide settings) using neoCmsGetSingleton. Additionally, neoCmsGetForm and neoCmsSaveToForm allow form data retrieval and submission, supporting apps that need to collect and process user input data.
    • User Authentication and Permissions:
      • With commands like neoCmsLogin and neoCmsAddUser, neoCms supports user authentication and user management, allowing role-based access and user-specific permissions, essential for applications requiring secure and controlled content access.
    • Flexible API Calls:
      • The neoCmsCallApi command enables developers to make direct API calls, providing flexibility to interact with custom endpoints and manage advanced configurations, ideal for applications that need to interact with neoCms at a granular level.
    • Asset Management:
      • neoCms includes commands for managing assets (files and media) such as neoCmsGetAssets, making it possible to integrate multimedia content like images or documents into the app, enhancing content variety and user engagement.

The neoCms plugin is suited for applications that require a robust content management system, especially those that involve user authentication, content personalization, or multimedia integration​​.

neoCmsSetUrl

Purpose:

Set neoCms installation URL

Category:

neoCms

Syntax:

neoCmsSetUrl "theName" "theUrl"

 

theName

Instance name (neoCms unique id)

theUrl

neoCms installation URL (ie: https://mywebsite.com/cms)

 

neoCmsSetToken

Purpose:

Set neoCms access Token (Use with caution)
Use instead of neoCmsLogin to set a Token

Category:

neoCms

Syntax:

neoCmsSetToken "theName" "theToken"

 

theName

Instance name (neoCms unique id)

theToken

Access token

 

neoCmsLogin

Purpose:

User login. Use it to get user information and API key (it will replace token).
Each user can have different access permissions to neoCms APIs.
Endpoint: /api/cockpit/authUser

Category:

neoCms

Syntax:

neoCmsLogin "theName" "theUser" "thePassword" varObj varError theSub

 

theName

Instance name (neoCms unique id)

theUser

User name

thePassword

Password

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsLogout

Purpose:

User logout. Set access token to an empty string.

Category:

neoCms

Syntax:

neoCmsLogout "theName"

 

theName

Instance name (neoCms unique id)

 

neoCmsGetCollection

Purpose:

Get the data from a neoCms Collection
Endpoint: /api/collections/collection

Category:

neoCms

Syntax:

neoCmsGetCollection "theName" "theCollectionName" varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection name

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)


neoCmsGetCollectionNumItems

Purpose:

Get the number of items in a neoCms Collection
Endpoint: /api/collections/collection

Category:

neoCms

Syntax:

neoCmsGetCollectionNumItems "theName" "theCollectionName" varName varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection name

varName

Variable to store the number of items

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)


neoCmsGetOrderedCollection

Purpose:

Get the data from a neoCms Collection in order
Endpoint: /api/collections/collection

Category:

neoCms

Syntax:

neoCmsGetOrderedCollection "theName" "theCollectionName" "theFields" theLimit theSkip orderBy theOrder varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection name

theFields

Comma separated fields to retrieve (empty to get them all)

theLimit

Limit number of results to (0 for no limit)

theSkip

Items to skip

orderBy

Order by (field name or select metadata)

theOrder

Order direction

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsSearchCollection

Purpose:

Get filtered data from a neoCms Collection
For RegExp search method use a valid PHP regular expression without slashes.
Endpoint: /api/collections/get

Category:

neoCms

Syntax:

neoCmsSearchCollection "theName" "theCollectionName" "theFields" "theField" theValue "theMethod theLimit theSkip orderBy theOrder varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection's name

theFields

Comma separated fields to retrieve (empty to get them all)

theField

Field name to search into

theValue

Value to search for

"theMethod

Search method"

theLimit

Limit number of results to (0 for no limit)

theSkip

Items to skip

orderBy

Order by (field name or select metadata)

theOrder

Order direction

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsAddFilter

Purpose:

Add a search filter to a filter object. You can add many filters to the same object name. Use before neoCmsAdvancedSearchCollection

Category:

neoCms

Syntax:

neoCmsAddFilter "filterName" "theField" theValue "theMethod

 

filterName

Filter object name

theField

Field name to search into

theValue

Value to search for

"theMethod

Search method"

 

neoCmsAddOrderField

Purpose:

Add an order field an order object. You can add many order fields to the same object name. Use before neoCmsAdvancedSearchCollection

Category:

neoCms

Syntax:

neoCmsAddOrderField "orderName" orderBy theOrder

 

orderName

Order object name

orderBy

Order by (field name or select metadata)

theOrder

Order direction

 

neoCmsAdvancedSearchCollection

Purpose:

Get advanced filtered data from a neoCms Collection
Endpoint: /api/collections/get

Category:

neoCms

Syntax:

neoCmsAdvancedSearchCollection "theName" "theCollectionName" "theFields" theFilter theLimit theSkip orderName varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection's name

theFields

Comma separated fields to retrieve (empty to get them all)

theFilter

Filter object (use neoCmsAddFilter first)

theLimit

Limit number of results to (0 for no limit)

theSkip

Items to skip

orderName

Order object (use neoCmsAddOrderField first)

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsGetCollectionsNames

Purpose:

Get a list with all the neoCms Collections names.
Endpoint: /api/collections/listCollections

Category:

neoCms

Syntax:

neoCmsGetCollectionsNames "theName" varObj varError theSub

 

theName

Instance name (neoCms unique id)

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsGetCollectionSchema

Purpose:

Get a neoCms Collection schema.
Endpoint: /api/collections/collection

Category:

neoCms

Syntax:

neoCmsGetCollectionSchema "theName" "theCollectionName" varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection's name

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsAddCollectionItem

Purpose:

Add new item to a neoCms Collection.
Endpoint: /api/collections/save

Category:

neoCms

Syntax:

neoCmsAddCollectionItem "theName" "theCollectionName" theObject varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection name

theObject

Variable object with item data

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsUpdateCollectionItem

Purpose:

Update an existing neoCms Collection item.
Endpoint: /api/collections/save

Category:

neoCms

Syntax:

neoCmsUpdateCollectionItem "theName" "theCollectionName" theObject "theId" varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection name

theObject

Variable object with item data

theId

Item _id

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsRemoveCollectionItems

Purpose:

Delete existing neoCms Collection items that match search criteria.
Endpoint: /api/collections/remove

Category:

neoCms

Syntax:

neoCmsRemoveCollectionItems "theName" "theCollectionName" "theField" theValue "theMethod varObj varError theSub

 

theName

Instance name (neoCms unique id)

theCollectionName

Collection name

theField

Field name to search into

theValue

Value to search for

"theMethod

Search method"

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsSaveToForm

Purpose:

Save any variable object into a neoCms Form.
Endpoint: /api/forms/submit

Category:

neoCms

Syntax:

neoCmsSaveToForm "theName" "theFormName" theObject varObj varError theSub

 

theName

Instance name (neoCms unique id)

theFormName

Form name

theObject

Variable object to save

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsGetForm

Purpose:

Get the data from a neoCms Form
Endpoint: /api/forms/export/

Category:

neoCms

Syntax:

neoCmsGetForm "theName" "theFormName" varObj varError theSub

 

theName

Instance name (neoCms unique id)

theFormName

Form name

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

neoCmsGetSingleton

Purpose:

Get the data from a neoCms Singleton
Endpoint: /api/singletons/get

Category:

neoCms

Syntax:

neoCmsGetSingleton "theName" "theSingletonName" varObj varError theSub

 

theName

Instance name (neoCms unique id)

theSingletonName

Singleton name

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsGetSingletonsNames

Purpose:

Get a list with all the neoCms Singleton names.
Endpoint: /api/singletons/listSingletons

Category:

neoCms

Syntax:

neoCmsGetSingletonsNames "theName" varObj varError theSub

 

theName

Instance name (neoCms unique id)

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsGetAssets

Purpose:

Get assets information (files)
Endpoint: /api/cockpit/assets

Category:

neoCms

Syntax:

neoCmsGetAssets "theName" theField theValue "theMethod theLimit varObj varError theSub

 

theName

Instance name (neoCms unique id)

theField

Field name to search into

theValue

Value to search for

"theMethod

Search method"

theLimit

Limit results to (0 for no limit)

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsAddUser

Purpose:

Add new user to neoCms user group.
By sure to add and configure Group permissions first.
Endpoint: /api/cockpit/saveUser

Category:

neoCms

Syntax:

neoCmsAddUser "theName" "userName" "thePassword" "realName" "theEmail" "theGroup" theLanguage isActive varObj varError theSub

 

theName

Instance name (neoCms unique id)

userName

User nick name. No spaces nor special characters.

thePassword

User password

realName

User name

theEmail

User email

theGroup

Group (previously defined within neoCms)

theLanguage

User language

isActive

Set as active?

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsUpdateUser

Purpose:

Update user information in neoCms.
Left empty any field you don't want to update.
Endpoint: /api/cockpit/saveUser

Category:

neoCms

Syntax:

neoCmsUpdateUser "theName" "userId" "userName" "thePassword" "realName" "theEmail" "theGroup" "theLanguage" isActive varObj varError theSub

 

theName

Instance name (neoCms unique id)

userId

User _id (mandatory)

userName

User nick name. No spaces nor special characters.

thePassword

User password

realName

User name

theEmail

User email

theGroup

Group (previously defined within neoCms)

theLanguage

Language (ie: 'en' for english, 'es' for spanish...)

isActive

Set as active?

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsGetUsers

Purpose:

Get data from registered users
Endpoint: /api/cockpit/listUsers

Category:

neoCms

Syntax:

neoCmsGetUsers "theName" varObj varError theSub

 

theName

Instance name (neoCms unique id)

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsGetLocalizedStrings

Purpose:

Get localized strings of a project
Endpoint: /api/lokalize/project/

Category:

neoCms

Syntax:

neoCmsGetLocalizedStrings "theName" "theProject" "language" varObj varError theSub

 

theName

Instance name (neoCms unique id)

theProject

Project name

language

Language (ie: 'es', 'en', 'fr'... or 'All' to get them all.

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

neoCmsCallApi

Purpose:

Call a neoCms API endpoint directly (Advanced)

Category:

neoCms

Syntax:

neoCmsCallApi "theName" "theApi" [theObject] varObj varError theSub

 

theName

Instance name (neoCms unique id)

theApi

API endpoint

theObject

Object variable to send

varObj

Object variable to store results

varError

Variable to store error message (if any)

theSub

Callback subroutine (optional)

 

Created with the Personal Edition of HelpNDoc: Full-featured Kindle eBooks generator