You are viewing limited content. For full access, please sign in.

Discussion

Discussion

XML Duplicate folder issue

posted on February 20, 2017

Has anyone found a way around that fact that you cannot list duplicate folders even when using the  on_folder_conflict="merge" parameter when using Import Agent and xml files?  For example, if you want a file to have a xml file to import files to the following folders:

RECORDS\D-F\F\FAKE ST\0100\101 Fake St
RECORDS\L-M\M\MAIN ST\0100\130 Main St
RECORDS\L-M\L\LION ST\0200\230 Lion St

You can't have RECORDS or L-M listed twice in the xml or you'll get a duplication error.  Is there any other way to provide a specific folder location in an xml file?  

1 0
replied on February 20, 2017 Show version history

Hi Jen, the below XML will create (if no exist)

RECORDS\D-F\F

RECORDS\L-M\L

RECORDS\L-M\M

Are you looking for it?

<?xml version="1.0" encoding="utf-8"?>
  <LF:importengine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://laserfiche.com/namespaces/importengine ImportEngine.xsd"
                   xmlns:LF="http://laserfiche.com/namespaces/importengine" version="1.0">

    <LF:toc on_document_conflict="unique" on_folder_conflict="merge">
      <LF:folder name="RECORDS">
        <LF:childentries>
          <LF:folder name="D-F">
            <LF:childentries>
              <LF:folder name="F"/>
            </LF:childentries>
          </LF:folder>
          <LF:folder name="L-M">
            <LF:childentries>
              <LF:folder name="M"/>
              <LF:folder name="L"/>
            </LF:childentries>
          </LF:folder>
        </LF:childentries>
      </LF:folder>
    </LF:toc>
  
</LF:importengine>

 

0 0
replied on February 21, 2017

Hi Huazhen,

I'm sorry if my post was confusing.  I am not simply trying to create folders and subfolders but trying to import images into specific folders using xml.  The xml will contain duplicate folders and subfolder names.  Here is an example:

<?xml version="1.0" encoding="utf-8"?>
  <LF:importengine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://laserfiche.com/namespaces/importengine ImportEngine.xsd"
                   xmlns:LF="http://laserfiche.com/namespaces/importengine" version="1.0">
    
    <LF:toc on_document_conflict="unique" on_folder_conflict="merge">
     <LF:folder name="RECORDS">
	<LF:childentries>
	<LF:folder name="L-M">
	<LF:childentries>
	<LF:folder name="M">
	<LF:childentries>
	<LF:folder name="MAIN ST">
	<LF:childentries>
	<LF:folder name="0100">
	<LF:childentries>
	<LF:folder name="130 Main St">
	<LF:childentries>
	<LF:folder name="Test">
	<LF:childentries>
      <LF:document name="Plans.Approved.Test" template="Building Permit">
        <LF:pages>
          <LF:page ocr="false">
            <LF:imagepart>
              <LF:fileref ref="C:\Import Agent\FilesToImport\Test.tif" />
            </LF:imagepart>
          </LF:page>
        </LF:pages>
  	    </LF:document>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	
	  <LF:folder name="RECORDS">
	<LF:childentries>
	<LF:folder name="D-F">
	<LF:childentries>
	<LF:folder name="F">
	<LF:childentries>
	<LF:folder name="FAKE ST">
	<LF:childentries>
	<LF:folder name="0100">
	<LF:childentries>
	<LF:folder name="101 Fake St">
	<LF:childentries>
	<LF:folder name="Test">
	<LF:childentries>
      <LF:document name="Plans.Approved.Test 2" template="Building Permit">
        <LF:pages>
          <LF:page ocr="false">
            <LF:imagepart>
              <LF:fileref ref="C:\Import Agent\FilesToImport\Test 2.tif" />
            </LF:imagepart>
          </LF:page>
        </LF:pages>
  	    </LF:document>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	
		  <LF:folder name="RECORDS">
	<LF:childentries>
	<LF:folder name="L-M">
	<LF:childentries>
	<LF:folder name="L">
	<LF:childentries>
	<LF:folder name="LION ST">
	<LF:childentries>
	<LF:folder name="0200">
	<LF:childentries>
	<LF:folder name="230 Lion St">
	<LF:childentries>
	<LF:folder name="Test">
	<LF:childentries>
      <LF:document name="Plans.Approved.Test 3" template="Building Permit">
        <LF:pages>
          <LF:page ocr="false">
            <LF:imagepart>
              <LF:fileref ref="C:\Import Agent\FilesToImport\Test 3.tif" />
            </LF:imagepart>
          </LF:page>
        </LF:pages>
  	    </LF:document>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	</LF:childentries>
	</LF:folder>
	
    </LF:toc>
  
