-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #11315 fixes remove on put anitpattern * #11362 replaces dotParse and parseContainer macros with Directives * #11362 removing old macros * #11362 adding runtime exception versions of popular methods * #11362 fixing service methods * #11362 working like a charm * #11362 replacing stringbuffers with budilers * #11362 reverting ReleaseInfo
- Loading branch information
1 parent
e31007e
commit fccff5a
Showing
48 changed files
with
527 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 0 additions & 118 deletions
118
dotCMS/src/main/java/com/dotmarketing/velocity/DotParseDirective.java
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
dotCMS/src/main/java/com/dotmarketing/velocity/directive/ContentletDetail.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.dotmarketing.velocity.directive; | ||
|
||
import java.io.Writer; | ||
|
||
import org.apache.velocity.context.Context; | ||
|
||
import com.dotmarketing.business.APILocator; | ||
import com.dotmarketing.business.DotStateException; | ||
import com.dotmarketing.exception.DotDataException; | ||
import com.dotmarketing.exception.DotRuntimeException; | ||
import com.dotmarketing.portlets.contentlet.model.ContentletVersionInfo; | ||
import com.dotmarketing.util.Config; | ||
|
||
public class ContentletDetail extends DotDirective { | ||
|
||
|
||
|
||
private static final long serialVersionUID = 1L; | ||
final static String EXTENSION = Config.getStringProperty("VELOCITY_CONTENT_EXTENSION", "content"); | ||
|
||
|
||
@Override | ||
public String getName() { | ||
return "contentDetail"; | ||
} | ||
|
||
|
||
|
||
@Override | ||
String resolveTemplatePath(final Context context, final Writer writer, final RenderParams params, final String argument) { | ||
|
||
ContentletVersionInfo cv = null; | ||
|
||
try { | ||
cv = APILocator.getVersionableAPI().getContentletVersionInfo(argument, params.language.getId()); | ||
if (cv == null) { | ||
long defualtLang = APILocator.getLanguageAPI().getDefaultLanguage().getId(); | ||
if (defualtLang != params.language.getId()) { | ||
cv = APILocator.getVersionableAPI().getContentletVersionInfo(argument, defualtLang); | ||
} | ||
} | ||
} catch (DotStateException | DotDataException e1) { | ||
throw new DotRuntimeException(e1); | ||
} | ||
|
||
|
||
return (params.live) | ||
? "/live/" + argument + "_" + cv.getLang() + "." + EXTENSION | ||
: "/working/" + argument + "_" + cv.getLang() + "." + EXTENSION; | ||
|
||
|
||
|
||
} | ||
} | ||
|
Oops, something went wrong.