Package com.agiletec.plugins.jacms.apsadmin.content

Examples of com.agiletec.plugins.jacms.apsadmin.content.IntroNewContentAction


public class IntroNewContentActionAspect {
 
  @After("execution(* com.agiletec.plugins.jacms.apsadmin.content.IntroNewContentAction.createNewVoid())")
  public void checkCreateNewContent(JoinPoint joinPoint) {
    try {
      IntroNewContentAction action = (IntroNewContentAction) joinPoint.getTarget();
      List<SmallContentType> allowedContentTypes = this.getAllowedContentTypes();
      boolean check = false;
      for (int i = 0; i < allowedContentTypes.size(); i++) {
        SmallContentType contentType = allowedContentTypes.get(i);
        if (contentType.getCode().equals(action.getContentTypeCode())) {
          check = true;
          break;
        }
      }
      if (!check) {
        SmallContentType contentType = (SmallContentType) this.getContentManager().getSmallContentTypesMap().get(action.getContentTypeCode());
        String typeDescr = contentType != null ? contentType.getCode() : action.getContentTypeCode();
        action.addFieldError("contentTypeCode", action.getText("error.content.contentType.userNotAllowed", typeDescr));
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getAllowedContentTypes", "Error checking content type authorization");
          throw new RuntimeException("Error extracting allowed content types", t);
    }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jacms.apsadmin.content.IntroNewContentAction

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.