</LF:importengine>

This will give not import the files and gives the following error:

There was an error importing the XML list file "C:\Import Agent\XML\LF Answers Example.xml" while running the profile City of Aspen. (Validation failure on line 45 , position 5 :There is a duplicate key sequence 'RECORDS' for the 'http://laserfiche.com/namespaces/importengine:entry_name_key' key or unique identity constraint.
Message: There is a duplicate key sequence 'RECORDS' for the 'http://laserfiche.com/namespaces/importengine:entry_name_key' key or unique identity constraint.
Stack:)

1 0
replied on February 21, 2017 Show version history

Hello Jen,

The correct XML is 

<LF:importengine version="1.0">
<LF:toc on_document_conflict="unique" on_folder_conflict="merge">
<LF:folder name="RECORDS">
<LF:childentries>
<LF:folder name="L-M">
<LF:childentries>
<LF:folder name="L">
<LF:childentries>
<LF:folder name="LION ST">
<LF:childentries>
<LF:folder name="0200">
<LF:childentries>
<LF:folder name="230 Lion St">
<LF:childentries>
<LF:folder name="Test">
<LF:childentries>
<LF:document name="Plans.Approved.Test 3" template="Building Permit">
<LF:pages>
<LF:page ocr="false">
<LF:imagepart>
 <LF:fileref ref="C:\Import Agent\FilesToImport\Test 3.tif"/>
 </LF:imagepart>
 </LF:page>
 </LF:pages>
 </LF:document>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
<LF:folder name="M">
<LF:childentries>
<LF:folder name="MAIN ST">
<LF:childentries>
<LF:folder name="0100">
<LF:childentries>
<LF:folder name="130 Main St">
<LF:childentries>
<LF:folder name="Test">
<LF:childentries>
<LF:document name="Plans.Approved.Test" template="Building Permit">
<LF:pages>
<LF:page ocr="false">
<LF:imagepart>
 <LF:fileref ref="C:\Import Agent\FilesToImport\Test.tif"/>
 </LF:imagepart>
 </LF:page>
 </LF:pages>
 </LF:document>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
<LF:folder name="D-F">
<LF:childentries>
<LF:folder name="F">
<LF:childentries>
<LF:folder name="FAKE ST">
<LF:childentries>
<LF:folder name="0100">
<LF:childentries>
<LF:folder name="101 Fake St">
<LF:childentries>
<LF:folder name="Test">
<LF:childentries>
<LF:document name="Plans.Approved.Test 2" template="Building Permit">
<LF:pages>
<LF:page ocr="false">
<LF:imagepart>
 <LF:fileref ref="C:\Import Agent\FilesToImport\Test 2.tif"/>
 </LF:imagepart>
 </LF:page>
 </LF:pages>
 </LF:document>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:childentries>
 </LF:folder>
 </LF:toc>
 </LF:importengine>

The difference is that, the folder structure is organized as a tree. As you know, you cannot create entries in a folder with the same name. So when write the XML list file, you'd have to create a "RECORDS" folder first, put two child folder 'L-M' and 'D-F' in the 'RECORD' folder, and do the same way for other child folder/documents. 

 

As an alternate if you thought the folder structure is complicated to be written in XML file, you can create three XML, each XML for one specified folder. It is easy way to avoid duplicate folders in one XML file.

0 0
replied on February 27, 2017

Hi Huazhen,

Thanks for the suggestion.  It seems the answer is that a single xml cannot be used in this case.  There will be other duplicate folders throughout the project and it would take too much work to get them all in the correct order.   It would be nice if there was simply a command that could accept the folder path instead of having to build it out.  Thanks for the help.  Our customer will have to create a single xml for each file.

Thanks for your help.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.