Action creator for approving a Content in the Content Repository.
Id of the content that should be approved.
Returns a redux action with the properties type and id.
Action creator for the step when approving a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is approved successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for checking in a Content in the Content Repository.
Id of the content that should be checked in.
Returns a redux action with the properties type, id and checkinComment.
Action creator for the step when checking out a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is checked in successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for checking out a Content in the Content Repository.
Id of the content that should be checked out.
Returns a redux action with the properties type and id .
Action creator for the step when checking out a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is checked out successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for creating a Content in the Content Repository.
Path of the parent item.
Content that have to be created in the Content Respository.
Returns a redux action with the properties type, path of the parent and content.
Action creator for the step when Content creation failed on the server.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when Content creation on the server ends successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized response.
Action creator for deleting a Content from the Content Repository.
Id of the Content that has to be deleted.
Defines whether the a Content must be moved to the Trash or deleted permanently.
Returns a redux action with the properties type, id and permanently.
Action creator for deleting multiple Content from the Content Repository.
Path of the parent Content.
Array of ids of the Content that should be deleted.
Defines whether Content must be moved to the Trash or deleted permanently.
Returns a redux action with the properties type, id and permanently.
Action creator for the step when deleting multiple Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when multiple Content deleted successfully.
Array of indexes of the items in the state collection that should be removed.
Returns a redux action with the properties type and index.
Action creator for the step when deleting a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when Content deleted successfully.
Index of the item in the state collection.
Returns a redux action with the properties type and index.
Action creator for undoing checkout on a Content in the Content Repository.
Id of the content that should be checked in.
Returns a redux action with the properties type and id.
Action creator for the step when undoing checkout on a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is checked-in successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for publishing a Content in the Content Repository.
Id of the content that should be published.
Returns a redux action with the properties type and id.
Action creator for the step when publishing a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is published successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for the step when a fetching request ends successfully.
JSON response of the ajax request.
String with the url params.
Returns a redux action with the properties type, normalized response and filter.
Action creator for the step when a fetching request failed.
String with the url params.
The catched error object.
Returns a redux action with the properties type, filter and errormessage.
Action creator for rejecting a Content in the Content Repository.
Id of the content that should be rejected.
Reason of rejecting.
Returns a redux action with the properties type, rejectReason and id.
Action creator for the step when rejecting a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is rejected successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for requesting a content from Sense/Net Content Repository to get its children content.
Path of the requested parent item.
Represents an ODataOptions object based on the IODataOptions interface. Holds the possible url parameters as properties.
Returns a redux action with the properties type, path and filter.
Action creator for restoring the version of a Content in the Content Repository.
Id of the content that should be checked in.
Specify which old version to restore
Returns a redux action with the properties type and id.
Action creator for the step when restoring a previous version of a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is restored to a previous version successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for undoing checkout on a Content in the Content Repository.
Id of the content that should be checked in.
Returns a redux action with the properties type and id.
Action creator for the step when undoing checkout on a Content is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a Content is checked-in successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for updating a Content in the Content Repository.
Id of the Content that has to be updated.
Object with the field value pairs that have to be modified.
Returns a redux action with the properties type, id and fields.
Action creator for the step when Content modification failed on the server.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when Content modification on the server ends successfully.
JSON response of the ajax request.
Returns a redux action with the properties type and the response.
Action creator for login a user to a Sense/Net portal.
Login name of the user.
Password of the user.
Returns a redux action with the properties userName and password.
Action creator for the step when login of a user is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a User is logged in successfully.
JSON response of the ajax request.
Returns a redux action with the user as a response.
Action creator for logout a user from a Sense/Net portal.
Returns a redux action.
Action creator for the step when logging out of a user is failed.
The catched error object.
Returns a redux action with the properties type and the error message.
Action creator for the step when a user is logged out successfully.
JSON response of the ajax request.
Returns a redux action with a response.
Generated using TypeDoc
Module that contains the action creators.
Redux actions are payloads of information that send data from your application to your store. They are the only source of information for the store. You send them to the store using
store.dispatch(). Actions are plain JavaScript objects. Actions must have a type property that indicates the type of action being performed.Learn more about Redux actions here
Following are Redux actions but they're all related with a Sense/Net built-in action. Since this Sense/Net built-in actions are OData actions and functions and they get and set data throught ajax request we have to handle the main steps of their process separately. So there're three separate redux action for every Sense/Net action: one for the request itself and two for the two possible end of an ajax request, success and fail.
All of the JSON responses with content or collection are normalized so you shouldn't care about how to handle nested data structure, normalizr takes JSON and a schema and replaces nested entities with their IDs, gathering all entities in dictionaries. For further information about normalizr check this link.
[{ Id: 5145, DisplayName: 'Some Article', Status: ['Active'] }, { Id: 5146, Displayname: 'Other Article', Status: ['Completed'] }]is normalized to
result: [5145, 5146], entities: { collection: { 5145: { Id: 5145, DisplayName: 'Some Article', Status: ['Active'] }, 5146: { Id: 5146, Displayname: 'Other Article', Status: ['Completed'] } } }Following module now cover the CRUD operations, so it contains Actions which are related to fetching, creating, deleting and updating Content. Other built-in SenseNet OData Actions and Functions will be the parts of this module too and you are be able to add your custom Actions too by combining your reducers with the built-in ones.
Using built-in redux actions in your views
import * as React from 'react' import { connect } from 'react-redux' import { TextField } from 'material-ui/TextField'; import RaisedButton from 'material-ui/RaisedButton'; import { Actions } from 'sn-redux'; import { Content } from './SenseNet/Content'; let AddTodo = ({ dispatch }) => { let input return ( <div> <form onSubmit={e => { e.preventDefault() if (!input.value.trim()) { return } const content = new Content({ Type: 'Task', DisplayName: input.value }); content["Status"] = "active"; const ROOT_URL = 'https://mySite.com/OData.svc/workspaces/Project/budapestprojectworkspace/Tasks'; dispatch(Actions.createContent(ROOT_URL, content)) input.value = '' } }> <input className="textField" ref={node => { input = node } } /> <RaisedButton type="submit" primary={true} label="Add Todo" /> </form> </div> ) } AddTodo = connect()(AddTodo)Combining your custom redux reducers with sn-redux's root reducer.
import { combineReducers } from 'redux'; import { Store, Reducers } from 'sn-redux'; import { Root } from './components/Root' import { listByFilter } from './reducers/filtering' const collection = Reducers.collection; const myReducer = combineReducers({ collection, listByFilter }); const store = Store.configureStore(myReducer);