Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.DataStorage.load()


            // The only way to retrieve the information if the state is not transient is if we're within the portal context
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    portlet = dataStorage.load(state, ApplicationType.PORTLET);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain portlet state.");
                }

                try {
View Full Code Here


    }

    public boolean isLossData() {
        try {
            DataStorage service = getApplicationComponent(DataStorage.class);
            service.load(state, ApplicationType.GADGET);
            if (getApplication() == null) {
                throw new Exception();
            }

            if (metadata_ == null) {
View Full Code Here

     * @return the string represents user preference of gadget application
     * @throws Exception when can't convert object to string
     */
    public String getUserPref() throws Exception {
        DataStorage service = getApplicationComponent(DataStorage.class);
        org.exoplatform.portal.pom.spi.gadget.Gadget pp = service.load(state, ApplicationType.GADGET);
        return pp != null ? pp.getUserPref() : null;
    }

    public void addUserPref(String addedUserPref) throws Exception {
        DataStorage service = getApplicationComponent(DataStorage.class);
View Full Code Here

            // Hate doing this, but it's the only way to deal with persistent application state...
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage ds = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    S s = ds.load(existing, type);
                    String contentId = ds.getId(existing);

                    return new TransientApplicationState<S>(contentId, s);
                } catch (Exception e) {
                    throw new RuntimeException("Exception copying persistent application state.", e);
View Full Code Here

            // The only way to retrieve the information if the state is not transient is if we're within the portal context
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    portlet = dataStorage.load(state, ApplicationType.PORTLET);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain portlet state.");
                }

                try {
View Full Code Here

            // Hate doing this, but it's the only way to deal with persistent application state...
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage ds = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    S s = ds.load(existing, type);
                    String contentId = ds.getId(existing);

                    return new TransientApplicationState<S>(contentId, s);
                } catch (Exception e) {
                    throw new RuntimeException("Exception copying persistent application state.", e);
View Full Code Here

   public boolean isRendered()
   {
      try
      {
         DataStorage service = getApplicationComponent(DataStorage.class);
         service.load(state, ApplicationType.GADGET);
         if (getApplication() == null)
         {
            throw new Exception();
         }
      }
View Full Code Here

   public boolean isLossData()
   {
      try
      {
         DataStorage service = getApplicationComponent(DataStorage.class);
         service.load(state, ApplicationType.GADGET);
         if (getApplication() == null)
         {
            throw new Exception();
         }
      }
View Full Code Here

    * @throws Exception when can't convert object to string
    */
   public String getUserPref() throws Exception
   {
      DataStorage service = getApplicationComponent(DataStorage.class);
      org.exoplatform.portal.pom.spi.gadget.Gadget pp = service.load(state, ApplicationType.GADGET);
      return pp != null ? pp.getUserPref() : null;
   }

   public void addUserPref(String addedUserPref) throws Exception
   {
View Full Code Here

   }

   public void addUserPref(String addedUserPref) throws Exception
   {
      DataStorage service = getApplicationComponent(DataStorage.class);
      org.exoplatform.portal.pom.spi.gadget.Gadget gadget = service.load(state, ApplicationType.GADGET);
      if (gadget == null)
      {
         gadget = new org.exoplatform.portal.pom.spi.gadget.Gadget();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.