public String getLocalizedName(){ if(localizedName != null) { return localizedName; } Node node = this.getJcrNode(); if(!(node instanceof HippoNode)){ localizedName = getName(); return localizedName; } try { localizedName = ((HippoNode)node).getLocalizedName(); return localizedName; } catch (RepositoryException e) { log.error("RepositoryException during fetching localizedName. Return null", e); return null; } }
private String getLocalizedNameForSession(final HippoNode node) throws RepositoryException { final Locale cmsLocale = UserSession.get().getLocale(); final Localized cmsLocalized = Localized.getInstance(cmsLocale); return node.getLocalizedName(cmsLocalized); }
@Override protected Dialog createRequestDialog() { try { name = ((HippoNode)((WorkflowDescriptorModel)getDefaultModel()).getNode()).getLocalizedName(); } catch(RepositoryException ex) { name = ""; } documents = new HashSet<String>(); Session session = ((UserSession)getSession()).getJcrSession(); Query query = null; try { QueryManager qMgr = session.getWorkspace().getQueryManager(); query = qMgr.createQuery(QUERY_STATEMENT_PUBLISH, QUERY_LANGUAGE_PUBLISH); } catch (RepositoryException ex) { log.error("Error preparing to publish all documents: {}", ex); } return new ExtendedFolderWorkflowPlugin.ConfirmDialog(this, new StringResourceModel("publish-all-title", ExtendedFolderWorkflowPlugin.this, null), new StringResourceModel("publish-all-text", ExtendedFolderWorkflowPlugin.this, null), new StringResourceModel("publish-all-subtext", ExtendedFolderWorkflowPlugin.this, null), new PropertyModel(ExtendedFolderWorkflowPlugin.this, "name"), documents, query); }
@Override protected Dialog createRequestDialog() { try { name = ((HippoNode)((WorkflowDescriptorModel)getDefaultModel()).getNode()).getLocalizedName(); } catch(RepositoryException ex) { name = ""; } documents = new HashSet<String>(); Session session = ((UserSession)getSession()).getJcrSession(); Query query = null; try { QueryManager qMgr = session.getWorkspace().getQueryManager(); query = qMgr.createQuery(QUERY_STATEMENT_DEPUBLISH, QUERY_LANGUAGE_DEPUBLISH); } catch (RepositoryException ex) { log.error("Error preparing to publish all documents: {}", ex); } return new ExtendedFolderWorkflowPlugin.ConfirmDialog(this, new StringResourceModel("depublish-all-title", ExtendedFolderWorkflowPlugin.this, null), new StringResourceModel("depublish-all-text", ExtendedFolderWorkflowPlugin.this, null), new StringResourceModel("depublish-all-subtext", ExtendedFolderWorkflowPlugin.this, null), new PropertyModel(ExtendedFolderWorkflowPlugin.this, "name"), documents, query); }
@Override protected Dialog createRequestDialog() { destination = new NodeModelWrapper(getFolder()) { }; CopyNameHelper copyNameHelper = new CopyNameHelper(getNodeNameCodec(), new StringResourceModel( "copyof", FullReviewedActionsWorkflowPlugin.this, null).getString()); try { name = copyNameHelper.getCopyName(((HippoNode) ((WorkflowDescriptorModel) getDefaultModel()) .getNode()).getLocalizedName(), destination.getNodeModel().getNode()); } catch (RepositoryException ex) { return new ExceptionDialog(ex); } Dialog dialog = new WorkflowAction.DestinationDialog( new StringResourceModel("copy-title", FullReviewedActionsWorkflowPlugin.this, null), new StringResourceModel("copy-name", FullReviewedActionsWorkflowPlugin.this, null), new PropertyModel(this, "name"), destination) { { setOkEnabled(true); } }; return dialog; }