@@ -3866,6 +3866,7 @@ public Object postInstanciatePortfolio(MimeType inMimeType, String portfolioUuid
38663866 String sql = "" ;
38673867 PreparedStatement st ;
38683868 String newPortfolioUuid = UUID .randomUUID ().toString ();
3869+ boolean setPublic = false ;
38693870
38703871 try
38713872 {
@@ -4614,32 +4615,23 @@ groupright getUuid( String uuid )
46144615 role .setNotify (merge );
46154616 }
46164617
4617- // No need to set public on multiple portoflio
4618- /*
4618+ // Check if we have to put the portfolio as public
46194619 meta = res .getString ("metadata" );
46204620 nodeString = "<?xml version='1.0' encoding='UTF-8' standalone='no'?><transfer " +meta +"/>" ;
46214621 is = new InputSource (new StringReader (nodeString ));
46224622 doc = documentBuilder .parse (is );
46234623 attribNode = doc .getDocumentElement ();
46244624 attribMap = attribNode .getAttributes ();
4625-
4626- boolean isPublic = false;
4627- try
4628- {
4629- String publicatt = attribMap.getNamedItem("public").getNodeValue();
4630- if( "Y".equals(publicatt) )
4631- isPublic = true;
4632- }
4633- catch(Exception ex) {}
4634- setPublicState(userId, puuid, isPublic);
4635- //*/
4636-
4625+ Node publicatt = attribMap .getNamedItem ("public" );
4626+ if ( publicatt != null && "Y" .equals (publicatt .getNodeValue ()) )
4627+ setPublic = true ;
46374628 }
46384629 catch ( Exception e )
46394630 {
46404631 e .printStackTrace ();
46414632 }
46424633 }
4634+
46434635 res .close ();
46444636 st .close ();
46454637
@@ -4793,6 +4785,9 @@ groupright getUuid( String uuid )
47934785 /// Ajoute la personne dans ce groupe
47944786 putUserGroup (Integer .toString (groupid ), Integer .toString (userId ));
47954787
4788+ /// Set portfolio public if needed
4789+ if ( setPublic )
4790+ setPublicState (userId , newPortfolioUuid , setPublic );
47964791 }
47974792 catch ( Exception e )
47984793 {
0 commit comments