/** * Creates a dependency object for the given root path, to be used only for test cases.<p> * * @param rootPath the root path to create the dependency object for * * @return a dependency object for the given parameters */ protected static CmsDocumentDependency loadForTest(String rootPath) { return new CmsDocumentDependency(null, rootPath); }
/** * Returns the locale (language) of the given resource based on the resource root path.<p> * * @param rootPath the resource name to check for the locale information * * @return the locale of the given resource based on the resource root path */ public static Locale getLocale(String rootPath) { return (new CmsDocumentDependency(null, rootPath)).getLocale(); }
/** * Loads or creates a dependency object for the given parameters.<p> * * @param cms the current OpenCms user context * @param pubRes the published resource to get the dependency object for * * @return a dependency object for the given parameters */ public static CmsDocumentDependency load(CmsObject cms, CmsPublishedResource pubRes) { CmsDocumentDependency result = readFromContext(cms, pubRes.getRootPath()); if (result == null) { result = new CmsDocumentDependency(pubRes); result.readDependencies(cms); } return result; }
/** * Loads or creates a dependency object for the given parameters.<p> * * @param cms the current OpenCms user context * @param res the VFS resource to get the dependency object for * * @return a dependency object for the given parameters */ public static CmsDocumentDependency load(CmsObject cms, CmsResource res) { CmsDocumentDependency result = readFromContext(cms, res.getRootPath()); if (result == null) { result = new CmsDocumentDependency(res); result.readDependencies(cms); } return result; }
/** * Loads or creates a dependency object for the given parameters.<p> * * @param cms the current OpenCms user context * @param res the VFS resource to get the dependency object for * @param resources the resource folder data to check for dependencies * * @return a dependency object for the given parameters */ public static CmsDocumentDependency load(CmsObject cms, CmsResource res, List<CmsResource> resources) { CmsDocumentDependency result = readFromContext(cms, res.getRootPath()); if (result == null) { result = new CmsDocumentDependency(res); result.readDependencies(cms, resources); } return result; }
CmsDocumentDependency result = new CmsDocumentDependency(null, rootPath); if (input != null) { CmsDocumentDependency main = new CmsDocumentDependency(null, jsonMain.getString(JSON_PATH)); main.fromJSON(jsonMain, rootPath); result.setMainDocument(main); } else { String rp = doc.substring(3); CmsDocumentDependency dep = new CmsDocumentDependency(null, rp); if (!loc.equals(result.getLocale())) { dep.setLocale(new Locale(lang));
JSONObject jsonLang = (JSONObject)jsonLanguages.get(i); CmsDocumentDependency lang = new CmsDocumentDependency(null, jsonLang.getString(JSON_PATH)); lang.fromJSON(jsonLang, rootPath); addVariant(lang); JSONObject jsonAttachment = (JSONObject)jsonAttachments.get(i); CmsDocumentDependency att = new CmsDocumentDependency( null, jsonAttachment.getString(JSON_PATH)); JSONObject jsonAttLanguage = (JSONObject)jsonAttLanguages.get(j); CmsDocumentDependency attLang = new CmsDocumentDependency( null, jsonAttLanguage.getString(JSON_PATH));
getResource().getPublishTag(), CmsResourceState.STATE_CHANGED); CmsDocumentDependency dep = new CmsDocumentDependency(pubRes); if (getDocumentName().equals(dep.getDocumentName())) { if (isAttachment()) {