cancel
Showing results for 
Search instead for 
Did you mean: 

Création d'un custom model (avec Java API)

libman
Champ in-the-making
Champ in-the-making
Bonjour,

J'ai suivi les tutoriels de ecmarchitect.com pour créer un model. Le model marche (sc:docs). Maintenant, ce que je veux est créer une fichier de cette type.

QName qname = QName.createQName("sc:doc");
getFileFolderService().create(parentSpace, "newtype", qname);
L'erreur:

The type is not supported by this service: {}sc:doc
Merci d'avance.
3 REPLIES 3

libman
Champ in-the-making
Champ in-the-making
Dans le tutoriel:
AuthenticationUtils.startSession(getUser(), getPassword());
Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
String folderPath = "/app:company_home/cm:" + getRootFolder();
String timeStamp = new Long(System.currentTimeMillis()).toString();
ParentReference docParent = new ParentReference(
storeRef,
null,
folderPath,
Constants.ASSOC_CONTAINS,
Constants.createQNameString(SomeCoModel.NAMESPACE_SOMECO_CONTENT_MODEL,
getContentName() + timeStamp));
Il y a sûrement un service?

Merci

cleseach
Star Contributor
Star Contributor
Bonjour,

La Javadoc de QName(String) indique :

Create a QName from its internal string representation of the following format: {namespaceURI}localName

Il faut utiliser la forme {namespaceURI}localName alors que vous utilisez prefix:localName.

Cordialement,
Charles Le Seac'h

libman
Champ in-the-making
Champ in-the-making
Merci beaucoup, j'avais déjà trouver comment le faire. Mais j'ai oublié de l'écrire ici.