Skip to main content
Latest PyPI version https://github.com/collective/collective.immediatecreate/actions/workflows/test.yml/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg

Folderish types are designed to be able to contain content. When you use collective.folderishtypes (or any custom folderish types) in Plone and you simply add a folderish item on edit (like an image in TinyMCE), then after adding you will see that all the assets you upload through the editor will be stored as siblings of the item you just created. This is due to the fact that the new item does not “exist” yet - it is just an add-form - that is, before it has been saved once.

This addon creates the object immediately, so items can be stored inside.

Features

ID/ Shortname

A valid (and intermediate) ID will be generated after “add <Type>…” has been clicked, so the item can be persisted. However, the ID changes when the user saves the content for the first time so the Plone’s default behavior is retained. This feature might not be wanted by some users and is configureable (todo).

Verification

Additionally the drop-in-feature covers the usecase when an added type has mandatory fields or custom verification. All verification tasks are performed as usual when the user saves an item.

Cancel becomes Delete

When the user interacts with the item after it has been automatically created the “cancel” button is turned into a “delete” button. If the cancel button is clicked, the item will be discarded.

Cleanup

In order to get rid of initially created but never saved nor deleted items, a cleanup script is provided.

Installation

Install collective.immediatecreate by adding it to your buildout:

[buildout]
# ...
eggs =
    collective.immediatecreate

and then running bin/buildout

Restart Plone and install Immediate Create in control panel under addons.

Activation

After installation nothing changed. The feature must be activated for a content-type first. To make a type available for immediate create, two changes need to be done:

  1. Add the behavior collective.immediatecreate to the type in the control panel under Dexterity Content Types

  2. Modify the Factory Type Information using the ZMI under portal_types. Change the value of Add view URL (Expression) to ++addimmediate++TYPENAME.

Configuration using GenericSetup

In a policy profile in filesystem the a Type Information under profiles/default/types/TYPENAME.xml can be edited to make a type aware of immediate create:

<?xml version="1.0"?>
<object
  i18n:domain="plone"
  meta_type="Dexterity FTI"
  name="MyFolderishType"
  xmlns:i18n="http://xml.zope.org/namespaces/i18n">

  <!-- ... SNIP ... -->

  <property name="add_view_expr">string:${folder_url}/++addimmediate++MyFolderishType</property>

  <!-- ... SNIP ... -->

  <!-- Enabled behaviors -->
  <property name="behaviors" purge="False">
    <element value="collective.immediatecreate" />
  </property>

  <!-- ... SNIP ... -->
</object>

Cleanup

A cleanup script can be called as Manager user. It removes all stalled creations older than two hours. It is named @@immediatecreate-cleanup-leftovers. You may want to use a cron service of your choice to call it recurring.

Source Code

The sources are in a GIT DVCS with its main branches at github. There you can report issue too.

We’d be happy to see many forks and pull-requests to make this addon even better.

This package uses the black coding style with 79 chars line length.

Support

Maintainers are Jens Klein, Gogo Bernhard, Markus Hilbert and the BlueDynamics Alliance developer team. We appreciate any contribution and if a release is needed to be done on pypi, please just contact one of us. We also offer commercial support if any training, coaching, integration or adaptions are needed.

If you are having issues, please let us know.

License

The project is licensed under the GPLv2.

Contributors

Changelog

2.0.1 (2023-07-20)

  • Fix cancel button on form validation if immediate create for has a validation error. [jensens]

2.0.0 (2023-06-14)

  • Towards Plone 6, Python 3 (only). [jensens]

1.0a3 (2018-11-07)

  • added ImmediateAddedEvent.[iham]

  • fixed code-styles. [jensens]

1.0a2 (2018-09-12)

  • fixed locking [iham]

  • robot test added [llisa123]

1.0a1 (2018-06-23)

  • Initial release. [jensens]

Release files for collective.immediatecreate 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.immediatecreate 2.0.1
File Size Uploaded
collective.immediatecreate-2.0.1.tar.gz 242.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for collective.immediatecreate 2.0.1
File Interpreter ABI Platform
collective.immediatecreate-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 488.4 kB

Release files / collective.immediatecreate-2.0.1.tar.gz

Download URL collective.immediatecreate-2.0.1.tar.gz
Size 242.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a88c3df29794db5b5a9b6a43ce1af467514cc40eefd4baf0c57332a77716182e
BLAKE2b-256 checksum
How to use checksums
2ef4975ce510ea387b18fefdda3e52c81a4e9b761348156b427bc3c624aad72b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / collective.immediatecreate-2.0.1-py3-none-any.whl

Download URL collective.immediatecreate-2.0.1-py3-none-any.whl
Size 245.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb6ea398be51b18e023696ce7957be62da8624b338d48e0a90e95f09f9787e70
BLAKE2b-256 checksum
How to use checksums
a6d155e50278fab06adab77265698abd67ebcfe1e75224a368a864c58b496cde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page