cancel
Showing results for 
Search instead for 
Did you mean: 

Creation d'un folder personnalisé

pascal_sighma
Champ in-the-making
Champ in-the-making
Bonjour a tous,

Un nouveau post car nouveau problème.

Le but recherché est le suivant. Créer des dossiers(folder) grace a un bouton par exemple, en les nommant grâce à un compteur. Le compteur devant être capable de lire plusieurs espaces, car plusieurs utilisateurs sont susceptible d'archiver a partir de leurs propres espace, et que l'es N° de doivent pas être similaire. userA boite de 1 à 10 userB boite de 11 à 20 etc…

Ce qui me donnera une liste de dossiers correspondant au boite d'archive physique des documents numérisés.

De plus j'ai une contrainte supplémentaire, le dossier ainsi créer devra avoir dans le "folder-details" en plus des metadonnées habituelles, Nom, Titre, Description, la métadonnée "boite archive" incrémenté par le compteur.

J'ai créer un aspect :
<?xml version="1.0" encoding="UTF-8"?>


<!– The important part here is the name - Note: the use of the my: namespace
     which is defined further on in the document –>
<model name="box:archive" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
    <description>Aspect Boite archive</description>
    <author></author>
    <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>  
    <imports>
        <!– Import Alfresco Dictionary Definitions –>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
    </imports>

    <namespaces>
        <namespace uri="http://www.boitearchive.nc/model/content/1.0" prefix="box"/>
    </namespaces>
   
    <constraints>   
        <constraint name="box:length" type="LENGTH">
            <parameter name="minLength">
                <value>1</value>
            </parameter>
            <parameter name="maxLength">
                <value>5</value>
            </parameter>
        </constraint>
    </constraints>

    <types>
    </types>
   
          <!– Definition  Aspect: Boite archive –>
    <aspects> 
        <aspect name="box:archive">           
            <title>Boite archive</title>
            <properties>
                <property name="box:number">
                    <title>Numéro boite</title>
                    <type>d:text</type>
                    <constraints>
                        <constraint ref="box:length"/>
                    </constraints>
                </property>
            </properties>
        </aspect>
    </aspects>
  
</model>

