How to create a Profile ?

Added by ERTZ Olivier over 7 years ago

Dear all,
I come back to a previous question extracted from topic http://forge.easysdi.org/boards/16/topics/show/202 and which did not receive an answer, a priori.

 * In order to create an Object Type, I am asked for a Profile.
 * In order to create a Profile, I am asked for a Metadata Id, which I cannot provide since I do not know where it should come from !

Given I've been able to create a simple metadata model (class, attributes, relationships), now I would like to create an object type which asks me to select for a Profile. How do I create a Profile, especially concerning the Metadata ID ? I only have the default entry in the Metadata ID select list. Where does a Metadata ID come from ? How do I feed more this list ? Is there still a link with issue #268 ?

Thanks a lot for your help,
Olivier.


Replies (9)

RE: How to create a Profile ? - Added by ERTZ Olivier over 7 years ago

This topic concerns CATALOG V2.

RE: How to create a Profile ? - Added by Mérour Xavier over 7 years ago

Hello Olivier,

It seems indeed that something is missing, at least one Metadata ID should be available.
I have tested CATALOG V2 yet... I have to.

Thomas, Clément, do you have any feedback on this issue ?
I think you use CATALOG for some weeks now...

PS : this issue show also that we should provide a default metadata model in the package, it would help a lot any new user.
Need to be done for a next release.

RE: How to create a Profile ? - Added by Galiay Clément over 7 years ago

Hi,
Before creating a profile you have to ensure that you have performed the following steps :
  • First, you need to define one of your model's classes as root component.
  • Then you have to create an attribute with the guid stereotype.
  • Finally, you create a relation between this class and this component (make sure this relation is published).

Now, when you will try to create a new profile, the form's root class list will let you choose between all of the classes that you have defined as root component and, once you have chosen one of these classes, the metadata ID list will automatically be populated with the attribute(s) that you have previsously defined as your model's guid (Technically, one could define several guid for a given root class, but it is of little interest).

I have done a few screenshots, just in case my explanations were too blurry :P

Hope it will help you,
Clément

profiles.png - [step-by-step] Profile creation (55.6 KB)

RE: How to create a Profile ? - Added by ERTZ Olivier over 7 years ago

Yes, it helps Clément. I had a root class but not a guid stereotyped attribute. Thanks for the screenshot, and your explanations were good enough, really ;-)

Just to notice, I get a warning when creating a relation :

Warning: Invalid argument supplied for foreach() in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_catalog/core/controller/relation.admin.easysdi.php on line 1385 

So, I'm now able to create a Profile which is required to create an Object Type, and I've also a Context associated to this Object Type.

Nonetheless, I'm not able to create an Object instance based on this Object Type. When loading the New object page, I get :
  • a long list of warnings
Warning: array_merge(): Argument #2 is not an array in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_catalog/core/controller/object.admin.easysdi.php on line 261
Warning: array_merge(): Argument #2 is not an array in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_catalog/core/controller/object.admin.easysdi.php on line 400
Warning: Invalid argument supplied for foreach() in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_core/core/common.easysdi.php on line 751 
Warning: array_diff(): Argument #1 is not an array in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_core/core/common.easysdi.php on line 759 
Warning: Invalid argument supplied for foreach() in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_core/core/common.easysdi.php on line 761
Warning: array_merge(): Argument #2 is not an array in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_catalog/core/controller/object.admin.easysdi.php on line 437 
Warning: Invalid argument supplied for foreach() in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_core/core/common.easysdi.php on line 751
Warning: array_diff(): Argument #1 is not an array in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_core/core/common.easysdi.php on line 759 
Warning: Invalid argument supplied for foreach() in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_core/core/common.easysdi.php on line 761
  • an empty type selector
  • an empty provider name selector with a related warning (Warning: Invalid argument supplied for foreach() in /home/olivier/www/htdocs/easysdi_fr/libraries/joomla/html/html/select.php on line 68)

I guess I should see my previously created object type in the type selector ... what's wrong ? And where does a provider name come from ?

Thanks in advance,
Olivier.

RE: How to create a Profile ? - Added by Galiay Clément over 7 years ago

Logically, the first warning should disappear once you have created a profile.
Did you try to create a new relation since you created your profile ?

All the warnings you get when you try to create a new object are "normal"; they come from the dynamic filling of the form's lists and will disappear as the form filling goes along. So it is all right if the provider name is empty, because it will automatically be filled once you have chosen an object type (provider names are the specific accounts that you can select when you create/edit an object type).

After a bit of head-scratching (and a from-scratch install :P), I think I know where your object creation problem might be.
When you have created you object type did you see an empty (i.e : with no field/input/etc. in it) fieldset named Label ?
If so, it is because you have probably not defined a language for EasySDI.

