Developement: Creating a new entity in ATOM

瀏覽次數:89 次
跳到第一則未讀訊息

pedro....@gmail.com

未讀,
2016年11月29日 中午12:43:532016/11/29
收件者:AtoM Users
We are using Vagrant to create a new entity with some new fields. The goal is add user metadata with default metadata like ESAD, DC,...

After createad the new entity We'll relate it to an existing metadata. The goal is insert it during the creation of a digital object. 
These custom metadata can also be filled up during DIP Upload by Archivematica. 

1. We need to know the name of the class called during the DIP Upload (which reads the DIP and inserts the metadata). 

2. Following the Symfony 1.4 documentation: (http://symfony.com/legacy/doc/jobeet/1_4/en/03?orm=Propel )When We tried to create a new Class, we had some issues, as shown above: 

2.1 Change the schema.yml by adding a new table with its fields and keys. DONE
2.2 - Run: php symfony propel:build --sql to generate .sql according to schema.yml DONE
2.3 - Run: php symfony tools:purge --demo to recreate the database by inserting the new entity DONE
2.4 - Run: php symfony propel:build --model to generate the created entity model DONE
2.5 - Run: php symfony propel:build --all --not-commit to create Forms and Validators >>>> FAIL
An error occurs:
build-propel.xml: 474: 20: Duplicate table found: propel.
2.6 Run: php symfony propel:generate-module qubit thousand QubitMil (project ModuleName ModelName) >>>> FAIL
But it throws the following error:
PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, class 'QubitMilPeer' not found in /usr/share/nginx/atom/vendor/symfony/lib/plugins/sfPropelPlugin/lib/generator/sfPropelGenerator.class.php on line 134

Warning: call_user_func() expects parameter 1 to be a valid callback, class 'QubitMilPeer' not found in /usr/share/nginx/atom/vendor/symfony/lib/plugins/sfPropelPlugin/lib/generator/sfPropelGenerator.class.php on line 134
PHP Fatal error:  Call to a member function getRelations() on a non-object in /usr/share/nginx/atom/vendor/symfony/lib/plugins/sfPropelPlugin/lib/generator/sfPropelGenerator.class.php on line 137

Fatal error: Call to a member function getRelations() on a non-object in /usr/share/nginx/atom/vendor/symfony/lib/plugins/sfPropelPlugin/lib/generator/sfPropelGenerator.class.php on line 137


Who can help us??

Jesús García Crespo

未讀,
2016年11月30日 上午10:27:002016/11/30
收件者:ica-ato...@googlegroups.com
Hi Pedro,

On Tue, Nov 29, 2016 at 9:43 AM, <pedro....@gmail.com> wrote:
1. We need to know the name of the class called during the DIP Upload (which reads the DIP and inserts the metadata). 

I think that you want to look at qtSwordPluginWorker.class.php. That's the class that any worker is going to be used when a job pulled from the queue. At the end of the runJob method the package extractor is instantiated and used to process the DIP. IIRC, we called them packages following SWORD's terminology. Depending on the format of the package a new extractor subclass will be assigned by the factory. Your options are: 1) customize qtPackageExtractorMETSArchivematicaDIP.class.php or 2) tweak things so a new package extractor is used.
 
2. Following the Symfony 1.4 documentation: (http://symfony.com/legacy/doc/jobeet/1_4/en/03?orm=Propel )When We tried to create a new Class, we had some issues, as shown above: 
        [...]
2.5 - Run: php symfony propel:build --all --not-commit to create Forms and Validators >>>> FAIL

After updating the schema we only build the SQL and the models. The other stuff has never been used, we've always preferred to implement that part manually. You got pretty far, now I'd try to add some of your business logic to the models and start interacting with them from your controllers.

Don't hesitate to ask more questions!

--
Jesús García Crespo,
Software Engineer, Artefactual Systems Inc.
http://www.artefactual.com | +1.604.527.2056
訊息已遭刪除
訊息已遭刪除

Joaquim Pedro

未讀,
2016年12月1日 上午9:55:412016/12/1
收件者:AtoM Users
Hi Jesus,

We appreciate your answer. Now I'll gonna try to understand the controllers and views structures. I've found the form (insert and update) of the 'archival description' in 'sfIsadPlugin', too

We need some guidelines to make this new code complient to Artefactual patterns. 
Could you help us in this issue?

Jesús García Crespo

未讀,
2016年12月1日 下午3:36:592016/12/1
收件者:ica-ato...@googlegroups.com
If you only need to make a small number of changes I would suggest to just modify sfIsadPlugin. Try to use a source control system like git because you want to pull upgrades from upstream as we make new releases, SCM will make that process much easier.

One approach is to edit the existing files as you need. An interesting alternative would be to subclass our class-based controllers in order to add your new fields - I haven't tried to do that before but it might work, otherwise we'd be happy to accept contributions that make that possible. Likewise, on the templates that you're editing, I would probably try to use partials or components as much as possible so I reduce the number of changes that I make in the original files.

Also, try to become familiar with the cascade mechanism that Symfony provides. It brings some obvious overhead but it's quite powerful.

I've always wondered if we could tweak the initialize() method of sfIsadPluginConfiguration or similar classes so it would be possible to extend the cascade mechanism to other plugins. You may want to look into that if you really want to create a new plugin that overrides the stuff that we've made available in the sfIsadPlugin. Somehow, our plugin-based approach I think brings the issue that it's like defining "final" members on a class, unless we can find ways to change that.

Don't hesitate to ask more questions!

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/417d1e40-b29a-4c75-8ab9-fe2bea0e13aa%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
回覆所有人
回覆作者
轉寄
0 則新訊息