4 Replies Latest reply: Apr 1, 2014 6:38 AM by 879338 RSS

    MDS export not showing site level customization.

    879338

      Recently we enabled user customization by creating UserCC and SiteCC classes. It is working fine. User customization is getting stored at uers level and site customization at site level.

       

      But now when we export MDS from enterprise manager its only showing user customization. Zip file does not contain any site level customization.

      We are sure that there are site level customization as any change done by admin in Ctrl+Shift+E mode is available to all users.

       

       

      Any suggestion why EM is not downloading site level customizations?

       

       

      Thanks

      Sanjeev

        • 1. Re: MDS export not showing site level customization.
          Daniel Merchán

          Hi.

           

          If is not downloading site customizations is because is just using and registered UserCC or no SiteCC were applied yet.

           

          EM downloads the entire MDS .

           

          Regards.

          • 2. Re: MDS export not showing site level customization.
            879338

            Hi Daniel, I am not clear with above explanation.

            You said EM downloads the entire MDS [it means all base documents + site level customized file (mdssys/cust/site) + user level customized file (mdssys/cust/user)]. BUT its only downloading either sitelevel customized file OR userlevel customized file. NOT both.

             

            What I found is, if we have following settings in adf-config.xml, it downloads User customization.

              <cust-config>

                    <match>

                      <customization-class name="oracle.adf.share.config.UserCC"/>

                    </match>

                  </cust-config>

             

            If we change it to SiteCC as shown below, it download Site level customization.

            <cust-config>

                    <match>

                      <customization-class name="oracle.adf.share.config.SiteCC"/>

                    </match>

                  </cust-config>

             

            Is there a way to download both?

             

             

            One other strange issue I found is when we put <customization-class name="oracle.adf.share.config.UserCC"/> in adf-config.xml and deployed application, it has removed all site level customization. Any suggestion?

             

            Thanks

            Sanjeev

            • 3. Re: MDS export not showing site level customization.
              Daniel Merchán

              Hi.

               

              Probably I confuse a little bit.

               

              Just to summarize the steps:

               

              •     (Optional) Develop your custom UserCC and SiteCC (if you want) following the official documentation or following references. You can copy directly from them making sure that UserCC takes de user from the ADFContext.

               

              •     In adf-config.xml you can define the list of Customization Classes to be used in each MDS path.

                      By default in a Portal Application contains:

              <cust-config>
                           <match path="/oracle/webcenter/siteresources/scopedMD/"/>
                            <match path="/oracle/webcenter/quicklinks/scopedMD/"/>
                              <match>
                                 <customization-class name="oracle.adf.share.config.SiteCC"/>
                              </match>
                      </cust-config>
              

                       It means that will use SiteCC from "/" for all customization. For example it can be changed for allow both layers.

              <cust-config>
                              <match path="/oracle/webcenter/siteresources/scopedMD/"/>
                          <match path="/oracle/webcenter/quicklinks/scopedMD/"/>
                          <match>
                            <customization-class name="oracle.adf.share.config.SiteCC"/>
                            <customization-class name="oracle.adf.share.config.UserCC"/>
                          </match>
                        </cust-config>
              

                    

              For exampel Portal (Spaces) in "/" by defaul uses:

              <match path="/">
                             <customization-class name="oracle.webcenter.webcenterapp.internal.metadata.WebCenterSiteCC"/>
                             <customization-class name="oracle.webcenter.webcenterapp.internal.metadata.WebCenterUserCC"/>
                         </match>
              

                

              • It works just configuring UserCC and SitesCC?. No, You have to create a ComposerSessionOptions to do the work between changing the layouts.

                

                  For example taken from Andrejus Blog:

              public class PortalSessionOptionsFactoryImpl implements ComposerSessionOptionsFactory {
                  public PortalSessionOptionsFactoryImpl() {
                  }
              
                  public SessionOptions createSessionOptions(SessionOptions sessionOptions, String mode) {
                      CustomizationClass[] custLayer;
                      CustConfig custConfig = null;
                      CustomizationPolicy cPol = null;
                      SecurityContext stx = ADFContext.getCurrent().getSecurityContext();
                     
                      if (ModeContext.EDIT_MODE.equals(mode) && stx.isUserInRole("Administrator")) {
                          //Mode is Edit, change to SiteCC
                          custLayer = EDIT_LAYER;
                      } else if (ModeContext.EDIT_MODE.equals(mode)) {
                          //Mode is Edit, change to UserCC
                          custLayer = EDIT_PERSONAL_LAYER;
                      } else {
                          //Mode is View, change to UserCC + SiteCC
                          custLayer = VIEW_LAYER;
                      }
                     
                      try {
                          CustClassList custClassList = new CustClassList(custLayer);
                          CustClassListMapping custClassListMapping = new CustClassListMapping("/", null, null, custClassList);
                          custConfig = new CustConfig(new CustClassListMapping[] { custClassListMapping });
                          cPol = new CustomizationPolicy(stx.getUserRoles());
                      } catch (Exception e) {
                          e.printStackTrace();
                      }
                      if (sessionOptions.getServletContextAsObject() != null) {
                          return new SessionOptions(sessionOptions.getIsolationLevel(),
                                                    sessionOptions.getLocale(), custConfig,
                                                    sessionOptions.getVersionContext(),
                                                    sessionOptions.getVersionCreatorName(),
                                                    cPol == null ?
                                                    sessionOptions.getCustomizationPolicy() :
                                                    cPol,
                                                    sessionOptions.getServletContextAsObject());
                      } else {
                          return new SessionOptions(sessionOptions.getIsolationLevel(),
                                                    sessionOptions.getLocale(), custConfig,
                                                    sessionOptions.getVersionContext(),
                                                    sessionOptions.getVersionCreatorName(),
                                                    cPol == null ?
                                                    sessionOptions.getCustomizationPolicy() :
                                                    cPol);
                      }
                  }
                  //Edit mode SiteCC
                  private static final CustomizationClass[] EDIT_LAYER = new CustomizationClass[] { new SiteCC() };
                  //Edit mode UserCC
                  private static final CustomizationClass[] EDIT_PERSONAL_LAYER = new CustomizationClass[] { new UserCC() };
                  //View mode SiteCC + USerCC
                  private static final CustomizationClass[] VIEW_LAYER = new CustomizationClass[] { new SiteCC(), new UserCC() };
              }
              

                

              • This class have to be configured as part of the adf-config.xml
              <pe:page-editor-config>
                   <pe:session-options-factory>your.java.package.PortalSessionOptionsFactoryImpl</pe:session-options-factory>
              

                

              To make it works you have also to register following Filter in web.xml. This filter should be declared before of the adfBindings.

              <!-- WebCenterComposerFilter goes here -->
                <filter>
                  <filter-name>composerFilter</filter-name>
                <filter-class>oracle.adf.view.page.editor.webapp.WebCenterComposerFilter</filter-class>
                </filter>
                <filter>
                  <filter-name>adfBindings</filter-name>
                  <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
                </filter>
              .....
                <!-- WebCenterComposerFilter mapping goes here -->
                <filter-mapping>
                  <filter-name>composerFilter</filter-name>
                  <servlet-name>Faces Servlet</servlet-name>
                  <dispatcher>FORWARD</dispatcher>
                  <dispatcher>REQUEST</dispatcher>
                </filter-mapping>
                <filter-mapping>
                  <filter-name>adfBindings</filter-name>
                  <servlet-name>Faces Servlet</servlet-name>
                  <dispatcher>FORWARD</dispatcher>
                  <dispatcher>REQUEST</dispatcher>
                </filter-mapping>
              ....
              

                 

                

              • Troubleshooting if still doesn't works:
                • If it doesn't work, enable User Customization via Portal - Project Properties -> ADF View (checking the customization checkboxes).
                • Change <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name> value to oracle.adf.view.rich.change.MDSDocumentChangeManager.

                    

              With this it should work and WebCenter should export all MDS because you are now saying that "/" will use SiteCC and UserCC layers.

               

              I hope this helps

              Regards.

              • 4. Re: MDS export not showing site level customization.
                879338

                Thank you Daniel for your response. Below code has resolved the issue.

                <cust-config> 

                      <match path="/oracle/webcenter/siteresources/scopedMD/"/> 

                      <match path="/oracle/webcenter/quicklinks/scopedMD/"/> 

                      <match> 

                           <customization-class name="oracle.adf.share.config.SiteCC"/> 

                           <customization-class name="oracle.adf.share.config.UserCC"/> 

                      </match> 

                </cust-config> 


                I was either using SiteCC or UserCC, which was causing to either download Site customization or User Customization. Thank you for pointing out that we can add both, which starts downloading both Site and User customization.


                Thanks

                Sanjeev.