[Castore-commits] CollectionBeanFactory.java 1.4 1.5

Arnaud Thimel thimel at adullact1.hosting.cri74.org
Ven 16 Juin 18:54:42 CEST 2006


Update of /cvsroot/castore/castore-presentation/src/java/fr/emn/castor/presentation/collection
In directory adullact1:/tmp/cvs-serv761/src/java/fr/emn/castor/presentation/collection

Modified Files:
	CollectionBeanFactory.java 
Log Message:
- Deplacement d'une methode utilitaire
- imports statiques

Index: CollectionBeanFactory.java
===================================================================
RCS file: /cvsroot/castore/castore-presentation/src/java/fr/emn/castor/presentation/collection/CollectionBeanFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CollectionBeanFactory.java	14 Jun 2006 18:16:22 -0000	1.4
--- CollectionBeanFactory.java	16 Jun 2006 16:54:40 -0000	1.5
***************
*** 48,55 ****
  import static fr.emn.castor.presentation.documents.DocumentBean.COLL_TYP_PRV;
  import static fr.emn.castor.presentation.documents.DocumentBean.COLL_TYP_PUB;
! import static fr.emn.castor.presentation.documents.DocumentBean.ETAT_DOC_ACPT;
! import static fr.emn.castor.presentation.documents.DocumentBean.ETAT_DOC_ATT;
! import static fr.emn.castor.presentation.documents.DocumentBean.ETAT_DOC_PRV;
! import static fr.emn.castor.presentation.documents.DocumentBean.ETAT_DOC_RFS;
  
  import java.util.List;
--- 48,53 ----
  import static fr.emn.castor.presentation.documents.DocumentBean.COLL_TYP_PRV;
  import static fr.emn.castor.presentation.documents.DocumentBean.COLL_TYP_PUB;
! import static fr.emn.castor.presentation.documents.DocumentBeanFactory.getDocumentBean;
! import static fr.emn.castor.presentation.documents.DocumentBeanFactory.getDocumentBeanState;
  
  import java.util.List;
***************
*** 62,70 ****
  import fr.emn.castor.collections.ICollection;
  import fr.emn.castor.common.CoreProxy;
- import fr.emn.castor.documents.Facade;
- import fr.emn.castor.documents.DocumentsConstants.StateEnum;
  import fr.emn.castor.presentation.documents.DocumentBean;
- import fr.emn.castor.presentation.documents.DocumentBeanFactory;
- import fr.emn.castor.users.UsersException;
  
  /**
--- 60,64 ----
***************
*** 117,137 ****
          for (String idDoc : content) {
              DocumentBean docBean = null;
!             String docBeanState = getBeanState(idDoc);
              if (!collId.equals("panier")) {
                  String collType = fColl.getTypeCollection(collId);
                  if (COLLECTION_PUBLIQUE.equals(collType)) {
!                     docBean = DocumentBeanFactory.getDocumentBean(
!                         idDoc, userOnLine, docBeanState,
                          COLL_TYP_PUB, collId);
                  } else if (COLLECTION_PRIVEE.equals(collType)) {
!                     docBean = DocumentBeanFactory.getDocumentBean(
!                         idDoc, userOnLine, docBeanState,
                          COLL_TYP_PRV, collId);
                  } else if (COLLECTION_NATIVE.equals(collType)) {
!                     docBean = DocumentBeanFactory.getDocumentBean(
!                         idDoc, userOnLine, docBeanState);
                  } else {
!                     docBean = DocumentBeanFactory.getDocumentBean(
!                         idDoc, userOnLine, docBeanState);
                      if (log.isErrorEnabled()) {
                          log.warn("Type de collection inconnue : " + collType);
--- 111,127 ----
          for (String idDoc : content) {
              DocumentBean docBean = null;
!             String docBeanState = getDocumentBeanState(idDoc);
              if (!collId.equals("panier")) {
                  String collType = fColl.getTypeCollection(collId);
                  if (COLLECTION_PUBLIQUE.equals(collType)) {
!                     docBean = getDocumentBean(idDoc, userOnLine, docBeanState,
                          COLL_TYP_PUB, collId);
                  } else if (COLLECTION_PRIVEE.equals(collType)) {
!                     docBean = getDocumentBean(idDoc, userOnLine, docBeanState,
                          COLL_TYP_PRV, collId);
                  } else if (COLLECTION_NATIVE.equals(collType)) {
!                     docBean = getDocumentBean(idDoc, userOnLine, docBeanState);
                  } else {
!                     docBean = getDocumentBean(idDoc, userOnLine, docBeanState);
                      if (log.isErrorEnabled()) {
                          log.warn("Type de collection inconnue : " + collType);
***************
*** 139,144 ****
                  }
              } else {
!                 docBean = DocumentBeanFactory.getDocumentBean(
!                     idDoc, userOnLine, docBeanState,
                      COLL_TYP_PANIER, collId);
              }
--- 129,133 ----
                  }
              } else {
!                 docBean = getDocumentBean(idDoc, userOnLine, docBeanState,
                      COLL_TYP_PANIER, collId);
              }
***************
*** 161,190 ****
      }
  
-     /**
-      * Renvoie l'etat du document
-      * @param idDoc
-      * @return une String parmi les valeurs definies dans {@link DocumentBean}
-      */
-     private static String getBeanState(String idDoc) {
-         Facade docFac = Facade.getInstance();
-         StateEnum docState = null;
-         try {
-             docState = docFac.getStateOfDoc(idDoc);
-         } catch (UsersException e) {
-             if (log.isErrorEnabled()) {
-                 log.error(
-                        "Erreur lors de la recherche de l'état du document" + e);
-             }
-         }
-         if (docState == StateEnum.PRIVATE) {
-             return ETAT_DOC_PRV;
-         } else if (docState == StateEnum.VALIDATED) {
-             return ETAT_DOC_ACPT;
-         } else if (docState == StateEnum.REFUSED) {
-             return ETAT_DOC_RFS;
-         } else {
-             return ETAT_DOC_ATT;
-         }
-     }
- 
  } //CollectionBeanFactory
--- 150,152 ----




Plus d'informations sur la liste de diffusion Castore-commits