Пример #1
0
    def create(self, properties):
        """ @see: L{ItemBase.create<datafinder.core.item.base.ItemBase.create>} """

        if self._linkTarget is None:
            raise ItemError("Cannot create link because the link target is missing.")
        else:
            ItemBase.create(self, properties)
            try:
                if not self.fileStorer.exists():
                    self.fileStorer.createLink(self._linkTarget.fileStorer)
                    self._refreshProperties()
            except PersistenceError, error:
                raise ItemError("Unable to create leaf item.\nReason:'%s'" % error.message)
            else:
Пример #2
0
    def create(self, properties):
        """ @see: L{ItemBase.create<datafinder.core.item.base.ItemBase.create>} """

        ItemBase.create(self, properties)
        try:
            if not self.fileStorer.exists():
                canStoreProperties = self.capabilities.canStoreProperties
                self.fileStorer.createResource()
                if canStoreProperties:
                    self.updateProperties(properties)
                self.dataPersister.create()
                self._refreshProperties()
        except PersistenceError, error:
            raise ItemError("Unable to create leaf item.\nReason:'%s'" % error.message)
Пример #3
0
    def create(self, properties):
        """ @see: L{ItemBase.create<datafinder.core.item.base.ItemBase.create>} """

        ItemBase.create(self, properties)
        try:
            if not self.fileStorer.exists():
                canStoreProperties = self.capabilities.canStoreProperties
                self.fileStorer.createResource()
                if canStoreProperties:
                    self.updateProperties(properties)
                self.dataPersister.create()
                self._refreshProperties()
        except PersistenceError, error:
            raise ItemError("Unable to create leaf item.\nReason:'%s'" %
                            error.message)
Пример #4
0
    def create(self, properties):
        """ @see: L{ItemBase.create<datafinder.core.item.base.ItemBase.create>} """

        if self._linkTarget is None:
            raise ItemError(
                "Cannot create link because the link target is missing.")
        else:
            ItemBase.create(self, properties)
            try:
                if not self.fileStorer.exists():
                    self.fileStorer.createLink(self._linkTarget.fileStorer)
                    self._refreshProperties()
            except PersistenceError, error:
                raise ItemError("Unable to create leaf item.\nReason:'%s'" %
                                error.message)
            else:
Пример #5
0
    def create(self, properties):
        """ @see: L{ItemBase.create<datafinder.core.item.base.ItemBase.create>} """

        ItemBase.create(self, properties)
        self.itemFactory.checkDatamodelConsistency(self.parent.dataType, self.dataType, self.parent.isRoot)
        
        try:
            if not self.fileStorer.exists():
                canStoreProperties = self.capabilities.canStoreProperties
                self.fileStorer.createCollection()
                if canStoreProperties:
                    self.updateProperties(properties)
                self.dataPersister.create()
                self._refreshProperties()
        except PersistenceError, error:
            raise ItemError("Unable to create collection item.\nReason:'%s'" % error.message)