Action creator for approving a Content in the Content Repository.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for checking in a Content in the Content Repository.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for check user state in a sensenet ECM application.
Returns a redux action with the properties.
Action creator for checking out a Content in the Content Repository.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for copying multiple Content in the Content Repository.
Returns a redux action with the properties type, id and permanently.
Action creator for the step when copying 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 was copied successfully.
response object contains the list of successes and/or errors.
Returns a redux action with the properties type and index.
Action creator for creating a Content in the Content Repository.
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 as a Content.
Returns a redux action with the properties type and the normalized response.
Action creator for deselecting a Content
Returns a redux action.
Action creator for deleting a Content from the Content Repository.
Content object 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.
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 was deleted successfully.
response object contains the list of successes and/or errors.
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.
Id 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.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for intializing a sensenet store.
Path of the root Content
Represents an ODataOptions object based on the IODataOptions interface. Holds the possible url parameters as properties.
Action creator for loading a content from sensenet Content Repository.
Path of the requested item.
Represents an ODataOptions object based on the IODataOptions interface. Holds the possible url parameters as properties.
Content Type of the requested content.
Returns a redux action with the properties id, options and contentType.
Action creator for loading Actions of a Content from sensenet Content Repository.
The requested Content.
The Actions should be in the given Scenario
Action creator for load repository config.
The repository config object.
Returns a redux action.
Action creator for moving multiple Content in the Content Repository.
Returns a redux action with the properties type, id and permanently.
Action creator for the step when moving 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 was moved successfully.
response object contains the list of successes and/or errors.
Returns a redux action with the properties type and index.
Action creator for publishing a Content in the Content Repository.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for the step when a fetching request ends successfully.
response of the ajax request as a Content array.
String with the url params.
Returns a redux action with the properties type, normalized response and params.
Action creator for the step when a Action loading request ends successfully.
JSON response of the ajax request.
Action creator for the step when a loading Actions request failed.
The catched error object.
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, params and errormessage.
Action creator for the step when a loading request ends successfully.
response of the ajax request as a Content object.
String with the url params.
Returns a redux action with the properties type, normalized response and params.
Action creator for the step when a loading request failed.
String with the url params.
The catched error object.
Returns a redux action with the properties type, params and errormessage.
Action creator for the step when a reloading request ends successfully.
Response of the ajax request as Content.
Returns a redux action with the properties type and the response.
Action creator for the step when a reloading request failed.
The catched error object.
Returns a redux action with the properties type and errormessage.
Action creator for the step when a reloading fields of a content request ends successfully.
Response of the ajax request as a Content.
Returns a redux action with the properties type and normalized response.
Action creator for the step when a reloading fields of a content request failed.
The catched error object.
Returns a redux action with the properties type and errormessage.
Action creator for rejecting a Content in the Content Repository.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for reloading a content from sensenet Content Repository.
The Content that shold be reloaded.
Name of the action witch which we want to reload the content (edit, new, etc).
Returns a redux action with the properties type and actionName.
Action creator for reloading fields of a content from sensenet Content Repository.
The Content which' fields should be reloaded.
List of the fields to be loaded
Returns a redux action with the properties type and fields.
Action creator for requesting a content from sensenet 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.
Content Type of the requested content.
Returns a redux action with the properties type, path, options and contentType.
Action creator for a request for get actions of a content by a given scenario.
The name of the scenario
The name of the scenario
Returns a redux action.
Action creator for the step when getting the actions of a content is failed
JSON response of the ajax request.
Returns a redux action with a response.
Action creator for the step getting the actions of a content successfully.
JSON response of the ajax request.
Returns a redux action with a response.
Action creator for restoring the version of a Content in the Content Repository.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for selecting a Content
Returns a redux action.
Action creator for undoing checkout on a Content in the Content Repository.
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 as a Content object.
Returns a redux action with the properties type and the normalized JSON response.
Action creator for updating a Content in the Content Repository.
Content 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 as a Content.
Returns a redux action with the properties type and the response.
Action creator for the step when uploading a content is failed
JSON response of the ajax request.
Returns a redux action with a response.
Action creator for uploading a Content into the Content Repository.
The parent Content
The file that should be uploaded
Returns a redux action with the properties type, content, file, contentType, overwrite, body and propertyName.
Action creator for the step when a content was uploaded successfully.
JSON response of the ajax request.
Returns a redux action with a response.
Action creator for user changes.
User that should be checked.
Action creator for login a user to a sensenet portal.
Login name of the user.
Password of the user.
Returns a redux action with the properties userName and password.
Action creator for handling a user login success response without a loggedin user.
Response of the login request
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.
Returns a redux action with the user as a response.
Action creator for logout a user from a sensenet 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 sensenet built-in action. Since this sensenet 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 sensenet 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"; dispatch(Actions.createContent(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 sensenet = Reducers.sensenet; const myReducer = combineReducers({ sensenet, listByFilter }); const store = Store.configureStore(myReducer);