cancel
Showing results for 
Search instead for 
Did you mean: 

Howto JSR 170 Document View import/export????

manuelgentile
Champ in-the-making
Champ in-the-making
I heard of  JSR 170 Document View import/export in JSR Level 2 Podcast.
I try to make an action and import a xml content file and I had this error

Namespace URI "http://….." has not been registered with the repository

Why?
The document view imp/exp is not ready yet??

Thanks in advance
14 REPLIES 14

davidc
Star Contributor
Star Contributor
The document/system view import is available via the JCR api only at this time.  The Import Action has not yet been integrated, therefore currently supports the Alfresco import format only.

manuelgentile
Champ in-the-making
Champ in-the-making
That's my code…. what is wrong?

Session session=null;
try {
  session = repository.login(new SimpleCredentials("admin",
               "admin".toCharArray()));
  session.importXML("/", AddLomAction.class.getResourceAsStream("test.xml"),IMPORT_UUID_CREATE_NEW);
  session.save();
} catch (LoginException e) {
e.printStackTrace();
} catch (RepositoryException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
  if (session!=null) session.logout();
}

manuelgentile
Champ in-the-making
Champ in-the-making
Sorry some more information….
I put this code in a custon action and i launch via web client…
That uses JCR API , don't it?

davidc
Star Contributor
Star Contributor
Ah ok, can you provide the xml file you're importing.

Thanks.

manuelgentile
Champ in-the-making
Champ in-the-making
Sure


