Package org.apache.roller.weblogger.pojos

Examples of org.apache.roller.weblogger.pojos.Weblog


    public Entry postEntry(String[] pathInfo, Entry entry) throws AtomException {
        log.debug("Entering");
        try {
            // authenticated client posted a weblog entry
            String handle = pathInfo[0];
            Weblog website =
                roller.getUserManager().getWebsiteByHandle(handle);
            if (website == null) {
                throw new AtomNotFoundException("Cannot find weblog: " + handle);
            }
            if (!canEdit(website)) {
View Full Code Here


                    }
                } else if (pathInfo[1].equals("resource") && pathInfo[pathInfo.length - 1].endsWith(".media-link")) {
                    String filePath = filePathFromPathInfo(pathInfo);
                    filePath = filePath.substring(0, filePath.length() - ".media-link".length());
                    String handle = pathInfo[0];
                    Weblog website =
                        roller.getUserManager().getWebsiteByHandle(handle);                   
                    ThemeResource resource =
                        roller.getFileManager().getFile(website, filePath);
                   
                    log.debug("Exiting");
View Full Code Here

           
            List websiteDatas = new ArrayList();
            for (int i = 0; i < c.getEntries().length; i++) {
                WeblogEntry entry = (WeblogEntry)c.getEntries()[i];
                User user = mgr.getUserByUserName(entry.getCreatingUser());
                Weblog wd = new Weblog(
                        entry.getHandle(),
                        user,
                        entry.getName(),
                        entry.getDescription(),
                        entry.getEmailAddress(),
                        entry.getEmailAddress(),
                        DEFAULT_THEME,
                        entry.getLocale().toString(),
                        entry.getTimezone().getID());
               
                Date dateCreated  = entry.getDateCreated();
                if (dateCreated == null) {
                    dateCreated = new Date();
                }
                wd.setDateCreated(dateCreated);
               
                Boolean enabled = entry.getEnabled();
                if (enabled != null) {
                    wd.setEnabled(enabled);
                }
               
                try {
                    String def = WebloggerRuntimeConfig.getProperty("users.editor.pages");
                    String[] defs = Utilities.stringToStringArray(def,",");
                    wd.setEditorPage(defs[0]);
                } catch (Exception ex) {
                    log.error("ERROR setting default editor page for weblog", ex);
                }
               
                mgr.addWebsite(wd);
View Full Code Here

            // authenticated client posted a weblog entry
            File tempFile = null;
            String handle = pathInfo[0];
            FileManager fmgr = roller.getFileManager();
            UserManager umgr = roller.getUserManager();
            Weblog website = umgr.getWebsiteByHandle(handle);
            if (!canEdit(website)) {
                throw new AtomNotAuthorizedException("Not authorized to edit weblog: " + handle);
            }
            if (pathInfo.length > 1) {
                try {                                       
View Full Code Here

                        roller.flush();
                        return;
                    }
                } else if (pathInfo[1].equals("resource")) {
                    String handle = pathInfo[0];
                    Weblog website = roller.getUserManager().getWebsiteByHandle(handle);
                    if (website == null) {
                        throw new AtomNotFoundException("cannot find specified weblog");
                    }
                    if (canEdit(website) && pathInfo.length > 1) {
                        try {                           
View Full Code Here

        HashMap pages = null;
       
        List websiteDatas = new ArrayList();
        for (int i = 0; i < c.getEntries().length; i++) {
            WeblogEntry entry = (WeblogEntry)c.getEntries()[i];
            Weblog wd = getWebsiteData(entry.getHandle());
            updateWebsiteData(wd, entry);
            websiteDatas.add(wd);
        }
        return toWeblogEntrySet((Weblog[])websiteDatas.toArray(new Weblog[0]));
    }
View Full Code Here

            // authenticated client posted a weblog entry
            File tempFile = null;
            String handle = pathInfo[0];
            FileManager fmgr = roller.getFileManager();
            UserManager umgr = roller.getUserManager();
            Weblog website = umgr.getWebsiteByHandle(handle);
            if (!canEdit(website)) {
                throw new AtomNotAuthorizedException("Not authorized to edit weblog: " + handle);
            }
            if (pathInfo.length > 1) {
                // Save to temp file
View Full Code Here

        String handle = getUri().getEntryId();
       
        try {
            UserManager mgr = getRoller().getUserManager();
           
            Weblog wd = getWebsiteData(handle);
           
            CacheManager.invalidate(wd);

            mgr.removeWebsite(wd);
            getRoller().flush();
View Full Code Here

            // authenticated client posted a weblog entry
            File tempFile = null;
            String handle = pathInfo[0];
            FileManager fmgr = roller.getFileManager();
            UserManager umgr = roller.getUserManager();
            Weblog website = umgr.getWebsiteByHandle(handle);
            if (!canEdit(website)) {
                throw new AtomNotAuthorizedException("Not authorized to edit weblog: " + handle);
            }
            if (pathInfo.length > 1) {
                // Save to temp file
View Full Code Here

        for (int i = 0; i < uds.length; i++) {
            User ud = uds[i];
            List permissions = ud.getPermissions();
            for (Iterator j = permissions.iterator(); j.hasNext(); ) {
                WeblogPermission pd = (WeblogPermission)j.next();
                Weblog wd = pd.getWebsite();
                WeblogEntry we = toWeblogEntry(wd);
                entries.add(we);
            }
        }
        wes.setEntries((Entry[])entries.toArray(new Entry[0]));
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.pojos.Weblog

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.