Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.Theme


    @SuppressWarnings("unchecked")
    @Override
    public PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters)
    {
        ArrayList<TabTemplate> tabTemplateResults = new ArrayList<TabTemplate>();
        Theme themeResult = null;

        // if params contain source list and it's not empty, try to create tab templates by matching against
        // membership criteria.
        if (inParameters.containsKey(sourceListKey) && !((ArrayList<String>) inParameters.get(sourceListKey)).isEmpty())
        {
View Full Code Here


            {
                mcdto.setGalleryTabTemplateId(mcgtt.getId());
                mcdto.setGalleryTabTemplateName(mcgtt.getTitle());
            }

            Theme mct = mc.getTheme();
            if (mct != null)
            {
                mcdto.setThemeId(mct.getId());
                mcdto.setThemeName(mct.getName());
            }

            results.add(mcdto);
        }
View Full Code Here

     */
    @Override
    public void validate(final PrincipalActionContext inActionContext)
    {
        String themeId = (String) inActionContext.getParams();
        Theme theme;
        // UUID identified by starting with { and ending with }
        if (themeId.startsWith("{") && themeId.substring(themeId.length() - 1).equals("}"))
        {
            // theme is UUID
            theme = themeMapper.findByUUID(themeId.substring(1, themeId.length() - 1));
View Full Code Here

    @Override
    public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext)
    {
        // get theme info needed.
        Long themeId = (Long) inActionContext.getActionContext().getParams();
        Theme theme = findByIdMapper.execute(new FindByIdRequest("Theme", themeId));
        String themeUuid = theme.getUUID();

        // Create list of cacheKeys to delete, initialized with the two keys for the theme being deleted.
        HashSet<String> cacheKeysToDelete = new HashSet<String>(Arrays.asList(CacheKeys.THEME_CSS_BY_UUID + themeUuid,
                CacheKeys.THEME_HASH_BY_UUID + themeUuid));
View Full Code Here

        {
            String themeId = (String) inActionContext.getParams();
            Long userId = inActionContext.getPrincipal().getId();

            // try grabbing theme from validation
            Theme theme = (Theme) inActionContext.getState().get("THEME");

            if (theme == null)
            {
                if (themeId.startsWith("{") && themeId.substring(themeId.length() - 1).equals("}"))
                {
                    // theme is UUID
                    theme = themeMapper.findByUUID(themeId.substring(1, themeId.length() - 1));
                }
                else
                {
                    // Theme is a URL, find or create.
                    theme = themeMapper.findByUrl(themeId);
                }
            }
            if (theme == null)
            {
                throw new RuntimeException("Can't find theme.");
            }

            Person person = personMapper.findById(userId);
            log.debug("Got StartPage for " + inActionContext.getPrincipal().getAccountId());

            person.setTheme(theme);
            personMapper.flush();
            log.debug("Set theme to " + theme.getName());

            deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID + userId));

            return theme.getCssFile();
        }
        catch (Exception ex)
        {
            throw new ExecutionException(ex);
        }
View Full Code Here

     *
     * @return the theme
     */
    public Theme create()
    {
        return new Theme();
    }
View Full Code Here

     */
    public Theme findByUrl(final String themeLocation)
    {
      try
      {
          Theme theme = null;
          Query q = getEntityManager().createQuery(
                  "from Theme where themeUrl = :themeUrl").setParameter(
                  "themeUrl", themeLocation.toLowerCase());

          //This avoids entity manager doing a flush before executing
View Full Code Here

     *            The theme to delete.
     */
    public void delete(final Theme inTheme)
    {
        // get the default gallery item
        Theme defaultTheme = findDefault();

        for (Person personUser : inTheme.getUsers())
        {
            personUser.setTheme(defaultTheme);
        }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.Theme

Copyright © 2018 www.massapicom. 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.