<?xml version="1.0" encoding="UTF-8"?>
<p:lom xmlns:p="http://ltsc.ieee.org/xsd/LOM" xmlns:p0="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:p1="http://ltsc.ieee.org/xsd/LOM/vocab" xmlns:p2="http://ltsc.ieee.org/xsd/LOM/extend" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ltsc.ieee.org/xsd/LOM lom.xsd http://ltsc.ieee.org/xsd/LOM/unique unique/strict.xsd http://ltsc.ieee.org/xsd/LOM/vocab vocab/strict.xsd http://ltsc.ieee.org/xsd/LOM/extend extend/strict.xsd ">
  <p:general>
     <p:identifier>
        <p:catalog></p:catalog>
        <p:entry></p:entry>
     </p:identifier>
     <p:title>
        <p:string></p:string>
     </p:title>
     <p:language>en</p:language>
     <p:description>
        <p:string></p:string>
     </p:description>
     <p:keyword>
        <p:string></p:string>
     </p:keyword>
     <p:coverage>
        <p:string></p:string>
     </p:coverage>
     <p:structure>
        <p:source>LOMv1.0</p:source>
        <p:value>atomic</p:value>
     </p:structure>
     <p:aggregationLevel>
        <p:source>LOMv1.0</p:source>
        <p:value>1</p:value>
     </p:aggregationLevel>
  </p:general>
  <p:lifeCycle>
     <p:version>
        <p:string></p:string>
     </p:version>
     <p:contribute>
        <p:date></p:date>
        <p:role>
           <p:source>LOMv1.0</p:source>
           <p:value>author</p:value>
        </p:role>
        <p:entity></p:entity>
     </p:contribute>
     <p:status>
        <p:source>LOMv1.0</p:source>
        <p:value>draft</p:value>
     </p:status>
  </p:lifeCycle>
  <p:metaMetadata>
     <p:identifier>
      <p:catalog></p:catalog>
        <p:entry></p:entry>
     </p:identifier>
     <p:contribute>
        <p:date></p:date>
        <p:role>
           <p:source>LOMv1.0</p:source>
           <p:value>creator</p:value>
        </p:role>
        <p:entity></p:entity>
     </p:contribute>
     <p:metadataSchema>
     </p:metadataSchema>
     <p:language>en</p:language>
  </p:metaMetadata>
  <p:technical>
     <p:format>html</p:format>
     <p:size>23</p:size>
     <p:location></p:location>
     <p:requirement>
        <p:orComposite>
           <p:name>
              <p:source>LOMv1.0</p:source>
              <p:value>unix</p:value>
           </p:name>
           <p:type>
              <p:source>LOMv1.0</p:source>
              <p:value>browser</p:value>
           </p:type>
           <p:minimumVersion></p:minimumVersion>
           <p:maximumVersion></p:maximumVersion>
        </p:orComposite>
     </p:requirement>
     <p:installationRemarks>
        <p:string></p:string>
     </p:installationRemarks>
     <p:otherPlatformRequirements>
        <p:string></p:string>
     </p:otherPlatformRequirements>
     <p:duration>
        <p:duration>PT1H30M</p:duration>
        <p:description>
           <p:string></p:string>
        </p:description>
     </p:duration>
  </p:technical>
  <p:educational>
     <p:interactivityType>
        <p:source>LOMv1.0</p:source>
        <p:value>active</p:value>
     </p:interactivityType>
     <p:learningResourceType>
        <p:source>LOMv1.0</p:source>
        <p:value>exercise</p:value>
     </p:learningResourceType>
     <p:interactivityLevel>
      <p:source>LOMv1.0</p:source>
        <p:value>medium</p:value>
     </p:interactivityLevel>
     <p:semanticDensity>
        <p:source>LOMv1.0</p:source>
        <p:value>medium</p:value>
     </p:semanticDensity>
     <p:intendedEndUserRole>
        <p:source>LOMv1.0</p:source>
        <p:value>learner</p:value>
     </p:intendedEndUserRole>
     <p:context>
        <p:source>LOMv1.0</p:source>
        <p:value>school</p:value>
     </p:context>
     <p:typicalAgeRange>
      <p:string></p:string>
   </p:typicalAgeRange>
     <p:difficulty>
        <p:source>LOMv1.0</p:source>
        <p:value>medium</p:value>
     </p:difficulty>
     <p:typicalLearningTime>
        <p:duration>PT1H30M</p:duration>
      <p:description>
         <p:string></p:string>
      </p:description>
   </p:typicalLearningTime>
     <p:description>
        <p:string></p:string>
     </p:description>
     <p:language>en</p:language>
  </p:educational>
  <p:rights>
     <p:cost>
        <p:source>LOMv1.0</p:source>
        <p:value>no</p:value>
     </p:cost>
     <p:copyrightAndOtherRestrictions>
        <p:source>LOMv1.0</p:source>
        <p:value>no</p:value>
     </p:copyrightAndOtherRestrictions>
     <p:description>
        <p:string></p:string>
     </p:description>
  </p:rights>
  <p:relation>
     <p:kind>
        <p:source>LOMv1.0</p:source>
        <p:value>ispartof</p:value>
     </p:kind>
     <p:resource>
        <p:identifier>
           <p:catalog></p:catalog>
           <p:entry></p:entry>
        </p:identifier>
        <p:description>
           <p:string></p:string>
        </p:description>
     </p:resource>
  </p:relation>
  <p:annotation>
     <p:entity></p:entity>
     <p:date>
        <p:dateTime>2006-01-01</p:dateTime>
        <p:description>
           <p:string></p:string>
        </p:description>
     </p:date>
     <p:description>
        <p:string></p:string>
     </p:description>
  </p:annotation>
  <p:classification>
     <p:purpose>
        <p:source>LOMv1.0</p:source>
        <p:value>prerequisite</p:value>
     </p:purpose>
     <p:taxonPath>
        <p:source>
           <p:string></p:string>
        </p:source>
        <p:taxon>
           <p:id></p:id>
           <p:entry>
              <p:string></p:string>
           </p:entry>
        </p:taxon>
     </p:taxonPath>
     <p:description>
        <p:string></p:string>
     </p:description>
     <p:keyword>
        <p:string></p:string>
     </p:keyword>
  </p:classification>
</p:lom>

manuelgentile
Champ in-the-making
Champ in-the-making
Sorry david any news????

Thanks

manuelgentile
Champ in-the-making
Champ in-the-making
Excuse me but there is any news about this problem?

davidc
Star Contributor
Star Contributor
The repository does not support the nt:unstructured type (this is an optional type in JSR-170), therefore, it is necessary to define a model that represents your xml schema.  The model also defines the namespaces as well.

You can find docs on model definition at http://wiki.alfresco.com/wiki/Data_Dictionary_Guide.

manuelgentile
Champ in-the-making
Champ in-the-making
Thanks David,
hovewer I think that a feature that allow to "convert/create" a alfresco content model starting from a XML Schema will sound good, isn't it?

There are some news about the feature for the definition of custom data type… (in data dictionary model)???

Thanks a lot!!!!
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.