cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved]CIFS : why alfresco 'eat' files...becoming invisible

zomurn
Champ in-the-making
Champ in-the-making
Hello,

I have two folders at the root (company_home) : "Importes" and "Editer"

Applied Rules :

"importes" :
   1)Incoming : Specialize type to my type
   2)Incoming : Move to "Editer"

"Editer" :
   1)Incoming : apply my own executer (MscImporter.java).

here the code of MscImporter.java :

if (nodeService.exists( pActionedUponNodeRef ))
      {
         // on increment le compteur de nombre de document scannes

         NodeRef lEditerFolder = mscSearchService
               .getFolder( MscFolderEnum.FOLDER_EDITER.getFolderName() );
         int lCounter = 1;
         // add the cm:countable aspect as required
         if (!nodeService.hasAspect( lEditerFolder,
               ContentModel.ASPECT_COUNTABLE ))
         {
            // set the value to 1 by default
            Map<QName, Serializable> props = new HashMap<QName, Serializable>(
                  1 );
            props.put( ContentModel.PROP_COUNTER, lCounter );
            nodeService.addAspect( lEditerFolder,
                  ContentModel.ASPECT_COUNTABLE, props );
         }
         else
         {
            // increment the value and handle possibility that no value has
            // been set yet
            lCounter = (Integer) nodeService.getProperty( lEditerFolder,
                  ContentModel.PROP_COUNTER );
            nodeService.setProperty( lEditerFolder,
                  ContentModel.PROP_COUNTER, ++lCounter );
         }

         // valeurs des métadonnées par défaut

         // nom de fichier
         SimpleDateFormat lDateFormat = new SimpleDateFormat( "ddMMyy",
               Locale.FRANCE );
         String lToday = lDateFormat.format( new Date() );
         NumberFormat lNumberFormat = NumberFormat.getInstance();
         lNumberFormat.setMinimumIntegerDigits( PAD_LENGTH );
         lNumberFormat.setGroupingUsed( false );
         String lDocName = lToday
               + lNumberFormat.format( lCounter
                     % Math.pow( 10, PAD_LENGTH ) ) + PDF_EXTENSION;

         // content type
         Map<QName, Serializable> lPropertiesMap = nodeService
               .getProperties( pActionedUponNodeRef );

         // msc:courrier par défaut
         lPropertiesMap.putAll( MscPropertyEnum.getInitialPropertiesMap() );

         // msc:trace
         Date lCreated = (Date) nodeService.getProperty(
               pActionedUponNodeRef, ContentModel.PROP_CREATED );
         MscPropertyTrace lTrace = new MscPropertyTrace();
         lTrace.setWhen( lCreated );
         lTrace.setWho( "" );
         lPropertiesMap.put( MscPropertyEnum.PROPERTY_TRACE.getQName(),
               lTrace.toString() );

         // cm:name
         lPropertiesMap.put( ContentModel.PROP_NAME, lDocName );

         nodeService.setProperties( pActionedUponNodeRef, lPropertiesMap );

      }

CIFS : "Importes" is the mapped folder with CIFS.

Test case :

1) Copy/paste from c:\test.pdf to \\alfrescoa\alfresco (CIFS path)
The file is imported and remains in "Editer" with name 06020900001.pdf

2) Copy/paste from c:\test.pdf to \\alfrescoa\alfresco (CIFS path)
The file doesn't appear in whole system (either in CIFS windows folder nor in "Importes" or "Editer" folder).

Where is the magic ?


Help.
1 REPLY 1

zomurn
Champ in-the-making
Champ in-the-making
As I used to, I'am going to answer to myself ; it might help somebody.
The problem was from CIFS : file-server-custom.xml

Here the content of my file :

<alfresco-config area="file-servers">

   <!– To override the default Alfresco filesystem use replace="true", to –>
   <!– add additional filesystems remove the replace="true" attribute     –>
  
   <config evaluator="string-compare" condition="Filesystems" replace="true">
      <filesystems>

         <filesystem name="Alfresco">
            <store>workspace://SpacesStore</store>
            <rootPath>/app:company_home</rootPath>
         <relativePath>/Importes</relativePath>
            <!– Add a URL file to each folder that links back to the web client –>
            <urlFile>
               <filename>__Alfresco.url</filename>
               <webpath>http://${localname}:8080/alfresco/</webpath>
            </urlFile>

            <!– Mark locked files as offline –>
            <offlineFiles/>

            <!– Desktop actions –>

            <desktopActions>
               <global>
                  <path>alfresco/desktop/Alfresco.exe</path>
                  <webpath>http://${localname}:8080/fr.intuitiv.msc/</webpath>
               </global>
               <action>
                  <class>org.alfresco.filesys.smb.server.repo.desk.CheckInOutDesktopAction</class>
                  <name>CheckInOut</name>
                  <filename>__CheckInOut.exe</filename>
               </action>
               <action>
                  <class>org.alfresco.filesys.smb.server.repo.desk.JavaScriptDesktopAction</class>
                  <name>JavaScriptURL</name>
                  <filename>__ShowDetails.exe</filename>
                  <script>alfresco/desktop/showDetails.js</script>
                  <attributes>anyFiles</attributes>
                  <preprocess>copyToTarget</preprocess>
               </action>

            </desktopActions>

<!–
            <accessControl default="Write">
               <user name="admin" access="Write"/>
               <address subnet="90.1.0.0" mask="255.255.0.0" access="Write"/>
            </accessControl>
–>
         </filesystem>
       
       <!– AVM virtualization view of all stores/versions for WCM –>
         <avmfilesystem name="AVM">
            <virtualView/>
         </avmfilesystem>
       
      </filesystems>
   </config>
  
   <config evaluator="string-compare" condition="CIFS Server" replace="true">
     <serverEnable enabled="true"/>
      <host name="AlfrescoA"/>
      <comment>Alfresco CIFS Server</comment>

      <!– Set to the broadcast mask for the subnet –>
      <broadcast>255.255.255.0</broadcast>

      <!– Use Java socket based NetBIOS over TCP/IP and native SMB on linux –>
      <tcpipSMB platforms="linux,solaris,macosx"/>
      <netBIOSSMB platforms="linux,solaris,macosx"/>

      <!– Can be mapped to non-privileged ports, then use firewall rules to forward
          requests from the standard ports –>
     <!–      
      <tcpipSMB port="1445" platforms="linux,solaris,macosx"/>
      <netBIOSSMB sessionPort="1139" namePort="1137" datagramPort="1138" platforms="linux,solaris,macosx"/>
     –>
      
      <hostAnnounce interval="5"/>

      <!– Use Win32 NetBIOS interface on Windows –>
      <Win32NetBIOS/>
      <Win32Announce interval="5"/>

<!–
      <WINS>
         <primary>1.2.3.4</primary>
         <secondary>5.6.7.8</secondary>
      </WINS>
–>
      <sessionDebug flags="Negotiate,Socket"/>
   </config>
  
   <config evaluator="string-compare" condition="FTP Server">
     <serverEnable enabled="false"/>
     <port>22</port>
     <rootDirectory>/Alfresco</rootDirectory>
   </config>

</alfresco-config>


The bug comes from the tag "relativePath" for Filesystem. Rules are not applied anymore. I have to remove it.
Hence, we need to simply let  <rootPath>/app:company_home</rootPath> then browse via window explorer to "Importes" folder and then I can drag and drop the same filename as much as I want, rules are applied.