Mon souci est donc la création du compteur (en .js pour l'affecter avec une règles je suppose?), mais aussi ensuite la liaison du dit compteur avec mon aspect et enfin son l'affichage dans le "folder-details".

En ce moment chez vous ce sont les vacances d'été donc j’espère que certains d'entre vous sont déjà revenus?

Si vous en prenez bientôt, je vous les souhaitent bonne … :wink:

Pascal
3 REPLIES 3

rguinot
Confirmed Champ
Confirmed Champ
Je ne comprends pas bien l'affaire. Sachez toutefois que si le scripting javascript ne vous donne pas assez de souplesse, vous avez la possibilité de coder des actions en Java.

pour des exemples d'action custom, voir :

http://wiki.alfresco.com/wiki/Custom_Actions
http://wiki.alfresco.com/wiki/Custom_Document_Library_Action
http://wiki.alfresco.com/wiki/Custom_Document_Library_Action
http://blogs.alfresco.com/wp/wabson/2010/02/28/share-custom-actions-in-a-jar/

pascal_sighma
Champ in-the-making
Champ in-the-making
Bonjour,

Merci pour cette réponse.
Si vous n'avez pas compris ma demande je vais essayer d’être plus clair.

Je voudrais pouvoir créer et incrémenter automatiquement (d’où mon idée de compteur, mais ce n'est peut être pas la bonne solution), des sous-espaces depuis un espace donné.

J'imagine un "bouton" (add action in share), qui permettrait à l'utilisateur de créer automatiquement un dossier dans son espace.
Le système doit pouvoir lire les différents espaces des utilisateurs qui aurait la même fonction (creation de dossier dans leur espace), pour incrémenter le dossier créer en +1, pour ne pas avoir de doublons de dossier.
ex:
user1 - boite 1
user2 - boite 2
user2 - boite 3
user1 - boite 4 etc…

J’espère être plus clair.  :wink:

Pour ce qui est de mon champs, le soucis est réglé, il fallait juste surchargé la conf de share config custom. Smiley Surprisedops: le seul soucis sur ma surcharge c'est que si j’enlève l'aspect archiveboxid il me supprime le champ "cm:name" pour me mettre a priori un ID???

Donc aujourd'hui ma recherche est a 100% sur ce script qui serait capable de créer et d'incrémenter automatiquement un sous espace.
Je cherche des exemples de script qui pourraient me donner la ou les pistes à suivre pour réaliser mon script.

Je remets les 2 xml créé

boitearchiveModel.xml
<?xml version="1.0" encoding="UTF-8"?>


<!– The important part here is the name - Note: the use of the my: namespace
     which is defined further on in the document –>
<model name="box:archive" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
    <description>Aspect Boite archive</description>
    <author></author>
    <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>  
    <imports>
        <!– Import Alfresco Dictionary Definitions –>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
    </imports>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect your own namespace –>
    <namespaces>
        <namespace uri="http://www.boitearchive.nc/model/content/1.0" prefix="box"/>
    </namespaces>
   
    <constraints>   
        <constraint name="box:length" type="LENGTH">
            <parameter name="minLength">
                <value>1</value>
            </parameter>
            <parameter name="maxLength">
                <value>5</value>
            </parameter>
        </constraint>
    </constraints>

    <types>

    </types>
   
          <!– Definition of new Content Aspect: Boite archive –>
    <aspects> 
            <aspect name="box:archivebox">
            <title>Boite archive</title>
            <parent>cm:folder</parent>
            <properties>
                <property name="box:archiveboxid">
                    <title>Boîte archive N°</title>
                    <type>d:text</type>
                    <constraints>
                        <constraint ref="box:length"/>
                    </constraints>
                </property>
            </properties>
        </aspect>
    </aspects>
  
</model>

et mon share config custom
            <!– Pour affichage  métadonnées CANL–>
    <config evaluator="model-type" condition="can:canl">
        <forms>
            <form id="search">
                <field-visibility>
                    <show id="can:contractid" />
                    <show id="can:designation" />              
                    <show id="can:documenttype" />
                    <show id="can:login" force="true" />
                    <show id="can:telnumber" force="true" />
                    <show id="can:batchnumber" force="true" />
                    <show id="cm:description" force="true" />
                </field-visibility> 
            </form>
        </forms>
    </config>

    <!– surcharge la conf presente dans \tomcat\webapps\share\WEB-INF\classes\alfresco\share-form-config.xml –>
<!– configuration can'l –>
    <config evaluator="node-type" condition="can:canl">
        <forms>
         <!– Default form configuration for the cm:content type –>
            <form>
                <field-visibility>

                    <show id="can:contractid" />
                    <show id="can:designation" />              
                    <show id="can:documenttype" />
                   
               <!– can:log aspect–>    
                    <show id="can:login" />
                   
               <!– can:lot aspect–>    
                    <show id="can:batchnumber" />
                   
                    <show id="cm:description" force="true" />
              
               <!– tags and categories –>
                    <show id="cm:taggable" for-mode="edit" force="true" />
                    <show id="cm:categories" />
              
               <!– cm:dublincore aspect –>
              
                    <show id="cm:publisher"/>
                    <show id="cm:contributor"/>
                    <show id="cm:type"/>
                    <show id="cm:identifier"/>
                    <show id="cm:dcsource"/>
                    <show id="cm:coverage"/>
                   
               <!–<show id="cm:rights"/>–>
                    <show id="cm:subject"/>
           
              
               <!– cm:complianceable aspect –>
                    <show id="cm:removeAfter" />
              
               <!– cm:effectivity aspect –>
                    <show id="cm:from"/>
                    <show id="cm:to"/>
              
               <!–  cm:summarizable aspect –>
                    <show id="cm:summary" />
              
               <!– cm:translatable aspect –>
                    <show id="cm:translations" />
              
               <!– cm:localizable aspect –>
                    <show id="cm:locale" />
              
               <!– cm:ownable aspect –>
                    <show id="cm:owner" />
              
               <!– cm:attachable aspect –>
                    <show id="cm:attachments" />
              
               <!– cm:emailed aspect –>
                    <show id="cm:originator" />
                    <show id="cm:addressee" />
                    <show id="cm:addressees" />
                    <show id="cm:sentdate" />
                    <show id="cm:subjectline" />
              
               <!– cm:geographic aspect –>
                    <show id="cm:latitude" />
                    <show id="cm:longitude" />
                   
               <!– can:dsl aspect –>    
                    <show id="can:telnumber" />
                   
               <!– box:archivebox aspect boite archive–>   
                    <show id="box:archivebox"/>
                      
                </field-visibility>
                               
            </form>
        </forms>

    </config>  
  
    <!– Pour affichage  métadonnées –>
    <config evaluator="model-type" condition="mod:dta">
        <forms>
            <form id="search">
                <field-visibility>
                    <show id="mod:service" />
                    <show id="mod:reference" />
                    <show id="mod:objet" />
                    <show id="mod:projet" />
                   
                </field-visibility>

            </form>
        </forms>
    </config>
  
    <!– surcharge la conf presente dans \tomcat\webapps\share\WEB-INF\classes\alfresco\share-form-config.xml –>
<!– configuration sighma –>
    <config evaluator="node-type" condition="mod:dta">
        <forms>
         <!– Default form configuration for the cm:content type –>
            <form>
                <field-visibility>            
                    <show id="cm:name" />
                    <show id="mod:service" />
                    <show id="mod:reference" />
                    <show id="mod:objet" />
                    <show id="mod:projet" />
                    <show id="cm:title" force="true" />
                    <show id="cm:description" force="true" />
                    <show id="mimetype" />
                    <show id="cm:author" force="true" />
                    <show id="size" for-mode="view" />
                    <show id="cm:creator" for-mode="view" />
                    <show id="cm:created" for-mode="view" />
                    <show id="cm:modifier" for-mode="view" />
                    <show id="cm:modified" for-mode="view" />

            
              
               <!– tags and categories –>
                    <show id="cm:taggable" for-mode="edit" force="true" />
                    <show id="cm:categories" />
              
               <!– cm:dublincore aspect –>
              
                    <show id="cm:publisher"/>
                    <show id="cm:contributor"/>
                    <show id="cm:type"/>
                    <show id="cm:identifier"/>
                    <show id="cm:dcsource"/>
                    <show id="cm:coverage"/>
               <!–<show id="cm:rights"/>–>
                    <show id="cm:subject"/>
           
              
               <!– cm:complianceable aspect –>
                    <show id="cm:removeAfter" />
              
               <!– cm:effectivity aspect –>
                    <show id="cm:from"/>
                    <show id="cm:to"/>
              
               <!–  cm:summarizable aspect –>
                    <show id="cm:summary" />
              
               <!– cm:translatable aspect –>
                    <show id="cm:translations" />
              
               <!– cm:localizable aspect –>
                    <show id="cm:locale" />
              
               <!– cm:ownable aspect –>
                    <show id="cm:owner" />
              
               <!– cm:attachable aspect –>
                    <show id="cm:attachments" />
              
               <!– cm:emailed aspect –>
                    <show id="cm:originator" />
                    <show id="cm:addressee" />
                    <show id="cm:addressees" />
                    <show id="cm:sentdate" />
                    <show id="cm:subjectline" />
              
               <!– exif:exif aspect –>
                    <show id="exif:dateTimeOriginal" />
                    <show id="exif:pixelXDimension" />
                    <show id="exif:pixelYDimension" />
                    <show id="exif:exposureTime" />
                    <show id="exif:fNumber" />
                    <show id="exif:flash" />
                    <show id="exif:focalLength" />
                    <show id="exif:isoSpeedRatings" />
                    <show id="exif:manufacturer" />
                    <show id="exif:model" />
                    <show id="exif:software" />
                    <show id="exif:orientation" />
                    <show id="exif:xResolution" />
                    <show id="exif:yResolution" />
                    <show id="exif:resolutionUnit" />
              
               <!– cm:geographic aspect –>
                    <show id="cm:latitude" />
                    <show id="cm:longitude" />

                </field-visibility>
            </form>
        </forms>

    </config>

   <!– cm:folder type (existing nodes) –>
    <config evaluator="node-type" condition="cm:folder">
        <forms>
         <!– Default form configuration for the cm:folder type –>
            <form>
                <field-visibility>
                    <show id="cm:name" />
                    <show id="cm:title" force="true" />
                    <show id="cm:description" force="true" />
                    <show id="box:archiveboxid"/>

               <!– tags and categories –>
                    <show id="cm:taggable" for-mode="edit" force="true" />
                    <show id="cm:categories" />
                </field-visibility>
                <appearance>
                    <field id="cm:title">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                    </field>
                    <field id="cm:description">
                        <control>
                            <control-param name="activateLinks">true</control-param>
                        </control>
                    </field>
                    <field id="cm:taggable">
                        <control>
                            <control-param name="compactMode">true</control-param>
                            <control-param name="params">aspect=cm:taggable</control-param>
                            <control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
                            <control-param name="createNewItemIcon">tag</control-param>
                        </control>
                    </field>
                    <field id="cm:categories">
                        <control>
                            <control-param name="compactMode">true</control-param>
                        </control>
                    </field>
                    <field id="box:archiveboxid">
                        <control template="/org/alfresco/components/form/controls/number.ftl">
                            <control-param name="maxLength">5</control-param>
                        </control>
                    </field>
                </appearance>
            </form>

          <!– Document Library pop-up Edit Metadata form –>
            <form id="doclib-simple-metadata">
                <field-visibility>
                    <show id="cm:name" />
                    <show id="cm:title" force="true" />
                    <show id="cm:description" force="true" />
                    <show id="box:archiveboxid"/>
               <!– tags and categories –>
                    <show id="cm:taggable" for-mode="edit" force="true" />
                    <show id="cm:categories" />
                </field-visibility>
                <edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
                <appearance>
                    <field id="cm:title">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                    </field>
                    <field id="cm:description">
                        <control>
                            <control-param name="activateLinks">true</control-param>
                        </control>
                    </field>
                    <field id="cm:taggable">
                        <control>
                            <control-param name="compactMode">true</control-param>
                            <control-param name="params">aspect=cm:taggable</control-param>
                            <control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
                            <control-param name="createNewItemIcon">tag</control-param>
                        </control>
                    </field>
                    <field id="cm:categories">
                        <control>
                            <control-param name="compactMode">true</control-param>
                        </control>
                    </field>
                    <field id="box:archiveboxid">
                        <control template="/org/alfresco/components/form/controls/number.ftl">
                            <control-param name="maxLength">5</control-param>
                        </control>
                    </field>
                </appearance>
            </form>
        </forms>
    </config>


   <!– cm:folder type (creating nodes) –>
    <config evaluator="model-type" condition="cm:folder">
        <forms>
         <!– Document Library Common form –>
            <form id="doclib-common">
                <field-visibility>
                    <show id="cm:name" />
                    <show id="cm:title" force="true" />
                    <show id="cm:description" force="true" />
                    <show id="box:archiveboxid"/>
                </field-visibility>
                <create-form template="../documentlibrary/forms/doclib-common.ftl" />
                <appearance>
                    <field id="cm:title">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                    </field>
                    <field id="box:archiveboxid">
                        <control template="/org/alfresco/components/form/controls/number.ftl">
                            <control-param name="maxLength">5</control-param>
                        </control>
                    </field>
                </appearance>
            </form>
    <config evaluator="string-compare" condition="DocumentLibrary" replace="true">

        <tree>       
            <evaluate-child-folders>true</evaluate-child-folders> 
            <maximum-folder-count>-1</maximum-folder-count>
        </tree>

  
        <aspects>
            <visible>
                <aspect name="cm:generalclassifiable" />
                <aspect name="cm:complianceable" />
                <aspect name="cm:dublincore" />
                <aspect name="cm:effectivity" />
                <aspect name="cm:summarizable" />
                <aspect name="cm:versionable" />
                <aspect name="cm:templatable" />
                <aspect name="cm:emailed" />
                <aspect name="emailserver:aliasable" />
                <aspect name="cm:taggable" />
                <aspect name="app:inlineeditable" />
                <aspect name="cm:geographic" />
                <aspect name="exif:exif" />
                <aspect name="can:dsl" />
                <aspect name="can:log" />
                <aspect name="can:batch" />
                <aspect name="box:archivebox"/>
            </visible>
   
         <!– ajouter un aspect ici si on souhaite uniquement pouvoir ajouter mais pas supprimer –>
            <addable>      
            </addable>
     
         <!– ajouter un aspect ici si on souhaite uniquement pouvoir supprimer mais pas ajouter –>
            <removeable>         
            </removeable>
        </aspects>
  
        <types>
            <type name="cm:content">
                <subtype name="mod:dta" />
                <subtype name="can:canl"/>
            </type>

            <type name="cm:folder">
            </type>
       <!– pour pouvoir typer un document avec ce type –>
         <!–<type name="my:sop"></type>–>
     
       
        </types>
  
        <google-docs>    
            <enabled>false</enabled>       
            <creatable-types>
                <creatable type="doc">application/msword</creatable>
                <creatable type="xls">application/vnd.ms-excel</creatable>
                <creatable type="ppt">application/vnd.ms-powerpoint</creatable>
            </creatable-types>
        </google-docs>
   
        <file-upload>      
            <adobe-flash-enabled>true</adobe-flash-enabled>
        </file-upload>
    </config>


</alfresco-config>
je continu mes recherches
Encore merci de l'aide

Pascal

pascal_sighma
Champ in-the-making
Champ in-the-making
Bonjour a tous,

Je n'ai pas eu beaucoup de succès avec mon post mais il est vrai que c'est les vacances dans notre chère métropole.

Donc j’espère que vos vacances ont été bonne.
Aurez vous l'inspiration pour m'aider sur mon pb précédemment cité?

Cordialement,

Pascal