cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

LoadFolder with description

LoadFolder with description

Add property Description When create SubFolder by

In csvmapfile.txt edit

SubFolder~create~wt.folder.LoadFolder.createSubFolder~user~folderPath~description~adminDomain

In standardX24.dtd edit

<!ELEMENT csvSubFolder ( csvuser, csvfolderPath, csvdescription, csvadminDomain )>

Edit class wt.folder.LoadFolder

public class LoadFolder {

...

     public static boolean createSubFolder(Hashtable paramHashtable1, Hashtable paramHashtable2, Vector paramVector){

     ...

          // After create localSubFolder update property "description"

          String strDscr = LoadServerHelper.getValue("description", paramHashtable1, paramHashtable2, 1);

          if (strDscr != null && !strDscr.isEmpty()){

               Transaction localTransaction = new Transaction();

               localTransaction.start();

               localSubFolder.setDescription(strDscr);

               PersistenceServerHelper.manager.update(localSubFolder, true);

               localTransaction.commit();

               localTransaction = null;

          }

     ...

     }

}

...

Exampel CSV

#SubFolder,user,folderPath,description,adminDomain

SubFolder,,/Default/Test,Test Descript,

Exampl XML

<?xml version="1.0"?>

<!DOCTYPE NmLoader SYSTEM "standardX24.dtd">

<NmLoader>

  <csvSubFolder handler="wt.folder.LoadFolder.createSubFolder">

    <csvuser></csvuser>

    <csvfolderPath>/Default/Test</csvfolderPath>

    <csvdescription>Test Descript</csvdescription>

    <csvadminDomain></csvadminDomain>

  </csvSubFolder>

</NmLoader>

1 Comment
PTCModerator
Emeritus
Status changed to: Archived