Code Monkey home page Code Monkey logo

Comments (10)

dbu avatar dbu commented on July 28, 2024

what is the purpose of those mixins? as long as they don't add any fields to the node, we do not need them.

from media-bundle.

rmsint avatar rmsint commented on July 28, 2024

then we can have an image and file with node type "nt:file". The mixins define the extra fields and make a document pass the validation

from media-bundle.

rmsint avatar rmsint commented on July 28, 2024

Also the Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\Directory can have the node type "nt:folder" then. Just found while testing elFinder that when moving a File (without "nt:file") as child of the Directory, with "nt:folder", results in the error

Can't add the child node "test-banner-550x109.png" for node type "nt:unstructured" because there 
is no definition for a child with that name.

from media-bundle.

dbu avatar dbu commented on July 28, 2024

yeah, nt:folder can only have nt:hierarchyNode as children.

from media-bundle.

dbu avatar dbu commented on July 28, 2024

@rmsint i think you missed my reply on irc for the metadata field: if its a phpcr-odm hashmap, it will actually be two properties, the second phpcr property for the keys. it should show in the phpcr dump of the properties when you store something in the metadata.

from media-bundle.

rmsint avatar rmsint commented on July 28, 2024

@dbu thx, I indeed missed it

Another question: for the cmf:file and cmf:image mixing the "cmf" namespace needs to be registered. Do we need to do this in the CoreBundle?

When running the tests with the mixins defined the error is:

PHPCR\ValueFormatException: Invalid PHPCR NAME at '/test/media/file-1.txt/jcr:mixinTypes': The namespace prefix cmf does not exist.

from media-bundle.

dbu avatar dbu commented on July 28, 2024

are you using a .cnd file? then you need to explain the namespace first thing. look at the code in RegisterSystemNodeTypesCommand of phpcr-odm for an example. if you have that part and it does not work, try with jackrabbit to see if you found a jackalope-doctrine-dbal bug...

the namespace may be declared in as many places as you want, as long as the same prefix always points to the same uri. i think one namespace for all of the cmf should be enough, we can coordinate to avoid collisions. the DI xml namespaces are http://cmf.symfony.com/schema/dic/core etc. for phpcr we could do http://cmf.symfony.com/phpcr/1.0 to follow the jcr model of http://www.jcp.org/nt/1.0 and so on.

from media-bundle.

rmsint avatar rmsint commented on July 28, 2024

Nope, the CND is registered in the repository initializer that is configured in persistance-phpcr.xml. Added the namespace and the tests pass now! I will add a PR soon, currently the code is in the cmf_file branch.

from media-bundle.

dbu avatar dbu commented on July 28, 2024

ok, i'll look at the PR then once you do it. create a WIP PR as soon as
possible, if it has WIP in the name we won't merge until you say its
ready. easier to give feedback.

from media-bundle.

dbu avatar dbu commented on July 28, 2024

see #63

from media-bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.