Let's fix it :
On the easySDI main panel, click on language, then create a new language.
For example :
Nom : Franéais
Label : Franéais
Code : Fr
ISO 639-2/T : fra
GEMET : fr
Code Easysdi : fr-FR - French (fr)
Publié: oui

Once this is done, you need to edit your object type and fill the new input that has appeared (with our example, it should be named Franéais).
And now, if everything goes as expected, you should be able to select your object type when you create a new object.

(As usual, here comes a visual example of the language creation)

lang.png - Language configuration (60.2 KB)

RE: How to create a Profile ? - Added by ERTZ Olivier over 7 years ago

Clément,
thanks again, your fix pushed me forward. Indeed I had this empty label fieldset and the addition of a language helped to define a label for my object type. I'm now able to see my object type (with the french label) and can select it when creating an object.

Nonetheless, even if I have also defined specific accounts for my object type, the provider name selector stays empty.

To be more precise :
  • when I want to create an object, the provider name selector is displayed empty with a warning (see my previous post)
  • as soon as I select my object type, the provider name selector is updated, no more warning, but stays empty, I mean only with the default entry "Select an account"

Should I do something more about these specific accounts ?

One more time, thanks in advance ;-)
Olivier.

RE: How to create a Profile ? - Added by Galiay Clément over 7 years ago

Sounds like I forgot to mention the accounts rights...

You surely have noticed the tabs on top of the account creation form :
  • General contains informations about the Joomla!/EasySDI account
  • Contact contains user's personal information
  • Billing and Shipping contains user's personal information that are used by the shop component.
  • Rights defines what that specific user can and cannot do in EasySDI.
  • Affiliate accounts lists all the accounts that are affiliated to this account. (more details here : http://forge.easysdi.org/boards/15/topics/show/232)
So, let's go to the Rights tab.
You shall see two lists :
  • profile, which should be empty at this point (I did not have to search what they are used for, so I guess it is ok to leave it as is).
  • Role (i8n is missing here, so it is labelled CORE_CATALOG_ROLE_TYPE_FCT) is the key to your problem : there are several option, you can select as many as you want.
    To be honest, I do not really know what each one of them exactly controls but, if you select PRODUCT, you allow the user to create new Objects.

That should do the trick :)
Clément

RE: How to create a Profile ? - Added by ERTZ Olivier over 7 years ago

Clément,
this was the trick to get one step further, thanks a lot ! Now I'm stuck with a fatal error when saving the object and it seems it's a problem of request/response with geonetwork (I use release 2.6.3).

This is the error I get :

Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_catalog/core/controller/object.admin.easysdi.php on line 542

Catchable fatal error: Argument 1 passed to DOMXPath::__construct() must be an instance of DOMDocument, boolean given, called in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_catalog/admin.easysdi_catalog.php on line 1498 and defined in /home/olivier/www/htdocs/easysdi_fr/administrator/components/com_easysdi_catalog/core/controller/object.admin.easysdi.php on line 544

This is what CURLRequest sends :

<csw:Transaction service="CSW" version="2.0.2" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" >
    <csw:Insert>
        <gmd:MD_Metadata
            xmlns:gmd="http://www.isotc211.org/2005/gmd" 
            xmlns:gco="http://www.isotc211.org/2005/gco" 
            xmlns:xlink="http://www.w3.org/1999/xlink" 
            xmlns:gml="http://www.opengis.net/gml" 
            xmlns:gts="http://www.isotc211.org/2005/gts" 
            xmlns:srv="http://www.isotc211.org/2005/srv" 
            xmlns:ext="http://www.depth.ch/2008/ext">

            <gmd:fileIdentifier>
                <gco:CharacterString>0c2b2929-9db1-4631-96ca-fc768fcab0bd</gco:CharacterString>
            </gmd:fileIdentifier>
            </gmd:MD_Metadata>
    </csw:Insert>
</csw:Transaction>

So, I get an empty response (no XML csw:TransactionResponse at all) that is why loadXML is already unhappy.

I tried to interact with geonetwork using a simple PHP csw client (http://trac.osgeo.org/geonetwork/attachment/wiki/HowToDoCSWTransactionOperations/cswClient.php), and submitting the above transaction works well.

I will still dig and analyze what the problem could be, but if you straightforwardly see what's going on, you are welcome ;-)

Thanks in advance,
Olivier.

RE: How to create a Profile ? - Added by ERTZ Olivier over 7 years ago

Ok, I will try to stop to be dumb ! I had a wrong geonetwork csw url. The good one : http://localhost:8080/geonetwork/srv/en/csw.
Sorry for that and thanks for the lot of help.

I will follow my testing.

Olivier.

(1-9/9)